:root {
  --app-bg: #f5f7fb;
  --app-surface: #ffffff;
  --app-border: #e6eaf2;
  --app-text: #172033;
  --app-muted: #667085;
  --app-primary: #3454d1;
  --app-primary-dark: #24399b;
  --app-ring: rgba(52, 84, 209, 0.25);
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.25rem var(--app-ring);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(52, 84, 209, 0.12), transparent 32rem),
    linear-gradient(180deg, #fbfcff 0%, var(--app-bg) 22rem);
  min-height: 100vh;
}

a {
  color: var(--app-primary);
}

a:hover {
  color: var(--app-primary-dark);
}

.app-body {
  display: flex;
  flex-direction: column;
}

.app-navbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(230, 234, 242, 0.9);
  backdrop-filter: saturate(1.3) blur(14px);
}

.navbar-brand {
  color: var(--app-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  height: 1.6rem;
  object-fit: contain;
  width: 1.6rem;
}

.navbar .nav-link {
  border-radius: 999px;
  color: #475467;
  font-weight: 500;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  background: #eef2ff;
  color: var(--app-primary-dark);
}

.dropdown-menu {
  border-color: var(--app-border);
  border-radius: 1rem;
}

.app-main {
  flex: 1 0 auto;
  padding-bottom: 3rem;
  padding-top: 1.5rem;
}

.app-breadcrumb {
  background-color: var(--bs-tertiary-bg);
  border-bottom: 1px solid var(--bs-border-color) !important;
  margin-bottom: 1.5rem;
}

.app-breadcrumb-list {
  --bs-breadcrumb-divider: "›";
}

.app-breadcrumb-list .breadcrumb-item,
.app-breadcrumb-list .breadcrumb-item.active {
  align-items: center;
  display: inline-flex;
  line-height: 1.4;
}

.content-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(230, 234, 242, 0.85);
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.08);
  padding: clamp(1rem, 2.5vw, 2rem);
}

.card {
  border-color: var(--app-border);
  border-radius: 1.1rem;
}

.card-header:first-child {
  border-radius: 1.1rem 1.1rem 0 0;
}

.card-footer:last-child {
  border-radius: 0 0 1.1rem 1.1rem;
}

.shadow-sm {
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.07) !important;
}

.btn {
  border-radius: 0.8rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover {
  background: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
}

.form-control,
.form-select {
  border-color: #d0d5dd;
  border-radius: 0.8rem;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table thead th {
  color: var(--app-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table > :not(caption) > * > * {
  padding: 0.95rem 1rem;
}

.alert {
  border-radius: 1rem;
}

.app-footer {
  color: var(--app-muted);
  margin-top: 2rem;
}

.app-footer-rule {
  border-top: 1px solid var(--bs-border-color);
}

/* Add extra padding below the Applications card */
.admin-applications-card {
  margin-bottom: 2.5rem;
}


.current-user-toggle {
  color: inherit;
}

.current-user-menu {
  min-width: 18rem;
}

.notification-menu {
  min-width: min(22rem, 90vw);
  max-width: 22rem;
}

.comment-thread-list {
  display: grid;
  gap: 0;
  min-width: 0;
}

.comment-node {
  min-width: 0;
  position: relative;
  scroll-margin-top: 5rem;
}

.comment-thread-list > .comment-node + .comment-node {
  border-top: 1px solid var(--app-border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.comment-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
  min-width: 0;
  padding: 1rem;
  width: 100%;
}

.comment-anchor-target:target > .comment-card,
.activity-anchor-target:target,
.item-section-anchor:target {
  animation: notification-target-glow 2.8s ease-out;
  border-color: rgba(13, 110, 253, 0.55) !important;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.18), 0 0 2rem rgba(13, 110, 253, 0.35) !important;
}

.activity-anchor-target,
.item-section-anchor {
  scroll-margin-top: 5rem;
}

.activity-anchor-target {
  border: 1px solid transparent;
  border-radius: 0.75rem;
}

@keyframes notification-target-glow {
  0% {
    box-shadow: 0 0 0 0.4rem rgba(13, 110, 253, 0.32), 0 0 2.25rem rgba(13, 110, 253, 0.55);
  }
  100% {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.18), 0 0 2rem rgba(13, 110, 253, 0.35);
  }
}

.comment-card-internal {
  background: #fff8e6;
  border-color: #ffd98a;
}

.comment-card-header {
  align-items: flex-start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

.comment-card-meta {
  min-width: 0;
}

.comment-card-tools {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.comment-body {
  display: block;
  font-family: inherit;
  margin-bottom: 0;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-edited {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  color: var(--app-muted);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  text-transform: uppercase;
}

.comment-actions {
  display: flex;
  gap: 0.35rem;
}

.comment-action-button {
  align-items: center;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  padding: 0;
  width: 2rem;
}

.comment-compose {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.9rem;
  margin-top: 0.85rem;
  padding: 1rem;
}

.comment-children {
  border-left: 3px solid var(--app-border);
  display: grid;
  gap: 0.85rem;
  margin-left: 2rem;
  margin-top: 0.85rem;
  padding-left: 1.75rem;
}

.comment-node-reply::before {
  background: var(--app-border);
  content: "";
  height: 3px;
  left: -1.75rem;
  position: absolute;
  top: 1.6rem;
  width: 1.75rem;
}

@media (max-width: 575.98px) {
  .comment-card-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .comment-children {
    margin-left: 0.75rem;
    padding-left: 1rem;
  }

  .comment-node-reply::before {
    left: -1rem;
    width: 1rem;
  }
}

.avatar-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  color: #212529;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-circle-lg {
  width: 3rem;
  height: 3rem;
}

.avatar-profile {
  width: 7rem;
  height: 7rem;
}

.avatar-fallback {
  background: #0d6efd;
  color: #fff;
}

.dashboard-stat-card {
  min-height: 100%;
}

.dashboard-stat-label {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.dashboard-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.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;
}
