/* ===== Admin dashboard ===== */

/*
 * Map Bootstrap "primary" to the site theme so buttons, tabs, focus rings
 * and form controls follow Settings → ThemeColor (data-theme on <html>).
 */
.adm-body {
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: var(--brand-primary-rgb);
  --bs-link-color: var(--brand-primary);
  --bs-link-hover-color: var(--brand-primary-dark);
  --bs-focus-ring-color: rgba(var(--brand-primary-rgb), 0.25);
}

.adm-body .btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-primary-dark);
  --bs-btn-hover-border-color: var(--brand-primary-dark);
  --bs-btn-focus-shadow-rgb: var(--brand-primary-rgb);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand-primary-dark);
  --bs-btn-active-border-color: var(--brand-primary-dark);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--brand-primary);
  --bs-btn-disabled-border-color: var(--brand-primary);
}

.adm-body .btn-outline-primary {
  --bs-btn-color: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-primary);
  --bs-btn-hover-border-color: var(--brand-primary);
  --bs-btn-focus-shadow-rgb: var(--brand-primary-rgb);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand-primary-dark);
  --bs-btn-active-border-color: var(--brand-primary-dark);
  --bs-btn-disabled-color: var(--brand-primary);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--brand-primary);
}

/* Features shortcut: brighter accent hover */
.adm-body .adm-btn-features {
  --bs-btn-color: var(--brand-accent);
  --bs-btn-border-color: var(--brand-accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-accent);
  --bs-btn-hover-border-color: var(--brand-accent);
  --bs-btn-active-bg: var(--brand-primary);
  --bs-btn-active-border-color: var(--brand-primary);
  --bs-btn-focus-shadow-rgb: var(--brand-accent-rgb);
}

.adm-body .form-control:focus,
.adm-body .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-primary-rgb), 0.2);
}

.adm-body .form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.adm-body .form-check-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-primary-rgb), 0.2);
}

.adm-body .form-switch .form-check-input:focus {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280,0,0,0.25%29'/%3e%3c/svg%3e");
}

.adm-body a:not(.btn):not(.adm-nav a):not(.adm-view-site):not(.adm-auth-back):not(.adm-brand) {
  color: var(--brand-primary);
}

.adm-body a:not(.btn):not(.adm-nav a):not(.adm-view-site):not(.adm-auth-back):not(.adm-brand):hover {
  color: var(--brand-primary-dark);
}

.adm-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #F3F6FA;
}

.adm-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1rem;
  background: #0F2A45;
  color: #fff;
  overflow-y: auto;
  z-index: 40;
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0 0.4rem;
}

.adm-brand img {
  height: 34px;
}

.adm-nav {
  display: grid;
  gap: 0.25rem;
}

.adm-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 500;
}

.adm-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.adm-nav a.active {
  background: var(--brand-primary);
  color: #fff;
}

.adm-nav i {
  font-size: 1.1rem;
}

.adm-sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 0.6rem;
}

.adm-view-site {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
}

.adm-view-site:hover {
  color: #fff;
}

.adm-overlay {
  display: none;
}

.adm-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.adm-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #E3E9F1;
}

.adm-menu-btn {
  display: none;
  margin-inline-end: auto;
}

.adm-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-inline-end: auto;
}

.adm-user b {
  display: block;
  color: #0F2A45;
  line-height: 1.2;
}

.adm-user small {
  color: var(--brand-muted);
}

.adm-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Notifications dropdown heading: themed so it stands out from the items below it. */
.adm-body .adm-notif-title {
  color: var(--brand-primary);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.6rem 1rem 0.55rem;
  margin-bottom: 0.35rem;
  border-bottom: 2px solid rgba(var(--brand-primary-rgb), 0.25);
}

.adm-content {
  padding: 1.5rem;
  min-width: 0;
}

.adm-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.adm-page-head h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0F2A45;
  margin: 0;
}

.adm-page-head p {
  margin: 0.2rem 0 0;
  color: var(--brand-muted);
}

.adm-back {
  display: inline-flex;
  align-items: center;
  color: var(--brand-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

[dir=ltr] .adm-flip {
  display: inline-block;
  transform: scaleX(-1);
}

.adm-card {
  background: #fff;
  border: 1px solid #E3E9F1;
  border-radius: 14px;
  padding: 1.25rem;
  min-width: 0;
}

.adm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.adm-search {
  max-width: 320px;
}

.adm-filter {
  max-width: 220px;
}

.adm-table {
  margin-bottom: 0.5rem;
}

.adm-table th {
  color: var(--brand-muted);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.adm-table-click tbody tr {
  cursor: pointer;
}

.adm-table-click tbody tr:hover > td {
  background: #F6F9FC;
}

.adm-unread td, li.adm-unread {
  font-weight: 600;
}

/* Applicant name + e-mail side by side on one line (not stacked). */
.adm-applicant {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.75rem;
  flex-wrap: wrap;
}

.adm-col-narrow {
  width: 80px;
}

.adm-row-icon {
  color: var(--brand-primary);
  margin-inline-end: 0.35rem;
}

.adm-empty {
  text-align: center;
  color: var(--brand-muted);
  padding: 2rem 1rem !important;
}

.adm-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.adm-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}

.adm-thumb-empty {
  display: grid;
  place-items: center;
  background: #EEF3F9;
  color: #94A3B8;
}

.adm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.adm-stat {
  display: grid;
  gap: 0.15rem;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid #E3E9F1;
  border-radius: 14px;
  text-decoration: none;
  color: #0F2A45;
  transition: border-color var(--transition), transform var(--transition);
}

.adm-stat:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.adm-stat i {
  font-size: 1.3rem;
  color: var(--brand-primary);
}

.adm-stat b {
  font-size: 1.8rem;
  line-height: 1.2;
}

.adm-stat span {
  color: var(--brand-muted);
  font-size: 0.9rem;
}

.adm-stat-hot {
  border-color: #F5B342;
  background: #FFFAEB;
}

.adm-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.adm-section-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0F2A45;
  margin: 0;
}

.adm-latest {
  list-style: none;
  margin: 0;
  padding: 0;
}

.adm-latest li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid #EEF2F7;
}

.adm-latest li:first-child {
  border-top: 0;
}

.adm-latest p {
  margin: 0.2rem 0 0;
  color: var(--brand-muted);
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.adm-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.adm-editor-side {
  display: grid;
  gap: 1rem;
}

.adm-image-preview {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #E3E9F1;
}

.adm-repeat {
  display: grid;
  gap: 0.75rem;
}

.adm-repeat-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #E3E9F1;
  border-radius: 12px;
  background: #FAFCFE;
}

.adm-repeat-tools {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
}

.adm-repeat-num {
  font-weight: 700;
  color: var(--brand-muted);
  font-size: 0.85rem;
}

.adm-details {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.adm-details dt {
  color: var(--brand-muted);
  font-weight: 500;
}

.adm-details dd {
  margin: 0;
}

.adm-subhead {
  font-size: 1rem;
  font-weight: 700;
}

.adm-message-body {
  white-space: pre-wrap;
  background: #F6F9FC;
  border-radius: 10px;
  padding: 1rem;
  margin: 0;
}

.adm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 69, 0.45);
  z-index: 1050;
}

.adm-modal {
  position: fixed;
  z-index: 1055;
  inset-inline: 0;
  top: 5vh;
  margin: 0 auto;
  width: min(560px, 100vw - 2rem);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 42, 69, 0.25);
}

.adm-modal-lg {
  width: min(900px, 100vw - 2rem);
}

.adm-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #EEF2F7;
}

.adm-modal-head h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.adm-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

.adm-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid #EEF2F7;
}

.adm-modal-foot:empty {
  display: none;
}

.adm-modal-foot > div {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.adm-toasts {
  position: fixed;
  z-index: 1100;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.adm-toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 42, 69, 0.2);
  cursor: pointer;
}

.adm-toast-success {
  background: #067647;
}

.adm-toast-danger {
  background: #B42318;
}

/* ===== Auth / Login (uses site theme CSS variables) ===== */
.adm-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 1fr);
  background: var(--brand-soft, #F5F9FC);
}

.adm-auth-solo {
  grid-template-columns: 1fr;
}

.adm-auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem);
  color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(var(--brand-accent-rgb, 59, 163, 224), 0.45), transparent 55%),
    linear-gradient(145deg, var(--brand-deep, #0E2A48) 0%, var(--brand-primary-dark, #1F5A8F) 48%, var(--brand-primary, #2E74B5) 100%);
}

.adm-auth-brand-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.adm-auth-glow {
  position: absolute;
  width: 55%;
  height: 55%;
  inset-inline-end: -10%;
  inset-block-end: -15%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-glow, #7DD3F5) 55%, transparent), transparent 70%);
  filter: blur(8px);
}

.adm-auth-grid {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
}

.adm-auth-brand-body {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.adm-auth-logo {
  display: inline-block;
  margin-bottom: 2rem;
}

.adm-auth-logo img {
  height: 44px;
  width: auto;
}

.adm-auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.adm-auth-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.35;
}

.adm-auth-text {
  margin: 0 0 1.75rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.adm-auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.adm-auth-points li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
}

.adm-auth-points i {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.adm-auth-main {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background:
    radial-gradient(80% 60% at 0% 0%, rgba(var(--brand-primary-rgb, 46, 116, 181), 0.08), transparent 55%),
    var(--brand-soft, #F5F9FC);
}

.adm-auth-card {
  width: min(440px, 100%);
  background: var(--brand-white, #fff);
  border: 1px solid var(--brand-border, #E2EBF3);
  border-radius: 20px;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 24px 60px rgba(var(--brand-deep-rgb, 14, 42, 72), 0.08);
}

.adm-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  color: var(--brand-muted, #6B7280);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.adm-auth-back:hover {
  color: var(--brand-primary, #2E74B5);
}

.adm-auth-card-head {
  margin-bottom: 1.5rem;
}

.adm-auth-card-head h1 {
  margin: 0.85rem 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--brand-deep, #0E2A48);
}

.adm-auth-card-head p {
  margin: 0;
  color: var(--brand-muted, #6B7280);
  line-height: 1.6;
}

.adm-auth-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-primary, #2E74B5) 14%, #fff);
  color: var(--brand-primary, #2E74B5);
  font-size: 1.35rem;
}

.adm-auth-icon-danger {
  background: color-mix(in srgb, #B42318 12%, #fff);
  color: #B42318;
}

.adm-auth-form .form-control:focus,
.adm-auth-form .form-select:focus {
  border-color: var(--brand-primary, #2E74B5);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-primary-rgb, 46, 116, 181), 0.18);
}

.adm-auth-form .form-check-input:checked {
  background-color: var(--brand-primary, #2E74B5);
  border-color: var(--brand-primary, #2E74B5);
}

@media (max-width: 899.98px) {
  .adm-auth {
    grid-template-columns: 1fr;
  }

  .adm-auth-brand {
    min-height: auto;
    padding: 1.75rem 1.5rem 2rem;
  }

  .adm-auth-logo {
    margin-bottom: 1.25rem;
  }

  .adm-auth-points {
    display: none;
  }

  .adm-auth-text {
    margin-bottom: 0;
  }
}

/* legacy class kept for any leftover markup */
.adm-login-brand img {
  height: 44px;
}

@media (max-width: 991.98px) {
  .adm-shell {
    grid-template-columns: 1fr;
  }
  .adm-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 260px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  [dir=ltr] .adm-sidebar {
    transform: translateX(-100%);
  }
  .adm-sidebar-open .adm-sidebar {
    transform: none;
  }
  .adm-sidebar-open .adm-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 42, 69, 0.4);
    z-index: 35;
  }
  .adm-menu-btn {
    display: inline-flex;
  }
  .adm-user {
    margin-inline-end: 0;
  }
  .adm-editor {
    grid-template-columns: 1fr;
  }
  .adm-details {
    grid-template-columns: 1fr;
  }
}

/* ---------- MVC dashboard extras ---------- */
.adm-body .input-validation-error {
  border-color: #dc3545;
}
.adm-body .input-validation-error:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
}
.adm-body .sx-error:empty,
.adm-body .field-validation-valid,
.adm-summary.validation-summary-valid {
  display: none;
}
.adm-summary ul {
  margin: 0;
  padding-inline-start: 1.1rem;
}
.adm-toolbar .btn-outline-primary {
  white-space: nowrap;
}
.adm-table-click tbody tr[data-href] {
  cursor: pointer;
}

/* ---------- MVC dashboard extras ---------- */
.adm-nav-title {
  display: block;
  margin: 0.9rem 0.75rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
}
.adm-body .input-validation-error {
  border-color: #dc3545;
}
.adm-body .input-validation-error:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
}
.adm-body .field-validation-valid,
.adm-summary.validation-summary-valid {
  display: none;
}
.adm-summary ul {
  margin: 0;
  padding-inline-start: 1.1rem;
}
.adm-toolbar .btn-outline-primary {
  white-space: nowrap;
}
.adm-table-click tbody tr[data-href] {
  cursor: pointer;
}
.adm-clip {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-login-brand img {
  height: 44px;
}

/* Theme picker inside Settings */
.adm-theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.adm-theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--brand-border, #d7e3ef);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  min-width: 72px;
}
.adm-theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.adm-theme-option .theme-color-btn {
  pointer-events: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
  background: var(--swatch);
}
.adm-theme-option.is-active,
.adm-theme-option:has(input:checked) {
  border-color: var(--brand-primary, #2E74B5);
  box-shadow: 0 0 0 3px rgba(46, 116, 181, 0.15);
}
.adm-theme-option.is-active .theme-color-btn,
.adm-theme-option:has(input:checked) .theme-color-btn {
  border-color: #0F2A45;
}
.adm-perms {
  display: grid;
  gap: 0.35rem;
}
.adm-perms-group {
  margin-top: 0.75rem;
}
.adm-perms-group > strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
