/* === Admin Tables === */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 16px;
}
.admin-table th {
  background: var(--purple);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--neutral-300);
  vertical-align: middle;
}
.admin-table tr:nth-child(even) { background: var(--neutral-100); }
.admin-table code {
  background: var(--neutral-300);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

/* Editable cells */
.editable, .sys-editable {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 4px;
}
.editable:hover, .sys-editable:hover {
  background: rgba(92, 57, 119, 0.08) !important;
  outline: 1px dashed var(--purple);
  outline-offset: -1px;
}
.inline-edit-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--purple);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  background: white;
}

/* Panel toolbar */
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.panel-toolbar h3 {
  font-size: 16px;
  color: var(--neutral-900);
}

/* Add dept form */
.add-dept-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--neutral-100);
  border-radius: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-input {
  padding: 8px 10px;
  border: 1px solid var(--neutral-400);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  flex: 1;
  min-width: 120px;
}
.inline-input:focus-visible {
  border-color: var(--purple);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

/* Delete button */
.btn-delete-sm {
  padding: 4px 12px;
  background: white;
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.btn-delete-sm:hover { background: var(--orange-wash); }
.text-muted { color: var(--neutral-900); font-size: 12px; }

/* Section desc in admin */
.tab-panel h3 {
  font-size: 16px;
  color: var(--neutral-900);
  margin-bottom: 4px;
}

/* === Admin Badge ===
   Using orange-dark for WCAG AA contrast (white text on dark orange = 5:1). */
.admin-badge {
  background: var(--orange-dark);
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
}
.header-back {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  text-decoration: none;
}
.header-back:hover { color: white; text-decoration: underline; }

/* === Admin Dashboard === */
.admin-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}
.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header-row h1 {
  font-size: 28px;
  color: var(--purple);
  margin-bottom: 0;
}
.export-buttons {
  display: flex;
  gap: 8px;
}
.btn-export {
  display: inline-block;
  padding: 8px 16px;
  background: white;
  color: var(--purple);
  border: 1px solid var(--purple);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-export:hover {
  background: var(--purple);
  color: white;
  text-decoration: none;
}
.btn-export-primary {
  background: var(--purple);
  color: white;
}
.btn-export-primary:hover {
  background: var(--purple-dark);
}
.btn-export-restore {
  cursor: pointer;
  border-style: dashed;
}
.btn-export-restore:hover {
  border-style: solid;
}

/* === Tabs === */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--neutral-300);
}
.admin-tab {
  padding: 12px 20px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-800);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--purple); }
.admin-tab.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}
.tab-count {
  background: var(--neutral-300);
  color: var(--neutral-900);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.admin-tab.active .tab-count {
  background: var(--purple);
  color: white;
}

/* === Tab Panels === */
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--neutral-800);
  font-size: 15px;
}

/* === Admin Cards === */
.admin-card {
  border: 1px solid var(--neutral-400);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
  background: white;
  transition: box-shadow 0.2s;
}
.admin-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.admin-card-header strong {
  font-size: 15px;
  color: var(--purple);
  word-break: break-all;
}
.admin-card-date {
  font-size: 12px;
  color: var(--neutral-800);
  flex-shrink: 0;
  margin-left: 12px;
}
.admin-card-meta {
  font-size: 13px;
  color: var(--neutral-800);
  margin-bottom: 6px;
}
.admin-card-justification {
  font-style: italic;
  border-left: 3px solid var(--purple-wash);
  padding-left: 10px;
  margin: 4px 0 8px;
}
.admin-card-notes {
  font-size: 13px;
  color: var(--neutral-800);
  background: var(--neutral-100);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 8px 0;
}
.admin-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.btn-approve {
  padding: 8px 20px;
  background: #1e7e34;
  color: white;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-approve:hover { background: #176429; }
.btn-approve.confirming { background: var(--purple); }
.btn-approve.confirming:hover { background: var(--purple-dark); }
.btn-reject {
  padding: 8px 20px;
  background: white;
  color: var(--orange);
  border: 1px solid var(--orange);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-reject:hover { background: var(--orange-wash); }

/* === Change Action Badges === */
.change-action {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.change-add { background: #e6f4ea; color: #1e7e34; }
.change-remove { background: #fce8e6; color: #d93025; }

/* === Approve Form === */
.admin-card-approve-form {
  border-top: 1px solid var(--neutral-300);
  padding-top: 16px;
  margin-top: 12px;
}
.approve-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.af-full { grid-column: 1 / -1; }
.af-group {
  /* Prevent grid cells from overflowing their column */
  min-width: 0;
}
.af-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--neutral-800);
  margin-bottom: 6px;
}
.af-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--neutral-400);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--neutral-900);
  line-height: 1.4;
}
.af-input:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-color: var(--purple);
}
select.af-input {
  background: white;
  appearance: auto;
  cursor: pointer;
}

/* Collapse to single column on tablets and below */
@media (max-width: 720px) {
  .approve-form-grid { grid-template-columns: 1fr; gap: 16px; }
  .admin-card-actions { flex-direction: column; }
}
