/* ═══════════════════════════════════════════════════
   Admin — Pane + Tab Bar Layout
   ═══════════════════════════════════════════════════ */

/* Page container */
.admin-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

/* ── Pane container ── */
.admin-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg-surface);
  border-radius: 12px;
  box-shadow: var(--header-shadow);
  overflow: hidden;
}

/* ── Pane header ── */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: none;
  flex-shrink: 0;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header-icon {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.admin-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* ── Tab bar (mirrors companydetail.css) ── */
.admin-pane .tab-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.admin-pane .tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 14px 16px 12px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.admin-pane .tab-btn::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.15s;
}

.admin-pane .tab-btn:hover {
  color: var(--text-primary);
}

.admin-pane .tab-btn.active {
  color: var(--text-primary);
  font-weight: 600;
}

.admin-pane .tab-btn.active::after {
  background: var(--input-focus-border);
}

/* ── Pane body (tab content area) ── */
.admin-body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.stat-card:hover {
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--avatar-gradient-from),
    var(--avatar-gradient-to)
  );
  flex-shrink: 0;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text-inverse);
  stroke: currentColor;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Section headings ── */
.section-heading {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Quick-action cards ── */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
  position: relative;
}

.action-card:hover {
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
}

.action-card:active {
  box-shadow: var(--card-active-shadow);
}

.action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--nav-active-bg);
  flex-shrink: 0;
}

.action-icon svg {
  width: 20px;
  height: 20px;
  color: var(--nav-active-color);
  stroke: currentColor;
}

.action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.action-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.action-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.action-arrow {
  position: absolute;
  right: 16px;
  width: 16px;
  height: 16px;
  color: var(--card-arrow-color);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.action-card:hover .action-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Activity placeholder ── */
.activity-section {
  margin-bottom: 32px;
}

.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg-inset);
  border: 1px dashed var(--border-default);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 8px;
}

.activity-empty svg {
  width: 32px;
  height: 32px;
  color: var(--text-faint);
}

/* ── Scrollbar ── */
.admin-body::-webkit-scrollbar {
  width: 6px;
}

.admin-body::-webkit-scrollbar-track {
  background: transparent;
}

.admin-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.admin-body::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ═══════════════════════════════════════════════════
   Admin — Tab Empty State
   ═══════════════════════════════════════════════════ */

.admin-tab-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 12px;
}

.admin-tab-empty svg {
  width: 40px;
  height: 40px;
  color: var(--text-faint);
}

.admin-tab-empty h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-tab-empty p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  max-width: 360px;
}

/* ═══════════════════════════════════════════════════
   Admin — Permission Denied State
   ═══════════════════════════════════════════════════ */

.admin-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
}

.admin-denied svg {
  width: 40px;
  height: 40px;
  color: var(--status-inactive-color);
}

.admin-denied h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-denied p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  max-width: 360px;
}

/* ═══════════════════════════════════════════════════
   Admin — Data Tables (Users, Roles, Cred Types)
   ═══════════════════════════════════════════════════ */

.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-table-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-table-header .result-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 8px;
}

.admin-table-wrap {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead {
  background: var(--bg-inset);
}

.admin-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background 0.15s;
}

.admin-table tbody tr:hover {
  background: var(--card-hover-bg);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}
