/* ===== Sunbra Admin — Design Tokens ===== */
:root {
  /* Bootstrap overrides */
  --bs-primary: #000482;
  --bs-primary-rgb: 0, 4, 130;
  --bs-link-color: #000482;
  --bs-link-color-rgb: 0, 4, 130;
  --bs-link-hover-color: #00067a;
  --bs-body-font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --bs-body-color: #27254a;
  --bs-border-color: #e9e5dc;
  --bs-border-radius: 12px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 16px;
  --bs-border-radius-xl: 20px;
  --bs-border-radius-2xl: 24px;
  --bs-border-radius-pill: 999px;
  --bs-box-shadow-sm: 0 1px 0 rgba(0, 0, 0, .04), 0 2px 6px rgba(0, 0, 0, .05);
  --bs-box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 6px 18px -8px rgba(0, 0, 0, .09);

  /* Custom tokens */
  --primary: #000482;
  --primary-600: #00067a;
  --primary-700: #00065e;
  --surface-dark: #171a30;
  --surface-darker: #0c0d1f;
  --bg: #faf9f7;
  --bg-2: #f3f0e8;
  --surface: #ffffff;
  --ink: #27254a;
  --ink-2: #484665;
  --muted: #80807a;
  --faint: #b0aeb8;
  --on-dark: #f8f7f4;
  --on-dark-2: #a8a6be;
  --border: #e9e5dc;
  --border-strong: #d9d5c8;
  --border-dark: #252745;
  --r-pill: 999px;
  --sh-1: 0 1px 0 rgba(0, 0, 0, .04), 0 2px 6px rgba(0, 0, 0, .05);
  --sh-2: 0 1px 0 rgba(0, 0, 0, .05), 0 6px 18px -8px rgba(0, 0, 0, .09);
  --sh-3: 0 1px 0 rgba(0, 0, 0, .06), 0 12px 32px -10px rgba(0, 0, 0, .13);
}

/* ===== Base ===== */
*,
*::before,
*::after {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}

body,
.admin-body {
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-600);
}

/* ===== App shell ===== */
.admin-shell {
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.admin-sidebar {
  width: 248px;
  min-width: 248px;
  background: var(--surface-darker);
  border-right: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-offcanvas {
  background: var(--surface-darker);
  --bs-offcanvas-width: 260px;
}

/* Brand */
.admin-sidebar .admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 14px;
  border-bottom: 1px solid var(--border-dark);
  margin-bottom: 4px;
  text-decoration: none !important;
}

.admin-sidebar .admin-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.admin-sidebar .admin-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--on-dark);
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.admin-sidebar .admin-brand-sub {
  font-size: 10.5px;
  color: var(--on-dark-2);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  line-height: 1.4;
}

/* Nav */
.admin-sidebar .nav {
  flex: 1;
  gap: 4px !important;
}

.admin-sidebar .nav-link {
  color: var(--on-dark-2);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  line-height: 1.3;
}

.admin-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .05);
  color: white;
}

.admin-sidebar .nav-link.active {
  background: var(--primary);
  color: white !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 14px -8px var(--primary);
}

/* Pending-count pill on review-queue nav items (registration/deletion requests).
   Not scoped to .admin-sidebar so it also renders in the mobile offcanvas. */
.sidebar-badge {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #c4304b;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Footer user card */
.admin-sidebar .admin-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-dark);
}

.admin-sidebar .admin-footer .footer-label {
  font-size: 11px;
  color: var(--on-dark-2);
  margin-bottom: 2px;
}

.admin-sidebar .admin-footer .footer-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
}

/* ===== Main area ===== */
.admin-main {
  background: var(--bg);
  min-height: 100vh;
  /* Flex items default to min-width: auto, which stops them shrinking below
     their content's natural width — a wide table would otherwise stretch
     this column (and the whole page) instead of scrolling within
     .table-responsive. min-width: 0 lets it shrink so the overflow is
     contained where it belongs. */
  min-width: 0;
}

/* ===== Topbar ===== */
.admin-topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.admin-topbar h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.admin-topbar small {
  color: var(--muted);
}

/* ===== Content ===== */
.admin-content {
  max-width: 1320px;
  margin: 0 auto;
}

/* ===== Cards ===== */
.card {
  border-color: var(--border) !important;
  border-radius: 24px !important;
  background: var(--surface) !important;
  box-shadow: var(--sh-1) !important;
}

.card-panel,
.panel-small {
  border: 1px solid var(--border) !important;
  border-radius: 24px !important;
  background: var(--surface) !important;
  box-shadow: var(--sh-1) !important;
  height: 100%;
}

.card-panel .card-body,
.panel-small .card-body {
  padding: 1.5rem;
}

/* ===== Buttons ===== */
.btn {
  border-radius: var(--r-pill) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  transition: background .15s, transform .05s, border-color .15s !important;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
  box-shadow: 0 6px 16px -8px var(--primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-600) !important;
  border-color: var(--primary-600) !important;
}

.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--border-strong) !important;
  background: var(--surface) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: white !important;
}

.btn-outline-secondary {
  color: var(--ink-2) !important;
  border-color: var(--border-strong) !important;
  background: var(--surface) !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: var(--bg-2) !important;
  color: var(--ink) !important;
  border-color: var(--border-strong) !important;
}

.btn-outline-danger {
  color: #c4304b !important;
  border-color: #f8d7da !important;
  background: var(--surface) !important;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: #ffeef1 !important;
  border-color: #c4304b !important;
  color: #c4304b !important;
}

/* Input-group radius fix */
.input-group>.form-control:not(:last-child),
.input-group>.form-select:not(:last-child) {
  border-radius: 12px 0 0 12px !important;
}

.input-group>.btn:last-child,
.input-group>.input-group-text:last-child {
  border-radius: 0 12px 12px 0 !important;
}

/* ===== Tables ===== */
.table {
  border-color: var(--border);
}

.table>thead>tr>th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border) !important;
  background: var(--bg);
  white-space: nowrap;
}

.table>tbody>tr>td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.table>tbody>tr:last-child>td {
  border-bottom: 0;
}

.table>tbody>tr:hover>td {
  background: var(--bg-2);
}

.table-light {
  --bs-table-bg: var(--bg);
}

/* ===== Form controls ===== */
.form-control,
.form-select {
  background: #fff !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 10px !important;
  font-size: 14px;
  color: var(--ink);
}

/* Bootstrap draws the dropdown chevron with background-image, which the
   `background: #fff !important` shorthand above wipes out. Paint it back so a
   native select still reads as a dropdown — only matters for .no-select2
   selects, since select2 renders its own arrow. */
.form-select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2380807a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 15px 11px !important;
  padding-right: 2.25rem !important;
}

/* background-color, not the `background` shorthand — the shorthand would wipe
   the .form-select chevron painted above every time the control is focused. */
.form-control:focus,
.form-select:focus {
  background-color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 4, 130, .1) !important;
  color: var(--ink);
}

.form-control:disabled,
.form-select:disabled {
  background-color: var(--bg-2) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.form-check-input {
  border: 1.5px solid var(--muted) !important;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.form-check-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(0, 4, 130, .1) !important;
}

.form-check-label {
  cursor: pointer;
}

/* ===== Badges ===== */
.badge {
  border-radius: var(--r-pill) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
}

.badge.bg-primary {
  background: var(--primary) !important;
}

/* ===== Alerts ===== */
.alert {
  border-radius: 14px !important;
  border: 0;
  font-size: 13.5px;
}

/* ===== Pagination ===== */
.page-link {
  border-radius: var(--r-pill) !important;
  border-color: var(--border);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  margin: 0 2px;
}

.page-link:hover {
  color: var(--primary);
  background: var(--bg-2);
  border-color: var(--border);
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.page-item.disabled .page-link {
  color: var(--faint);
  background: var(--bg);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .admin-main {
    min-height: calc(100vh - 65px);
  }
}

.select2-container--bootstrap-5 .select2-selection {
  border-radius: 10px !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear {
  width: 10px !important;
  height: 10px !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  font-size: 14px !important;
}
/* ===== Notifications (topbar bell + list) ===== */
.notif-wrap {
  position: relative;
}

.notif-bell {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.notif-bell:hover,
.notif-bell.show {
  background: var(--bg-2);
  border-color: var(--primary);
  color: var(--primary);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c4304b;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--surface);
  box-sizing: content-box;
}

.notif-badge[hidden] {
  display: none;
}

.notif-menu {
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 0;
  border: 1px solid var(--border) !important;
  border-radius: 18px !important;
  background: var(--surface);
  box-shadow: var(--sh-3) !important;
  overflow: hidden;
  margin-top: 10px !important;
}

.notif-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.notif-menu-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.notif-menu-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.notif-link-btn {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.notif-link-btn:disabled {
  color: var(--faint);
  cursor: default;
}

.notif-menu-list {
  max-height: 400px;
  overflow-y: auto;
}

.notif-menu-foot {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.notif-menu-foot:hover {
  background: var(--bg-2);
  color: var(--primary-700);
}

/* rows — shared by dropdown and full page */
.notif-row-wrap {
  display: flex;
  align-items: flex-start;
  transition: background .12s;
}

.notif-row-wrap + .notif-row-wrap {
  border-top: 1px solid var(--border);
}

.notif-row-wrap:hover {
  background: var(--bg-2);
}

.notif-row-unread {
  background: #f7f8ff;
}

.notif-row-unread:hover {
  background: #eef0ff;
}

.notif-row-form {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.notif-row-del {
  margin: 0;
  padding: 13px 14px 0 0;
}

.notif-row-del button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.notif-row-del button:hover {
  background: #ffeef1;
  color: #c4304b;
}

.notif-row-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.notif-row-text {
  flex: 1;
  min-width: 0;
  display: block;
}

.notif-row-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.notif-row-body {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
  line-height: 1.45;
}

.notif-row-body-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-row-time {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

.notif-row-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
}

.notif-empty {
  padding: 34px 20px;
  text-align: center;
}

/* full page */
.notif-page-list .notif-row {
  padding: 15px 22px;
}

.notif-page-list .notif-row-del {
  padding: 16px 18px 0 0;
}

.notif-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.notif-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.notif-tab:hover {
  color: var(--primary);
}

.notif-tab-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--sh-1);
}

.notif-tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c4304b;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
