:root {
  --primary-color: #2b2f63;
  --secondary-color: #5057a8;
  --accent-color: #f6c6d4;
  --accent-strong: #e8578b;
  --accent-hover: #fde4ec;
  --text-color: #24263a;
  --surface-color: #ffffff;
  --muted-color: #697187;
  --border-color: #dde3f0;
  --radius-sm: 0.6rem;
  --radius-md: 0.8rem;
  --radius-lg: 1.05rem;
  --sidebar-width-expanded: 272px;
  --sidebar-width-collapsed: 86px;
}

html {
  font-size: 15px;
}

body {
  font-size: 0.96rem;
  line-height: 1.45;
  background: radial-gradient(circle at top right, #fff4f8 0%, #f7f9ff 52%, #f9fbff 100%);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.45s ease-in;
}

body.dashboard-mobile-open {
  overflow: hidden;
}

h1,
.h1 {
  font-size: clamp(1.65rem, 2.3vw, 2.15rem);
  letter-spacing: -0.02em;
}

h2,
.h2 {
  font-size: clamp(1.35rem, 1.95vw, 1.65rem);
  letter-spacing: -0.015em;
}

h3,
.h3 {
  font-size: clamp(1.17rem, 1.55vw, 1.34rem);
}

h4,
.h4 {
  font-size: 1.12rem;
}

.skip-link {
  position: fixed;
  left: 0.85rem;
  top: 0.85rem;
  z-index: 1200;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(43, 47, 99, 0.22);
}

.skip-link:focus,
.skip-link:focus-visible {
  color: #fff;
  background: var(--accent-strong);
  border-color: rgba(255, 255, 255, 0.55);
  outline: 2px solid #fff;
  outline-offset: 1px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

main.container {
  flex: 1;
}

.portal-navbar {
  background-color: var(--primary-color);
  box-shadow: 0 1px 0 rgba(44, 48, 111, 0.2);
}

.portal-navbar__container {
  min-height: 66px;
  padding: 0.45rem 1.3rem;
  gap: 1rem;
}

.portal-navbar--public {
  background: linear-gradient(180deg, #ffffff 0%, #fdf5f8 100%);
  border-bottom: 1px solid #f4dbe1;
  box-shadow: none;
}

.portal-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(232, 87, 139, 0.22));
}

.portal-navbar .navbar-brand {
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.navbar-brand span {
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.portal-navbar--public .navbar-brand span {
  color: var(--primary-color);
}

.portal-nav-actions {
  gap: 0.5rem;
}

.portal-nav-actions .btn,
.portal-nav-actions .form-select,
.portal-nav-actions .form-control {
  margin: 0;
}

.portal-nav-button {
  background: #ffffff;
  border: 1px solid #f3aac4;
  color: var(--primary-color);
  box-shadow: 0 3px 8px rgba(232, 87, 139, 0.1);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-nav-button:hover,
.portal-nav-button:focus-visible {
  background: #ffe5ee;
  border-color: var(--accent-strong);
  color: #8d2a4d;
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(232, 87, 139, 0.24);
}

.portal-nav-button.is-active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.portal-nav-button.is-active:hover,
.portal-nav-button.is-active:focus-visible {
  background: #ce3f73;
  border-color: #ce3f73;
  color: #fff;
}

.portal-footer {
  border-top: 1px solid rgba(243, 202, 216, 0.12);
  color: rgba(106, 62, 83, 0.42);
  background: transparent;
  text-align: center;
  padding: 0.2rem 0.75rem;
  margin-top: auto;
  line-height: 1.1;
  opacity: 0.55;
}

.portal-footer a {
  color: inherit;
  text-decoration: none;
}

.portal-footer a:hover,
.portal-footer a:focus-visible {
  color: rgba(106, 62, 83, 0.62);
  text-decoration: underline;
}

.text-accent {
  color: inherit;
}

.btn {
  min-height: 38px;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  position: relative;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loading {
  color: transparent !important;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn:focus,
.form-control:focus,
.form-select:focus,
a:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
  box-shadow: none;
}

.btn-portal-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.btn-portal-secondary {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: #fff;
}

.btn-portal-secondary--public {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-portal-accent {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--primary-color);
}

.card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.login-page-row {
  min-height: calc(100vh - 190px);
}

.login-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem !important;
}

.login-title {
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  font-weight: 700;
  color: #0f172a;
}

.login-subtitle {
  font-size: 0.98rem;
  line-height: 1.45;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  min-height: 40px;
  border-radius: 0.68rem;
  padding: 0.5rem 0.76rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(251, 180, 194, 0.25);
}

.was-validated .form-control:valid,
.was-validated .form-select:valid {
  border-color: #198754;
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: #dc3545;
}

.invalid-feedback {
  display: block;
  color: #dc3545;
  font-size: 0.875rem;
}

.form-text {
  color: var(--muted-color);
}

.card-kpi .kpi-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-color);
}

.map-placeholder {
  min-height: 360px;
  border: 3px dashed var(--secondary-color);
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: #fff;
}

.simplified-view .secondary-content {
  display: none !important;
}

@media (max-width: 768px) {
  .portal-navbar__container {
    min-height: 60px;
    padding: 0.5rem 0.95rem;
  }

  .btn {
    width: 100%;
  }

  .portal-nav-actions {
    padding-top: 0.65rem;
  }

  .portal-nav-button {
    font-size: 0.86rem;
    padding: 0.36rem 0.54rem;
  }

  .login-page-row {
    min-height: auto;
  }

  .login-card {
    padding: 1.4rem !important;
  }

  .card {
    margin-bottom: 1rem;
  }
}

.dashboard-content {
  font-size: 0.95rem;
}

.dashboard-content h1,
.dashboard-content .h1 {
  font-size: clamp(1.6rem, 2.35vw, 2.05rem);
}

.dashboard-content h2,
.dashboard-content .h2 {
  font-size: clamp(1.3rem, 1.85vw, 1.6rem);
}

.dashboard-content h3,
.dashboard-content .h3 {
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
}

.dashboard-content .table {
  font-size: 0.92rem;
}

.dashboard-content .breadcrumb {
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}

.dashboard-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.dashboard-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
}

.dashboard-card:hover,
.dashboard-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(44, 48, 111, 0.2);
}

.dashboard-card__header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.dashboard-card__icon {
  font-size: 1.3rem;
  color: var(--primary-color);
  width: 42px;
  height: 42px;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: rgba(239, 91, 141, 0.1);
}

.dashboard-card__title {
  font-weight: 700;
  margin: 0;
}

.dashboard-card__body {
  flex: 1;
  color: var(--muted-color);
  margin-bottom: 1rem;
}

.dashboard-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.summary-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.message-thread {
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.message-bubble {
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
  max-width: 88%;
}

.message-bubble.is-incoming {
  background: #ffffff;
  margin-right: auto;
}

.message-bubble.is-outgoing {
  background: #eef3ff;
  border-color: rgba(44, 48, 111, 0.25);
  margin-left: auto;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  color: var(--muted-color);
}

.message-toast-container {
  z-index: 1080;
}

.message-toast {
  cursor: pointer;
  border: 1px solid rgba(44, 48, 111, 0.18);
}

.message-toast .toast-header {
  background: #eef3ff;
}

/* Dashboard layout */
.dashboard-layout {
  --sidebar-width: var(--sidebar-width-expanded);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.dashboard-layout--no-chrome {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-layout--no-chrome .dashboard-main {
  min-height: 100vh;
}

.dashboard-layout--no-chrome .dashboard-content {
  max-width: min(1440px, calc(100vw - 1.5rem));
  margin: 0 auto;
  padding-top: 1rem;
}

.dashboard-layout.is-collapsed {
  --sidebar-width: var(--sidebar-width-collapsed);
}

.dashboard-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #232858 0%, #1c1f3e 100%);
  color: #fff;
  padding: 1.25rem 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: width 0.22s ease, padding 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  z-index: 40;
}

.dashboard-layout.is-collapsed .dashboard-sidebar,
.dashboard-sidebar.is-collapsed {
  width: var(--sidebar-width-collapsed);
  padding: 1.15rem 0.6rem;
}

.dashboard-layout.is-collapsed .dashboard-sidebar__title,
.dashboard-layout.is-collapsed .dashboard-sidebar__subtitle,
.dashboard-layout.is-collapsed .dashboard-sidebar__section-label,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__title,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__subtitle,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__section-label {
  display: none;
}

.dashboard-layout.is-collapsed .dashboard-sidebar__brand,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__brand {
  justify-content: center;
  padding: 0.32rem;
}

.dashboard-layout.is-collapsed .dashboard-sidebar__logo,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__logo {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  padding: 0.05rem;
  background: #fff;
  object-fit: contain;
}

.dashboard-layout.is-collapsed .dashboard-sidebar__link,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__link {
  justify-content: center;
  gap: 0;
  padding: 0.62rem;
  min-height: 2.35rem;
  font-size: 0;
}

.dashboard-layout.is-collapsed .dashboard-sidebar__link i,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__link i {
  font-size: 1.08rem;
}

.dashboard-layout.is-collapsed .dashboard-sidebar__link .badge,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__link .badge {
  display: none;
}

.dashboard-layout.is-collapsed .dashboard-sidebar__footer,
.dashboard-sidebar.is-collapsed .dashboard-sidebar__footer {
  display: none;
}

.dashboard-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  margin-bottom: 1.3rem;
  padding: 0.36rem 0.5rem;
  border-radius: 16px;
  background: rgba(232, 87, 139, 0.07);
  border: 1px solid rgba(246, 198, 212, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.dashboard-sidebar__logo {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  background: #fff;
  padding: 0;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 18px rgba(43, 47, 99, 0.16);
}

.dashboard-sidebar__title {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.9rem;
  line-height: 1.25;
}

.dashboard-sidebar__subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
}

.dashboard-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 1.4rem;
}

.dashboard-sidebar__section-label {
  margin: 0.7rem 0 0.25rem;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.dashboard-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.52rem;
  padding: 0.58rem 0.72rem;
  border-radius: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.25;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-sidebar__link i {
  font-size: 0.95rem;
}

.dashboard-sidebar__link:hover,
.dashboard-sidebar__link:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.dashboard-sidebar__link.is-active {
  background: linear-gradient(135deg, var(--accent-strong), #f47ba8);
  border-left: none;
  color: #fff;
  box-shadow: 0 12px 24px rgba(232, 87, 139, 0.38);
}

.dashboard-sidebar__footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dashboard-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(11, 14, 30, 0.38);
  z-index: 35;
  cursor: pointer;
}

.dashboard-backdrop[hidden] {
  display: none !important;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f6f8ff 0%, #ffffff 100%);
  min-height: 100vh;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.dashboard-topbar__toggle {
  border: 1px solid rgba(232, 87, 139, 0.22);
  background: rgba(232, 87, 139, 0.09);
  color: var(--primary-color);
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dashboard-topbar__toggle:hover,
.dashboard-topbar__toggle:focus-visible {
  background: rgba(232, 87, 139, 0.18);
  border-color: rgba(232, 87, 139, 0.35);
}

.dashboard-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-topbar__action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--primary-color);
  background: rgba(232, 87, 139, 0.11);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dashboard-topbar__action:hover,
.dashboard-topbar__action:focus-visible {
  background: rgba(232, 87, 139, 0.2);
  transform: translateY(-1px);
}

.dashboard-topbar__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-strong);
  color: #fff;
  border-radius: 999px;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
}

.dashboard-topbar__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.dashboard-topbar__user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.dashboard-topbar__user-avatar {
  font-size: 1.35rem;
  color: var(--primary-color);
}

.dashboard-topbar__user-avatar-image {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.dashboard-notifications {
  position: relative;
}

.dashboard-notifications__panel {
  position: absolute;
  right: 0;
  top: 110%;
  width: min(340px, 96vw);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.82rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.13);
  padding: 0.65rem 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}

.dashboard-notifications.is-open .dashboard-notifications__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dashboard-notifications__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.dashboard-notifications__list {
  list-style: none;
  margin: 0;
  padding: 0.55rem 0;
  max-height: 320px;
  overflow-y: auto;
}

.dashboard-notifications__item {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.dashboard-notifications__item:last-child {
  border-bottom: none;
}

.dashboard-notifications__link {
  display: block;
  padding: 0.65rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s ease;
}

.dashboard-notifications__link:hover {
  background: rgba(239, 91, 141, 0.1);
}

.dashboard-notifications__title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.dashboard-notifications__body {
  font-size: 0.9rem;
  color: var(--muted-color);
  margin-bottom: 0.35rem;
}

.dashboard-notifications__meta {
  font-size: 0.78rem;
  color: rgba(15, 23, 42, 0.45);
}

.dashboard-notifications__footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  text-align: center;
}

.dashboard-notifications__view-all {
  font-weight: 600;
  color: var(--primary-color);
}

.dashboard-notifications__empty {
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted-color);
}

.dashboard-content {
  flex: 1;
  overflow: auto;
  padding: 1.45rem 1.7rem 2.4rem;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 292px);
    height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-105%);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    border-right-color: rgba(255, 255, 255, 0.14);
  }

  .dashboard-layout.is-sidebar-open .dashboard-sidebar {
    transform: translateX(0);
    box-shadow: 0 30px 42px rgba(15, 23, 42, 0.26);
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar {
    width: min(82vw, 292px);
    padding: 1.25rem 1rem;
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar__title,
  .dashboard-layout.is-collapsed .dashboard-sidebar__subtitle,
  .dashboard-layout.is-collapsed .dashboard-sidebar__section-label {
    display: block;
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar__footer {
    display: flex;
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar__link {
    font-size: 0.94rem;
    gap: 0.52rem;
    padding: 0.58rem 0.72rem;
    min-height: auto;
    justify-content: flex-start;
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar__link i {
    font-size: 0.95rem;
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar__link .badge {
    display: inline-flex;
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar__brand {
    justify-content: flex-start;
    padding: 0.32rem 0.4rem;
  }

  .dashboard-layout.is-collapsed .dashboard-sidebar__logo {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    padding: 0;
    background: #fff;
    object-fit: contain;
  }

  .dashboard-topbar {
    padding: 0.65rem 1rem;
  }

  .dashboard-content {
    padding: 1.25rem 1rem 2rem;
  }
}

@media (max-width: 768px) {
  .dashboard-topbar {
    justify-content: space-between;
  }

  .dashboard-topbar__actions {
    gap: 0.3rem;
  }

  .dashboard-topbar__action {
    width: 34px;
    height: 34px;
  }

  .dashboard-topbar__user {
    padding: 0.25rem 0.5rem;
  }

  .dashboard-topbar__user-name {
    display: none;
  }

  .dashboard-sidebar {
    width: min(86vw, 276px);
  }
}
.superuser-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.superuser-sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  width: 280px;
  background: var(--primary-color);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
  transition: width 0.25s ease, box-shadow 0.25s ease;
}

.superuser-sidebar.is-collapsed {
  width: 68px;
  padding: 0.75rem 0.5rem;
}

.superuser-sidebar__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.45rem 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.superuser-sidebar__toggle:hover,
.superuser-sidebar__toggle:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.superuser-sidebar__toggle-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.superuser-sidebar__toggle-label {
  font-size: 0.7rem;
}

.superuser-sidebar__content {
  margin-top: 1rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.superuser-sidebar.is-collapsed .superuser-sidebar__content {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  height: 0;
  overflow: hidden;
  margin-top: 0;
}

.superuser-sidebar.is-collapsed .superuser-sidebar__toggle {
  flex-direction: column;
  padding: 0.4rem 0.2rem;
  gap: 0.4rem;
}

.superuser-sidebar.is-collapsed .superuser-sidebar__toggle-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.12em;
}

.superuser-sidebar.is-collapsed .superuser-sidebar__toggle-icon {
  transform: rotate(180deg);
}

.superuser-sidebar__header {
  margin-bottom: 1rem;
}

.superuser-sidebar__header .text-muted {
  color: rgba(255, 255, 255, 0.78) !important;
}

.superuser-sidebar__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.5rem;
}

.superuser-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.superuser-nav-link {
  display: block;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.superuser-nav-link:hover,
.superuser-nav-link:focus-visible {
  background: #fbb4c2;
  color: #5a1430;
  border-color: #ef5b8d;
  box-shadow: 0 10px 18px rgba(239, 91, 141, 0.3);
  transform: translateY(-1px);
}

.superuser-nav-link.is-active {
  background: #ef5b8d;
  border-color: #ef5b8d;
  color: #fff;
}

.post-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.post-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--muted-color);
  font-size: 0.92rem;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attachment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.attachment-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  border: 1px dashed rgba(44, 48, 111, 0.35);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  background: #f8fafc;
}

.attachment-item a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
}

.attachment-item a:hover,
.attachment-item a:focus-visible {
  text-decoration: underline;
}


.superuser-content {
  min-width: 0;
}

.post-form-section {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: #fcfcff;
}

.post-upload-box {
  border: 1px dashed rgba(44, 48, 111, 0.28);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  background: #f8faff;
}

.selected-files-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.selected-file-pill {
  background: rgba(239, 91, 141, 0.12);
  color: #5a1430;
  border: 1px solid rgba(239, 91, 141, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}
@media (max-width: 768px) {
  .superuser-layout {
    grid-template-columns: 1fr;
  }

  .superuser-sidebar,
  .superuser-sidebar.is-collapsed {
    position: static;
    width: 100%;
  }

  .superuser-sidebar.is-collapsed .superuser-sidebar__content {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    height: auto;
    overflow: visible;
    margin-top: 1rem;
  }

  .superuser-sidebar.is-collapsed .superuser-sidebar__toggle {
    flex-direction: row;
    justify-content: space-between;
  }

  .superuser-sidebar.is-collapsed .superuser-sidebar__toggle-label {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .superuser-sidebar.is-collapsed .superuser-sidebar__toggle-icon {
    transform: rotate(180deg);
  }

  .superuser-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .superuser-nav-link {
    flex: 1 1 180px;
  }
}
/* User directory (management) */
.user-directory__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(44, 48, 111, 0.72);
}

.user-directory-card {
  position: relative;
  border: 1px solid #d8dee8;
  border-radius: 0.55rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.user-directory-card > * {
  position: relative;
  z-index: 1;
}

.user-directory-card__surface-link {
  z-index: 0 !important;
  border-radius: 1rem;
}

.user-directory-card__header {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.user-directory-card__avatar {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 700;
  color: #1f3562;
  background: #f2f4f8;
  border: 1px solid #d7dce5;
}

.user-directory-card__identity {
  min-width: 0;
}

.user-directory-card__identity h3 {
  margin-right: 0.25rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #2e323c;
}

.user-directory-card__body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-directory-card__meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.76rem;
  color: #8a8f99;
}

.user-directory-card__meta-line i {
  color: #a2a8b3;
  margin-right: 0.2rem;
}

.user-directory-card__quick-actions {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
  z-index: 2;
}

.user-directory-card__quick-actions .btn {
  --bs-btn-padding-y: 0.2rem;
  --bs-btn-padding-x: 0.4rem;
}

.user-directory-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.user-directory-card__status.is-active {
  color: #d69700;
}

.user-directory-card__status.is-inactive {
  color: #a04759;
}

.user-directory-card__stats {
  display: flex;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: #8a8f99;
}

.user-directory-card__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  z-index: 2 !important;
  border-top: 1px solid #edf0f5;
  padding-top: 0.6rem;
}

.user-directory-card__actions .btn {
  width: auto;
}

.user-directory-card__helper-link {
  font-size: 0.76rem;
  color: #8a8f99;
  text-decoration: none;
}

.user-directory-card__helper-link:hover {
  color: #4c5470;
  text-decoration: underline;
}

.user-directory-card__invite-btn {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  background: transparent;
  color: #00a9c3;
  border: none;
  padding-right: 0;
}

.user-directory-card__invite-btn:hover,
.user-directory-card__invite-btn:focus {
  color: #008ea6;
  background: transparent;
}

/* User profile detailed sheet */
.profile-view {
  display: grid;
  gap: 0;
}

.profile-record {
  border: 1px solid #dce2ec;
  border-radius: 0.6rem;
  overflow: hidden;
}

.profile-record__steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #edf1f7;
  background: #fafbfd;
}

.profile-record__step {
  font-size: 0.78rem;
  color: #969ca8;
  position: relative;
  text-align: center;
  font-weight: 600;
}

.profile-record__step.is-active {
  color: #3d4352;
}

.profile-record__content {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
}

.profile-record__aside {
  border-right: 1px solid #edf1f7;
  padding: 1rem;
  background: #f8fafd;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.profile-record__avatar {
  width: 110px;
  height: 110px;
  border-radius: 0.4rem;
  margin: 0 auto 0.35rem;
  background: linear-gradient(135deg, #f4b457, #d86835);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
}

.profile-record__status {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.profile-record__status.is-active {
  color: #c08a00;
}

.profile-record__status.is-inactive {
  color: #a04759;
}

.profile-record__main {
  padding: 1rem 1.1rem;
}

.profile-record__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  padding-bottom: 0.65rem;
}

.profile-record__chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.profile-record__form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1.2rem;
}

.profile-record__field {
  border-bottom: 1px solid #e6eaf1;
  padding-bottom: 0.25rem;
  min-height: 46px;
}

.profile-record__field span {
  display: block;
  font-size: 0.73rem;
  color: #9ba1ad;
  margin-bottom: 0.1rem;
}

.profile-record__field strong {
  font-size: 0.9rem;
  color: #373d49;
  font-weight: 600;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(44, 48, 111, 0.12);
  background: linear-gradient(105deg, #ffffff 0%, #f2f7ff 100%);
}

.profile-hero__main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-hero__avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #152346;
  background: linear-gradient(135deg, #cfe8ff 0%, #f7d9e5 100%);
  border: 1px solid rgba(44, 48, 111, 0.18);
}

.profile-hero__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(44, 48, 111, 0.72);
}

.profile-hero__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.profile-kpi-card {
  border-radius: 0.9rem;
  border: 1px solid rgba(44, 48, 111, 0.12);
  background: #fff;
}

.profile-kpi-card__label {
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.82rem;
}

.profile-kpi-card__value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-color);
}

.profile-data-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 2fr;
  gap: 0.6rem 1rem;
}

.profile-data-grid dt {
  color: rgba(15, 23, 42, 0.66);
  margin: 0;
  font-weight: 600;
}

.profile-data-grid dd {
  margin: 0;
  font-weight: 600;
  color: #1e2638;
}

.profile-info-list {
  display: grid;
  gap: 0.6rem;
}

.profile-course-list {
  display: grid;
  gap: 0.95rem;
}

.profile-course-item {
  padding: 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

.profile-course-item .progress {
  height: 0.55rem;
  border-radius: 999px;
  background: #e9eff7;
}

.profile-course-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.82rem;
}

.profile-certificate-list {
  display: grid;
  gap: 0.8rem;
}

.profile-certificate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.85rem;
  background: #ffffff;
}

.profile-certificate-item .btn {
  width: auto;
}

/* Coordinator panel refresh */
.coordinator-dashboard__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(44, 48, 111, 0.72);
}

.coordinator-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.coordinator-kpi-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.coordinator-kpi-card__label {
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.82rem;
}

.coordinator-kpi-card__value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-color);
}

.coordinator-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.coordinator-pill {
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(44, 48, 111, 0.16);
  background: #f5f8ff;
  color: #1f305f;
  font-weight: 600;
  font-size: 0.85rem;
}

.coordinator-training-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.coordinator-training-metrics div {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.8rem;
  padding: 0.75rem;
  background: #fff;
}

.coordinator-training-metrics strong {
  font-size: 1.2rem;
  color: #1f305f;
}

.coordinator-person-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.coordinator-person-card:hover,
.coordinator-person-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.09);
  border-color: rgba(44, 48, 111, 0.2);
}

.coordinator-person-card.is-warning {
  border-color: rgba(255, 193, 7, 0.4);
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.coordinator-person-card__top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.coordinator-person-card__avatar {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #203164;
  background: linear-gradient(135deg, #d8e9ff, #f5dfe9);
  border: 1px solid rgba(44, 48, 111, 0.15);
}

.coordinator-person-card__meta {
  display: grid;
  gap: 0.25rem;
  color: rgba(15, 23, 42, 0.68);
  font-size: 0.84rem;
}

@media (max-width: 992px) {
  .profile-kpi-grid,
  .coordinator-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .profile-record__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-record__content {
    grid-template-columns: 1fr;
  }

  .profile-record__aside {
    border-right: none;
    border-bottom: 1px solid #edf1f7;
  }

  .profile-record__form-grid {
    grid-template-columns: 1fr;
  }

  .user-directory-card__header,
  .user-directory-card__body,
  .user-directory-card__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-directory-card__quick-actions {
    margin-left: 0;
  }

  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-hero__actions {
    width: 100%;
    justify-content: stretch;
  }

  .profile-hero__actions .btn,
  .profile-certificate-item .btn,
  .user-directory-card__actions .btn {
    width: 100%;
  }

  .profile-kpi-grid,
  .coordinator-kpi-grid,
  .coordinator-training-metrics {
    grid-template-columns: 1fr;
  }

  .profile-data-grid {
    grid-template-columns: 1fr;
  }

  .profile-certificate-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
