/* ═══════════════════════════════════════════
   RAB PORTAL — ADMIN PANEL STYLESHEET
   ═══════════════════════════════════════════ */

.admin-body {
  display: flex; flex: 1;
  min-height: calc(100vh - 130px);
}

/* ─── SIDEBAR ───────────────────────────────────── */
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--green-dark);
  padding: 24px 0;
  display: flex; flex-direction: column;
}
.admin-nav-item {
  display: block; padding: 12px 24px;
  color: rgba(255,255,255,.75); text-decoration: none;
  font-size: .88rem; font-weight: 500;
  transition: background .2s, color .2s;
  cursor: pointer; border: none; background: none;
  text-align: left; width: 100%;
}
.admin-nav-item:hover { background: rgba(255,255,255,.1); color: white; }
.admin-nav-item.active { background: rgba(255,255,255,.18); color: white; font-weight: 700; border-left: 4px solid var(--gold); }
.sidebar-info {
  margin-top: auto; padding: 16px 20px;
  background: rgba(255,255,255,.08);
  margin: auto 12px 12px;
  border-radius: 10px;
}
.sidebar-info p { font-size: .72rem; color: rgba(255,255,255,.7); margin-bottom: 3px; }
.sidebar-info strong { color: var(--gold); }

/* ─── MAIN CONTENT ──────────────────────────────── */
.admin-main {
  flex: 1; padding: 30px 36px;
  overflow-y: auto; background: var(--bg);
}
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.admin-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 10px;
}
.admin-section-header h2 {
  font-size: 1.3rem; font-weight: 800; color: var(--green-dark);
}
.tab-desc {
  font-size: .83rem; color: #666; margin-top: 4px; width: 100%;
}
.btn-primary {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white; border: none; border-radius: 20px;
  padding: 9px 22px; font-family: 'Source Sans 3', 'Georgia', serif;
  font-size: .85rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(30,90,40,.3);
  transition: transform .2s;
}
.btn-primary:hover { transform: translateY(-1px); }

/* ─── USERS TABLE ───────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse;
  background: white; border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow);
}
.data-table th {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white; padding: 12px 16px; font-size: .8rem;
  font-weight: 600; text-align: left; letter-spacing: .5px;
}
.data-table td {
  padding: 12px 16px; font-size: .83rem; color: var(--text-dark);
  border-bottom: 1px solid #eee; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fcf8; }
.role-badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 2px 10px; border-radius: 20px; text-transform: uppercase;
  letter-spacing: .5px;
}
.role-admin  { background: #fff3e0; color: #e65100; }
.role-editor { background: #e3f2fd; color: var(--blue); }
.status-badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
}
.status-active   { background: #e8f5e9; color: var(--green-dark); }
.status-inactive { background: #fdecea; color: #c62828; }
.btn-table-edit {
  background: #e3f2fd; color: var(--blue);
  border: none; border-radius: 8px; padding: 5px 12px;
  font-size: .75rem; font-weight: 600; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif; margin-right: 4px;
  transition: background .2s;
}
.btn-table-edit:hover { background: #bbdefb; }
.btn-table-perm {
  background: #f3e5f5; color: var(--purple);
  border: none; border-radius: 8px; padding: 5px 12px;
  font-size: .75rem; font-weight: 600; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif; margin-right: 4px;
  transition: background .2s;
}
.btn-table-perm:hover { background: #e1bee7; }
.btn-table-del {
  background: #fdecea; color: #c62828;
  border: none; border-radius: 8px; padding: 5px 12px;
  font-size: .75rem; font-weight: 600; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif;
  transition: background .2s;
}
.btn-table-del:hover { background: #ffcdd2; }

/* ─── CREATE USER FORM ──────────────────────────── */
.create-user-form {
  background: white; border-radius: 16px;
  padding: 28px; box-shadow: var(--shadow);
  max-width: 700px;
}
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 0;
}
.success-msg {
  background: #e8f5e9; color: var(--green-dark);
  border-radius: 8px; padding: 10px 14px;
  font-size: .82rem; margin-bottom: 14px;
}

/* ─── PERMISSIONS ───────────────────────────────── */
.perm-filter {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.perm-filter label { font-size: .88rem; font-weight: 600; color: var(--text-dark); }
.perm-filter select {
  padding: 7px 12px; border: 1.5px solid #ddd; border-radius: 8px;
  font-family: 'Source Sans 3', 'Georgia', serif; font-size: .85rem; outline: none;
  min-width: 200px;
}
.perm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.perm-card {
  background: white; border-radius: 12px; padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-left: 4px solid transparent;
}
.perm-card.has-perm { border-left-color: var(--green-light); }
.perm-card-header {
  font-size: .82rem; font-weight: 700; color: var(--text-dark); margin-bottom: 8px;
}
.perm-card-user {
  font-size: .75rem; color: #888; margin-bottom: 6px;
}
.perm-cat-tag {
  display: inline-block; font-size: .7rem; font-weight: 600;
  padding: 2px 9px; border-radius: 20px;
  background: #e3f2fd; color: var(--blue); margin-bottom: 6px;
}
.perm-status {
  font-size: .75rem; color: #888;
}
.perm-status strong { color: var(--green-dark); }
.btn-revoke {
  background: #fdecea; color: #c62828;
  border: none; border-radius: 8px; padding: 4px 10px;
  font-size: .72rem; font-weight: 600; cursor: pointer;
  font-family: 'Source Sans 3', 'Georgia', serif; margin-top: 6px;
}

/* ─── PERM CHECKBOXES IN MODAL ──────────────────── */
.perm-cat-group { margin-bottom: 16px; }
.perm-cat-group-title {
  font-size: .82rem; font-weight: 700; color: var(--green-dark);
  padding: 6px 0; border-bottom: 1px solid #e8e8e8; margin-bottom: 8px;
}
.perm-checkbox-list { list-style: none; }
.perm-checkbox-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 7px; margin-bottom: 4px;
  font-size: .83rem; transition: background .2s;
}
.perm-checkbox-list li:hover { background: #f5f5f5; }
.perm-checkbox-list input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green-mid); }

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 768px) {
  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; padding: 8px; overflow-x: auto; }
  .admin-nav-item { white-space: nowrap; padding: 10px 16px; }
  .sidebar-info { display: none; }
  .admin-main { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}
