/* ============================================================
   Admin-surface additions only.
   Loaded after base.css + app.css. Reuses existing tokens from
   base.css (--bg, --border, --accent, --radius-*, etc.) and
   reuses app.css components as-is where dashboard.html already
   established them (.app-main, .app-header-bar, .app-title,
   .app-sub, .modal-overlay, .modal-card, .modal-header,
   .modal-actions, .icon-btn, .pill-btn, .org-pill, .badge,
   .empty-state, .sidebar-heading). Nothing below redefines those.
   ============================================================ */

/* ----- admin area marker next to the logo ----- */
.admin-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
  vertical-align: middle;
}

/* ----- filter bar (search + selects above a table) ----- */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.filter-input,
.filter-select {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
}
.filter-input {
  flex: 1;
  min-width: 200px;
}
.filter-input:focus,
.filter-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.filter-bar .btn {
  padding: 10px 22px;
  font-size: 14px;
}

/* ----- data table ----- */
.table-wrap {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}
.data-table th {
  text-align: left;
  padding: 14px 20px;
  color: var(--text-faint);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr {
  transition: 0.15s;
}
.data-table tbody tr:hover {
  background: var(--accent-soft);
}
.data-table td.cell-muted {
  color: var(--text-muted);
}
.data-table td.cell-mono {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  color: var(--text-muted);
}

/* ----- status / role pills ----- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.status-pill.is-active {
  color: var(--success);
  border-color: #1f4a3a;
  background: rgba(52, 211, 153, 0.08);
}
.status-pill.is-active::before {
  background: var(--success);
}
.status-pill.is-inactive {
  color: var(--danger);
  border-color: #4a2530;
  background: rgba(248, 113, 113, 0.08);
}
.status-pill.is-inactive::before {
  background: var(--danger);
}

.role-badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.role-badge.role-owner,
.role-badge.role-superadmin {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ----- link-style action button inside table rows ----- */
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.link-btn + .link-btn {
  margin-left: 16px;
}

/* ----- pagination ----- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}
.pagination .page-controls {
  display: flex;
  gap: 8px;
}

/* ----- KPI stat cards ----- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 30px;
  color: var(--text-heading);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.stat-delta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}
.stat-delta.positive {
  color: var(--success);
}

/* ----- admin section (lighter than marketing <section>) ----- */
.admin-section {
  padding: 0 0 44px;
  border-bottom: none;
}
.admin-section-title {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.admin-section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* ----- simple horizontal bar chart, no chart library ----- */
.chart-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.chart-card + .chart-card {
  margin-top: 20px;
}
.chart-title {
  font-size: 14px;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.chart-sub {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.bar-row .bar-label {
  color: var(--text-muted);
  text-align: right;
}
.bar-track {
  background: var(--bg-panel);
  border-radius: var(--radius-pill);
  height: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}
.bar-fill.alt {
  background: #4a5578;
}
.bar-row .bar-value {
  color: var(--text-faint);
  text-align: left;
}

/* ----- detail page (org / user) ----- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 28px;
}
.detail-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.detail-value {
  font-size: 16px;
  color: var(--text-heading);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}
.back-link:hover {
  color: var(--text-heading);
}

/* ----- inline edit controls on detail pages ----- */
.inline-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inline-edit-row select,
.inline-edit-row input {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
}

/* ----- invite token display ----- */
.token-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 10px;
}
.token-box code {
  flex: 1;
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
  font-family: 'SFMono-Regular', Consolas, monospace;
}

.form-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: -6px;
  margin-bottom: 16px;
}

/* ----- empty / loading rows inside tables ----- */
.table-empty-row td {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 20px;
}


.logout-bottom-left {
padding: 16px 20px;
}

.logout-bottom-left .btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.logout-bottom-left .btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.05);
}