/* ===== UN-inspired design tokens ===== */
:root {
  --un-blue: #009edb;
  --un-blue-dark: #0072a8;
  --un-navy: #0a3d5c;
  --ink: #21282e;
  --muted: #63727e;
  --line: #e2ebf2;
  --bg-tint: #f5f9fc;
  /* Legacy aliases used by admin/stat styles */
  --brand: #009edb;
  --brand-dark: #0072a8;
  --brand-accent: #009edb;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
}

main[role="main"] {
  flex: 1 0 auto;
}

main .container {
  padding-top: 1.25rem;
}

a {
  color: var(--un-blue);
}

::selection {
  background: rgba(0, 158, 219, 0.22);
}

/* ===== Top utility bar ===== */
.top-bar {
  background: var(--bg-tint);
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ===== Navbar ===== */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-emblem {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}

.brand-text {
  line-height: 1.1;
}

.brand-name {
  display: block;
  font-weight: 700;
  color: var(--un-navy);
  letter-spacing: 0.02em;
}

.brand-name .accent {
  color: var(--un-blue);
}

.brand-sub {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--un-blue);
  margin-top: 2px;
}

.navbar .nav-link {
  color: var(--ink);
  font-weight: 500;
}

.navbar .nav-link:hover {
  color: var(--un-blue);
}

/* ===== Document hero ===== */
.hero-doc {
  position: relative;
  overflow: hidden;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--un-blue);
  border-radius: 0.5rem;
  padding: 2.25rem 2.25rem 2rem;
}

.hero-doc .hero-emblem {
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 240px;
  height: 240px;
  color: var(--un-blue);
  opacity: 0.06;
  pointer-events: none;
}

.doc-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--un-blue);
  margin-bottom: 0.8rem;
}

.hero-doc h1 {
  color: var(--un-navy);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 1.1rem;
}

.doc-rule {
  width: 64px;
  height: 3px;
  background: var(--un-blue);
  border-radius: 2px;
  margin: 0 0 1.1rem;
}

.hero-doc p {
  color: var(--muted);
  width: 100%;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.7;
}

/* ===== Cards ===== */
.card {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(10, 61, 92, 0.06);
}

/* ===== Registry card ===== */
.registry-card {
  background: #ffffff;
  border: 1px solid #edebe9;
  border-radius: 2px;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.08), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 1.5rem;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}

.registry-head {
  padding: 10px 16px;
  border-bottom: 1px solid #edebe9;
  background: #faf9f8;
}

.registry-title {
  font-size: 15px;
  font-weight: 600;
  color: #201f1e;
  letter-spacing: -0.01em;
}

.registry-sub {
  font-size: 12px;
  color: #605e5c;
}

.registry-body {
  padding: 0;
}

/* ===== Tables / DataTables ===== */
table.dataTable {
  border-collapse: collapse;
}

.table {
  --bs-table-striped-bg: #f4f6f8;
}

.table > :not(caption) > * > * {
  border-color: var(--line);
}

.table thead th,
.directory-table thead th,
table.dataTable thead th,
table.dataTable thead td {
  background-color: var(--un-blue) !important;
  color: #fff !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 0 !important;
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
  white-space: nowrap;
}

table.dataTable thead th div.dt-column-header,
table.dataTable thead th .dt-column-title {
  color: #fff !important;
}

table.dataTable thead th .dt-column-title {
  display: inline-block;
}

.directory-table tbody td {
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 0.7rem 0.75rem;
  vertical-align: middle;
}

/* ===== Country Flag in tables ===== */
.country-cell {
  white-space: nowrap;
}

.country-flag.fi {
  width: 1.35em;
  height: 1.02em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
  vertical-align: middle;
  flex: 0 0 auto;
}

.directory-table tbody tr:hover {
  background: #eef6fc;
}

/* Keep wide tables inside their card: the DataTables scroll body gets a
   max-height + horizontal scroll, and cells wrap/truncate instead of
   forcing the card wider than the viewport. */
.directory-table {
  width: 100% !important;
}

.dataTables_scrollBody {
  max-height: 70vh;
  overflow-x: auto !important;
  overflow-y: auto !important;
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

/* Sticky header stays aligned with the horizontally scrolling body */
.dataTables_scrollHeadInner table.dataTable {
  margin: 0 !important;
}

.directory-table tbody td {
  white-space: normal;
  word-break: break-word;
  max-width: 320px;
}

/* Numeric / coordinate / datetime cells: compact and right-aligned */
.cell-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--muted);
  display: inline-block;
  min-width: 4.5rem;
  text-align: right;
}

.cell-date {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.col-action {
  white-space: nowrap;
  text-align: center;
}

.col-select {
  width: 34px;
  text-align: center;
  white-space: nowrap;
}

.col-select input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

/* Keep sort arrows visible on the blue header */
.table thead th .dt-column-order:before,
.table thead th .dt-column-order:after {
  color: #fff;
  opacity: 0.5;
}

.table thead th.dt-ordering-asc .dt-column-order:before,
.table thead th.dt-ordering-desc .dt-column-order:after {
  color: #fff;
  opacity: 1;
}

.dataTables_wrapper {
  padding: 1rem 0.5rem 0.75rem;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0.25rem 0.35rem;
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-bottom-color: var(--un-blue);
}

.dataTables_wrapper .dataTables_info,
div.dt-container div.dt-info,
div.dt-info,
.dt-info,
.dataTables_info,
#directory-table_info {
  color: #605e5c !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  padding-top: 8px !important;
  padding-bottom: 4px !important;
  padding-left: 0.5rem !important;
  letter-spacing: 0.01em !important;
}

/* ===== DataTables Pagination ===== */
.dataTables_wrapper .dataTables_paginate,
.dt-container .dt-paging {
  padding-top: 8px;
  padding-right: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate ul.pagination,
.dt-container .dt-paging ul.pagination {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.dataTables_wrapper .dataTables_paginate .page-item,
.dt-container .dt-paging .page-item {
  margin: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link,
.dt-container .dt-paging .page-item .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  margin-left: 0 !important;
  border: 1px solid #edebe9 !important;
  background: #ffffff !important;
  color: #323130 !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 2px !important;
  min-width: 30px !important;
  height: 30px !important;
  line-height: 20px !important;
  padding: 4px 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 0.1s ease !important;
}

.dataTables_wrapper .dataTables_paginate .page-item:not(.active):not(.disabled) .page-link:hover,
.dt-container .dt-paging .page-item:not(.active):not(.disabled) .page-link:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):not(.disabled):hover {
  background: #f3f2f1 !important;
  border-color: #8a8886 !important;
  color: #201f1e !important;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.dt-container .dt-paging .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #0078d4 !important;
  border-color: #0078d4 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
  cursor: default !important;
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link,
.dt-container .dt-paging .page-item.disabled .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  background: #faf9f8 !important;
  border-color: #edebe9 !important;
  color: #a19f9d !important;
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.dataTables_wrapper .dataTables_paginate .page-link:focus,
.dt-container .dt-paging .page-link:focus {
  border-color: #0078d4 !important;
  box-shadow: 0 0 0 1px #0078d4 !important;
  outline: none !important;
}

/* ===== Buttons ===== */
.btn-primary {
  --bs-btn-bg: var(--un-blue);
  --bs-btn-border-color: var(--un-blue);
  --bs-btn-hover-bg: var(--un-blue-dark);
  --bs-btn-hover-border-color: var(--un-blue-dark);
  --bs-btn-focus-shadow-rgb: 0, 158, 219;
  --bs-btn-active-bg: var(--un-blue-dark);
  --bs-btn-active-border-color: var(--un-blue-dark);
  --bs-btn-disabled-bg: var(--un-blue);
  --bs-btn-disabled-border-color: var(--un-blue);
}

.btn-secondary {
  --bs-btn-bg: #fff;
  --bs-btn-color: var(--un-navy);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: #e7f4fb;
  --bs-btn-hover-color: var(--un-blue-dark);
  --bs-btn-hover-border-color: var(--un-blue);
  --bs-btn-active-bg: #e7f4fb;
  --bs-btn-active-color: var(--un-blue-dark);
  --bs-btn-active-border-color: var(--un-blue);
  --bs-btn-focus-shadow-rgb: 0, 158, 219;
}

.btn-outline-secondary {
  --bs-btn-color: var(--un-navy);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: #e7f4fb;
  --bs-btn-hover-color: var(--un-blue-dark);
  --bs-btn-hover-border-color: var(--un-blue);
  --bs-btn-focus-shadow-rgb: 0, 158, 219;
}

/* ===== Admin Console Design System ===== */
.sp-admin-body {
  background: #faf9f8;
  color: #323130;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* 1. Suite Bar (Top Bar) */
.m365-suite-bar {
  height: 48px;
  background: #0078d4;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.m365-suite-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.m365-waffle-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: #ffffff;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s ease;
}

.m365-waffle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.m365-app-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.m365-app-sub {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  padding-left: 10px;
  margin-left: 4px;
}

.m365-suite-center {
  flex: 0 1 480px;
  display: flex;
  justify-content: center;
  margin: 0 16px;
}

.m365-search-box {
  width: 100%;
  max-width: 440px;
  height: 32px;
  background: #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #605e5c;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.m365-search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: #323130;
  width: 100%;
  margin-left: 8px;
}

.m365-search-box input::placeholder {
  color: #a19f9d;
}

.m365-suite-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.m365-util-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.1s ease;
}

.m365-util-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.m365-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 2px;
  color: #ffffff;
  cursor: default;
}

.m365-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #004e8c;
  border: 1.5px solid #ffffff;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m365-user-name {
  font-size: 13px;
  font-weight: 600;
}

/* 2. SharePoint Site Header */
.sp-site-header {
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid #edebe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.sp-site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-site-logo {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: #eff6fc;
  border: 1px solid #deecf9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.sp-site-name {
  font-size: 15px;
  font-weight: 700;
  color: #201f1e;
  line-height: 1.2;
}

.sp-site-desc {
  font-size: 11px;
  color: #605e5c;
}

.sp-site-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-site-link {
  font-size: 13px;
  font-weight: 500;
  color: #605e5c;
  padding: 6px 12px;
  border-radius: 2px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.sp-site-link:hover {
  background: #f3f2f1;
  color: #201f1e;
}

/* 3. Main Workspace & Quick Launch */
.sp-workspace {
  display: flex;
  min-height: calc(100vh - 100px);
  background: #faf9f8;
}

.sp-quick-launch {
  width: 240px;
  flex: 0 0 auto;
  background: #ffffff;
  border-right: 1px solid #edebe9;
  padding: 12px 0 24px;
  display: flex;
  flex-direction: column;
}

.sp-nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8886;
  padding: 16px 20px 6px;
}

.sp-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sp-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: #323130;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.1s ease;
}

.sp-nav-link:hover {
  background: #f3f2f1;
  color: #201f1e;
}

.sp-nav-link svg {
  color: #605e5c;
  flex: 0 0 auto;
}

.sp-nav-link:hover svg {
  color: #201f1e;
}

.sp-nav-link.is-active {
  background: #eff6fc;
  color: #0078d4;
  font-weight: 600;
  border-left-color: #0078d4;
}

.sp-nav-link.is-active svg {
  color: #0078d4;
}

.sp-main-canvas {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px 24px 36px;
  background: #faf9f8;
}

/* 4. Page Header & Breadcrumb */
.sp-page-header {
  margin-bottom: 12px;
}

.sp-breadcrumb {
  font-size: 12px;
  color: #605e5c;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.sp-breadcrumb .is-current {
  color: #201f1e;
  font-weight: 600;
}

.sp-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-page-title {
  font-size: 20px;
  font-weight: 600;
  color: #201f1e;
  margin: 0;
  letter-spacing: -0.01em;
}

.sp-list-type-badge {
  font-size: 11px;
  font-weight: 600;
  color: #0078d4;
  background: #eff6fc;
  border: 1px solid #c7e0f4;
  border-radius: 2px;
  padding: 2px 8px;
}

/* 5. SharePoint Command Bar */
.sp-command-bar {
  background: #ffffff;
  border: 1px solid #edebe9;
  border-radius: 2px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sp-command-bar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sp-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #323130;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.1s ease;
}

.sp-cmd-btn:hover {
  background: #f3f2f1;
  color: #201f1e;
}

.sp-cmd-btn svg {
  color: #0078d4;
  flex: 0 0 auto;
}

.sp-cmd-btn--primary {
  background: #0078d4;
  color: #ffffff;
  border-color: #0078d4;
}

.sp-cmd-btn--primary:hover {
  background: #106ebe;
  border-color: #106ebe;
  color: #ffffff;
}

.sp-cmd-btn--primary svg {
  color: #ffffff;
}

.sp-cmd-btn--action.is-active {
  background: #eff6fc;
  color: #0078d4;
  border-color: #c7e0f4;
}

.sp-cmd-btn--subtle {
  color: #605e5c;
}

.sp-cmd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
}

.sp-cmd-btn:disabled svg {
  color: #a19f9d;
}

.sp-cmd-badge {
  background: #0078d4;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 2px;
}

.sp-cmd-divider {
  width: 1px;
  height: 20px;
  background: #edebe9;
  margin: 0 4px;
}

.sp-view-indicator {
  font-size: 12px;
  color: #605e5c;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
}

/* 6. Selection Banner */
.sp-selection-banner {
  background: #eff6fc;
  border: 1px solid #c7e0f4;
  border-left: 4px solid #0078d4;
  border-radius: 2px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #004e8c;
}

.sp-selection-banner svg {
  color: #0078d4;
}

/* 7. SharePoint List Surface */
.sp-list-surface {
  background: #ffffff;
  border: 1px solid #edebe9;
  border-radius: 2px;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.08), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}

.sp-page-header,
.sp-command-bar,
.sp-selection-banner {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}

.sp-list-body {
  padding: 0;
}

/* DataTables SharePoint List Overrides */
table.sp-list-table {
  border-collapse: collapse !important;
  width: 100%;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}

table.sp-list-table thead th,
table.dataTable.sp-list-table thead th {
  background: #faf9f8 !important;
  color: #605e5c !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  border: 0 !important;
  border-bottom: 1px solid #edebe9 !important;
  padding: 10px 12px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
}

table.sp-list-table thead th:hover,
table.dataTable.sp-list-table thead th:hover {
  background: #f3f2f1 !important;
}

table.sp-list-table thead th div.dt-column-header,
table.sp-list-table thead th .dt-column-title {
  color: #605e5c !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

table.sp-list-table thead th.dt-ordering-asc .dt-column-order:before,
table.sp-list-table thead th.dt-ordering-desc .dt-column-order:after {
  color: #0078d4 !important;
  opacity: 1 !important;
}

table.sp-list-table tbody td {
  border: 0 !important;
  border-bottom: 1px solid #edebe9 !important;
  padding: 8px 12px !important;
  vertical-align: middle !important;
  font-size: 13px !important;
  color: #323130 !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
}

table.sp-list-table tbody tr {
  transition: background 0.08s ease;
  background: #ffffff;
}

table.sp-list-table tbody tr:hover {
  background: #f3f2f1 !important;
}

table.sp-list-table tbody tr.is-selected {
  background: #eff6fc !important;
}

table.sp-list-table tbody tr.is-selected td:first-child {
  border-left: 3px solid #0078d4 !important;
}

/* ===== DataTables Controls Styling ===== */
.sp-list-surface .dataTables_wrapper,
.registry-card .dataTables_wrapper {
  padding: 12px 16px 14px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}

.sp-list-surface .dataTables_wrapper .dataTables_filter,
.registry-card .dataTables_wrapper .dataTables_filter {
  margin-bottom: 8px;
}

.sp-list-surface .dataTables_wrapper .dataTables_filter label,
.registry-card .dataTables_wrapper .dataTables_filter label {
  font-size: 12px;
  font-weight: 600;
  color: #605e5c;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.sp-list-surface .dataTables_wrapper .dataTables_filter input,
.registry-card .dataTables_wrapper .dataTables_filter input {
  border: 1px solid #8a8886;
  border-radius: 2px;
  background: #ffffff;
  color: #323130;
  font-size: 13px;
  padding: 5px 10px;
  min-width: 240px;
  box-shadow: none;
  outline: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.sp-list-surface .dataTables_wrapper .dataTables_filter input:hover,
.registry-card .dataTables_wrapper .dataTables_filter input:hover {
  border-color: #323130;
}

.sp-list-surface .dataTables_wrapper .dataTables_filter input:focus,
.registry-card .dataTables_wrapper .dataTables_filter input:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.sp-list-surface .dataTables_wrapper .dataTables_length label,
.registry-card .dataTables_wrapper .dataTables_length label {
  font-size: 12px;
  font-weight: 600;
  color: #605e5c;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}

.sp-list-surface .dataTables_wrapper .dataTables_length select,
.registry-card .dataTables_wrapper .dataTables_length select {
  border: 1px solid #8a8886;
  border-radius: 2px;
  background: #ffffff;
  color: #323130;
  font-size: 12px;
  padding: 3px 8px;
  box-shadow: none;
  outline: none;
}

.sp-list-surface .dataTables_wrapper .dataTables_length select:focus,
.registry-card .dataTables_wrapper .dataTables_length select:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.sp-list-surface .dataTables_wrapper .dataTables_info,
.registry-card .dataTables_wrapper .dataTables_info,
.sp-list-surface div.dt-info,
.registry-card div.dt-info,
.sp-list-surface .dt-info,
.registry-card .dt-info,
.sp-list-surface #directory-table_info,
.registry-card #directory-table_info {
  color: #605e5c !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  padding-top: 8px !important;
  padding-bottom: 4px !important;
  padding-left: 4px !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif !important;
  letter-spacing: 0.01em !important;
}

/* ===== Pagination for Surface & Registry ===== */
.sp-list-surface .dataTables_wrapper .dataTables_paginate,
.registry-card .dataTables_wrapper .dataTables_paginate,
.sp-list-surface .dt-paging,
.registry-card .dt-paging {
  padding-top: 10px;
  padding-right: 2px;
}

.sp-list-surface .pagination,
.registry-card .pagination,
.sp-list-surface .dt-paging ul.pagination,
.registry-card .dt-paging ul.pagination {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.sp-list-surface .pagination .page-item,
.registry-card .pagination .page-item {
  margin: 0 !important;
}

/* Individual page button tiles */
.sp-list-surface .pagination .page-item .page-link,
.registry-card .pagination .page-item .page-link,
.sp-list-surface .dataTables_wrapper .dataTables_paginate .paginate_button,
.registry-card .dataTables_wrapper .dataTables_paginate .paginate_button,
.sp-list-surface .dt-paging .page-link,
.registry-card .dt-paging .page-link {
  margin-left: 0 !important;
  border: 1px solid #edebe9 !important;
  border-radius: 2px !important;
  background: #ffffff !important;
  color: #323130 !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  min-width: 30px !important;
  height: 30px !important;
  line-height: 20px !important;
  padding: 4px 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 0.1s ease !important;
}

/* Fluent hover */
.sp-list-surface .pagination .page-item:not(.active):not(.disabled) .page-link:hover,
.registry-card .pagination .page-item:not(.active):not(.disabled) .page-link:hover,
.sp-list-surface .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.registry-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f3f2f1 !important;
  border-color: #8a8886 !important;
  color: #201f1e !important;
}

/* Active page */
.sp-list-surface .pagination .page-item.active .page-link,
.registry-card .pagination .page-item.active .page-link,
.sp-list-surface .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.registry-card .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #0078d4 !important;
  border-color: #0078d4 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
  cursor: default !important;
}

/* Disabled page buttons */
.sp-list-surface .pagination .page-item.disabled .page-link,
.registry-card .pagination .page-item.disabled .page-link,
.sp-list-surface .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.registry-card .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  background: #faf9f8 !important;
  border-color: #edebe9 !important;
  color: #a19f9d !important;
  opacity: 0.45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* Focus outline */
.sp-list-surface .pagination .page-link:focus,
.registry-card .pagination .page-link:focus {
  border-color: #0078d4 !important;
  box-shadow: 0 0 0 1px #0078d4 !important;
  outline: none !important;
}

.sp-list-surface .dataTables_processing,
.registry-card .dataTables_processing {
  background: #ffffff !important;
  border: 1px solid #edebe9 !important;
  border-radius: 2px !important;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.12) !important;
  color: #0078d4 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 10px 20px !important;
}

/* Fluent scrollbars for wide DataTables body */
.sp-list-surface .dataTables_scrollBody,
.registry-card .dataTables_scrollBody {
  scrollbar-width: thin;
  scrollbar-color: #c8c6c4 #f3f2f1;
  border-bottom: 1px solid #edebe9 !important;
}

.sp-list-surface .dataTables_scrollBody::-webkit-scrollbar,
.registry-card .dataTables_scrollBody::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sp-list-surface .dataTables_scrollBody::-webkit-scrollbar-track,
.registry-card .dataTables_scrollBody::-webkit-scrollbar-track {
  background: #f3f2f1;
}

.sp-list-surface .dataTables_scrollBody::-webkit-scrollbar-thumb,
.registry-card .dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: #c8c6c4;
  border-radius: 4px;
}

.sp-list-surface .dataTables_scrollBody::-webkit-scrollbar-thumb:hover,
.registry-card .dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
  background: #8a8886;
}

/* Row Action Button (Fluent Button) */
.sp-row-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #0078d4;
  background: #eff6fc;
  border: 1px solid #c7e0f4;
  border-radius: 2px;
  padding: 3px 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.1s ease;
  white-space: nowrap;
}

.sp-row-action:hover {
  background: #deecf9;
  border-color: #0078d4;
  color: #004e8c;
  text-decoration: none;
}

.sp-row-action:hover svg {
  color: #0078d4;
}

/* Entity link for Manager/Owner/Flag drill-down */
.sp-entity-link {
  color: #0078d4;
  text-decoration: none;
  transition: all 0.1s ease;
}

.sp-entity-link:hover {
  color: #004e8c;
  text-decoration: underline;
}

/* ===== Accordion menu in admin sidebar (Manager/Owner/Flag lists) ===== */
.sp-nav-accordion {
  position: relative;
}

.sp-nav-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: #323130;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.1s ease;
}

.sp-nav-accordion-toggle > span:first-of-type {
  flex: 1 1 auto;
}

.sp-accordion-chevron {
  margin-right: auto;
  transition: transform 0.18s ease;
  opacity: 0.55;
}

.sp-nav-accordion.is-open .sp-accordion-chevron {
  transform: rotate(90deg);
  opacity: 1;
}

.sp-nav-accordion-content {
  display: none;
  background: #faf9f8;
  border-right: 3px solid #c7e0f4;
  max-height: 320px;
  overflow-y: auto;
}

.sp-nav-accordion.is-open .sp-nav-accordion-content {
  display: block;
}

.sp-accordion-loading,
.sp-accordion-empty {
  padding: 10px 20px 10px 14px;
}

.sp-accordion-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sp-accordion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 14px 6px 22px;
  font-size: 12px;
  color: #323130;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.1s ease;
}

.sp-accordion-item:hover {
  background: #eff6fc;
  color: #004e8c;
  border-left-color: #0078d4;
  text-decoration: none;
}

.sp-accordion-item-name {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.sp-accordion-item-count {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  color: #0078d4;
  background: #eff6fc;
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}

.sp-accordion-item:hover .sp-accordion-item-count {
  background: #ffffff;
}

/* Status Badges */
.sp-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 2px;
  padding: 2px 8px;
  line-height: 1.4;
  white-space: nowrap;
}

.sp-badge--success {
  background: #dff6dd;
  color: #107c10;
}

.sp-badge--danger {
  background: #fde7e9;
  color: #a80000;
}

.sp-badge--neutral {
  background: #f3f2f1;
  color: #605e5c;
}

/* Fluent Checkbox */
input[type="checkbox"].row-select,
input[type="checkbox"]#select-all {
  width: 16px;
  height: 16px;
  accent-color: #0078d4;
  cursor: pointer;
  vertical-align: middle;
  border-radius: 2px;
}

/* Responsiveness */
@media (max-width: 991.98px) {
  .sp-workspace {
    flex-direction: column;
  }

  .sp-quick-launch {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #edebe9;
  }

  .m365-suite-center {
    display: none;
  }
}

/* 8. KPI Cards */
.sp-kpi-card {
  background: #ffffff;
  border: 1px solid #edebe9;
  border-radius: 2px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.05);
  height: 100%;
}

.sp-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sp-kpi-icon--blue {
  background: #eff6fc;
  color: #0078d4;
}

.sp-kpi-icon--green {
  background: #dff6dd;
  color: #107c10;
}

.sp-kpi-icon--purple {
  background: #f3e8ff;
  color: #5c2d91;
}

.sp-kpi-icon--teal {
  background: #e6f4f1;
  color: #008272;
}

.sp-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: #201f1e;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.sp-kpi-value--sm {
  font-size: 14px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sp-kpi-label {
  font-size: 12px;
  color: #605e5c;
  margin-top: 3px;
  font-weight: 500;
}

/* 9. SharePoint Quick Links Web Part */
.sp-section-heading {
  font-size: 15px;
  font-weight: 600;
  color: #201f1e;
  margin-bottom: 12px;
}

.sp-quick-link-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid #edebe9;
  border-radius: 2px;
  padding: 16px 18px;
  text-decoration: none;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.04);
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
  height: 100%;
}

.sp-quick-link-tile:hover {
  border-color: #0078d4;
  box-shadow: 0 3px 8px rgba(0, 120, 212, 0.12);
  text-decoration: none;
}

.sp-quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sp-quick-icon--blue {
  background: #eff6fc;
  color: #0078d4;
}

.sp-quick-icon--teal {
  background: #e6f4f1;
  color: #008272;
}

.sp-quick-icon--purple {
  background: #f3e8ff;
  color: #5c2d91;
}

.sp-quick-icon--gray {
  background: #f3f2f1;
  color: #323130;
}

.sp-quick-text {
  display: flex;
  flex-direction: column;
}

.sp-quick-title {
  font-size: 14px;
  font-weight: 600;
  color: #201f1e;
  line-height: 1.2;
}

.sp-quick-desc {
  font-size: 12px;
  color: #605e5c;
  margin-top: 3px;
}

/* 10. Fluent Surfaces & Cards */
.sp-surface {
  background: #ffffff;
  border: 1px solid #edebe9;
  border-radius: 2px;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.06), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.04);
}

.sp-surface-header {
  padding: 12px 18px;
  border-bottom: 1px solid #edebe9;
  background: #ffffff;
}

.sp-surface-title {
  font-size: 14px;
  font-weight: 600;
  color: #201f1e;
}

.sp-surface-body {
  padding: 18px 20px;
}

.sp-surface-footer {
  padding: 12px 20px;
  background: #faf9f8;
  border-top: 1px solid #edebe9;
}

/* 11. Fluent Buttons */
.sp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.1s ease;
  white-space: nowrap;
}

.sp-btn--primary {
  background: #0078d4;
  color: #ffffff;
  border-color: #0078d4;
}

.sp-btn--primary:hover {
  background: #106ebe;
  border-color: #106ebe;
  color: #ffffff;
}

.sp-btn--secondary {
  background: #ffffff;
  color: #323130;
  border-color: #8a8886;
}

.sp-btn--secondary:hover {
  background: #f3f2f1;
  color: #201f1e;
  border-color: #8a8886;
}

.sp-btn--subtle {
  background: transparent;
  color: #605e5c;
  border-color: transparent;
}

.sp-btn--subtle:hover {
  background: #f3f2f1;
  color: #201f1e;
}

.sp-row-action--danger {
  color: #a80000;
  background: #fdf3f4;
  border-color: #fde7e9;
}

.sp-row-action--danger:hover {
  background: #fde7e9;
  border-color: #a80000;
  color: #a80000;
}

/* 12. Fluent MessageBars */
.sp-message-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.4;
}

.sp-message-bar--success {
  background: #dff6dd;
  border-left: 4px solid #107c10;
  color: #107c10;
}

.sp-message-bar--error {
  background: #fde7e9;
  border-left: 4px solid #a80000;
  color: #a80000;
}

.sp-message-bar--warning {
  background: #fff4ce;
  border-left: 4px solid #797775;
  color: #323130;
}

.sp-message-bar--info {
  background: #eff6fc;
  border-left: 4px solid #0078d4;
  color: #004e8c;
}

/* 13. Fluent Tables & Settings Grid */
table.sp-table {
  width: 100%;
  border-collapse: collapse;
}

table.sp-table thead th {
  background: #faf9f8 !important;
  color: #605e5c !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border: 0 !important;
  border-bottom: 1px solid #edebe9 !important;
  padding: 10px 14px !important;
  vertical-align: middle !important;
}

table.sp-table tbody td {
  border: 0 !important;
  border-bottom: 1px solid #f3f2f1 !important;
  padding: 9px 14px !important;
  vertical-align: middle !important;
  font-size: 13px;
  color: #323130;
}

table.sp-table tbody tr:hover {
  background: #f3f2f1;
}

.sp-key-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: #f3f2f1;
  color: #323130;
  border: 1px solid #edebe9;
  border-radius: 2px;
  padding: 1px 6px;
}

/* 14. Labels, Hints & Metadata */
.sp-label {
  font-size: 13px;
  font-weight: 600;
  color: #323130;
  margin-bottom: 4px;
  display: block;
}

.sp-hint {
  font-size: 12px;
  color: #605e5c;
  margin-bottom: 6px;
}

.sp-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a8886;
  margin-bottom: 2px;
}

.sp-meta-val {
  font-size: 14px;
  color: #201f1e;
}

/* 15. Form controls in SharePoint Admin */
.sp-admin-body .form-control,
.sp-admin-body .form-select {
  border: 1px solid #8a8886;
  border-radius: 2px;
  font-size: 13px;
  color: #323130;
  padding: 6px 10px;
}

.sp-admin-body .form-control:focus,
.sp-admin-body .form-select:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
  outline: none;
}

/* 16. Placeholder Chips */
.sp-token-chip {
  display: inline-flex;
  align-items: center;
  background: #eff6fc;
  border: 1px solid #c7e0f4;
  color: #0078d4;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 10px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.sp-token-chip:hover {
  background: #deecf9;
  border-color: #0078d4;
  color: #004e8c;
}

/* 17. Info Box & Code Block */
.sp-info-box {
  background: #faf9f8;
  border: 1px solid #edebe9;
  border-radius: 2px;
  padding: 12px 14px;
  font-size: 13px;
}

.sp-code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #004e8c;
  word-break: break-all;
  white-space: normal;
}

/* 18. Pagination */
.sp-pagination {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.sp-pagination .page-item {
  margin: 0 !important;
}

.sp-pagination .page-item .page-link {
  margin-left: 0 !important;
  border: 1px solid #edebe9 !important;
  background: #ffffff !important;
  color: #323130 !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  min-width: 30px !important;
  height: 30px !important;
  line-height: 20px !important;
  padding: 4px 10px !important;
  border-radius: 2px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: all 0.1s ease !important;
}

.sp-pagination .page-item .page-link:hover {
  background: #f3f2f1 !important;
  color: #201f1e !important;
  border-color: #8a8886 !important;
}

.sp-pagination .page-item.active .page-link {
  background: #0078d4 !important;
  border-color: #0078d4 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12) !important;
}

.sp-pagination .page-item.disabled .page-link {
  background: #faf9f8 !important;
  border-color: #edebe9 !important;
  color: #a19f9d !important;
  opacity: 0.45 !important;
  pointer-events: none !important;
}

/* ===== Admin console (Legacy fallback classes) ===== */
.admin-body {
  background: #f2f5f8;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 270px;
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0e2a40 0%, #0a2334 100%);
  color: #cfdcea;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand svg,
.admin-brand img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.admin-brand img {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  padding: 2px;
  box-sizing: content-box;
}

.admin-brand-title {
  font-weight: 700;
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.2;
}

.admin-brand-sub {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6fa8cc;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.9rem 0.7rem;
  flex: 1 1 auto;
}

.admin-nav-group {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5e8bad;
  padding: 0.85rem 0.75rem 0.3rem;
}

.admin-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  border-left: 3px solid transparent;
  color: #b8cddd;
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
}

.admin-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #6f9cbc;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-link:hover svg {
  color: #fff;
}

.admin-link.active {
  background: rgba(0, 158, 219, 0.16);
  border-left-color: var(--un-blue);
  color: #fff;
}

.admin-link.active svg {
  color: var(--un-blue);
}

.admin-nav-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav-footer .admin-link--button {
  cursor: pointer;
  text-align: left;
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.6rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-topbar-title {
  font-weight: 700;
  color: var(--un-navy);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.25rem 0.8rem 0.25rem 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--un-navy);
}

.admin-user-chip .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--un-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-content {
  padding: 1.6rem;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 991.98px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
}

/* ===== Page header ===== */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}

.page-head h1 {
  font-weight: 700;
  color: var(--un-navy);
  margin: 0;
  font-size: 1.45rem;
}

.page-head .lead {
  color: var(--muted);
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}

/* ===== Quick action tiles ===== */
.quick-tile {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quick-tile:hover {
  border-color: var(--un-blue);
  box-shadow: 0 4px 14px rgba(10, 61, 92, 0.10);
  text-decoration: none;
}

.quick-tile svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--un-blue);
  flex: 0 0 auto;
}

.quick-tile-title {
  font-weight: 600;
  color: var(--un-navy);
}

.quick-tile-desc {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ===== Stat cards ===== */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.stat-icon svg {
  width: 26px;
  height: 26px;
}

.stat-icon--blue {
  background: #e8f1fa;
  color: var(--brand);
}

.stat-icon--green {
  background: #e7f7ee;
  color: #1a8a4f;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-value--sm {
  font-size: 1.05rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Email preview iframe ===== */
.email-preview-frame {
  width: 100%;
  min-height: 360px;
  border: 0;
  display: block;
  background: #fff;
}

.email-preview-frame--gallery {
  min-height: 320px;
}

.template-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
}

/* ===== Quill rich text editor ===== */
.description-editor {
  background: #fff;
}

.ql-toolbar.ql-snow {
  border: 1px solid #edebe9 !important;
  border-bottom: 0 !important;
  border-radius: 2px 2px 0 0 !important;
  background: #faf9f8 !important;
  font-family: inherit !important;
  padding: 8px 12px !important;
}

.ql-container.ql-snow {
  border: 1px solid #edebe9 !important;
  border-radius: 0 0 2px 2px !important;
  font-size: 14px !important;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif !important;
  background: #ffffff !important;
  min-height: 240px;
}

.ql-editor {
  min-height: 240px;
  font-size: 14px;
  line-height: 1.6;
  color: #323130;
}

.ql-snow .ql-stroke {
  stroke: var(--un-navy);
}

.ql-snow .ql-fill {
  fill: var(--un-navy);
}

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--un-blue);
}

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill {
  fill: var(--un-blue);
}

/* Rendered rich text (home page description) */
.hero-doc .rich-text p {
  margin-bottom: 0.75rem;
}

.hero-doc .rich-text p:last-child,
.hero-doc .rich-text ul:last-child,
.hero-doc .rich-text ol:last-child {
  margin-bottom: 0;
}

.hero-doc .rich-text h2,
.hero-doc .rich-text h3,
.hero-doc .rich-text h4 {
  color: var(--un-navy);
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}

.hero-doc .rich-text a {
  color: #cfe8f8;
  text-decoration: underline;
}

.hero-doc .rich-text ul,
.hero-doc .rich-text ol {
  display: inline-block;
  text-align: left;
  margin-bottom: 0.75rem;
  padding-left: 1.4rem;
}

.hero-doc .rich-text blockquote {
  border-left: 3px solid var(--un-blue);
  padding-left: 1rem;
  color: var(--muted);
}

/* ===== Forms ===== */
.form-control:focus,
.form-check-input:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(0, 158, 219, 0.18);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== Footer ===== */
.site-footer {
  flex-shrink: 0;
  background: var(--bg-tint);
  border-top: 2px solid var(--un-blue);
  color: var(--muted);
  padding: 1.25rem 0;
  margin-top: 3rem;
}

.site-footer .footer-emblem {
  width: 34px;
  height: 34px;
}

.site-footer a {
  color: var(--un-blue);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--un-blue-dark);
}
