:root {
  --bs-blue: #0d6efd;
  --bs-indigo: #6610f2;
  --bs-purple: #6f42c1;
  --bs-red: #dc3545;
  --bs-orange: #fd7e14;
  --bs-yellow: #ffc107;
  --bs-green: #198754;
  --bs-teal: #20c997;
  --bs-cyan: #0dcaf0;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: 0.9444rem;   --bs-body-font-weight: 400;
  --bs-body-line-height: 1.5;

  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success: #198754;
  --bs-danger: #dc3545;
  --bs-warning: #ffc107;
  --bs-info: #0dcaf0;
  --bs-light: #f8f9fa;
  --bs-dark: #212529;

  --bs-body-bg: #f8f9fa;
  --bs-body-color: #212529;
  --bs-emphasis-color: #000;
  --bs-secondary-color: rgba(33, 37, 41, 0.75);
  --bs-secondary-bg: #e9ecef;
  --bs-tertiary-bg: #f8f9fa;
  --bs-border-color: #dee2e6;
  --bs-border-width: 1px;
  --bs-border-radius: 0.5rem;
  --bs-link-color: #0d6efd;
  --bs-link-hover-color: #0a58ca;
  --btn-ghost-hover-color: rgba(33, 37, 41, 0.06);
  --btn-ghost-active-color: rgba(33, 37, 41, 0.12);
  --card-bg: #fff;
  --navbar-bg: #fff;
  --sidebar-bg: #fff;
  --bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

[data-bs-theme="dark"] {
  --bs-body-bg: #212529;
  --bs-body-color: #dee2e6;
  --bs-emphasis-color: #fff;
  --bs-secondary-color: rgba(222, 226, 230, 0.75);
  --bs-secondary-bg: #343a40;
  --bs-tertiary-bg: #2b3035;
  --bs-border-color: #495057;
  --bs-link-color: #6ea8fe;
  --bs-link-hover-color: #8bb9fe;
  --btn-ghost-hover-color: rgba(222, 226, 230, 0.08);
  --btn-ghost-active-color: rgba(222, 226, 230, 0.16);
  --card-bg: #2b3035;
  --navbar-bg: #2b3035;
  --sidebar-bg: #2b3035;
  --bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
  --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--bs-body-font-family);
  font-size: var(--bs-body-font-size);
  font-weight: var(--bs-body-font-weight);
  line-height: var(--bs-body-line-height);
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bs-link-color); text-decoration: none; }
a:hover { color: var(--bs-link-hover-color); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5rem; font-weight: 500; line-height: 1.2; color: var(--bs-emphasis-color); }
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }
h4 { font-size: calc(1.275rem + 0.3vw); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
p { margin: 0 0 1rem; }
hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--bs-border-color); opacity: 0.25; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}
code { color: var(--bs-emphasis-color); background-color: var(--bs-secondary-bg); padding: 0.2em 0.4em; border-radius: 0.25rem; }
pre {
  display: block;
  padding: 1rem;
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  overflow-x: auto;
}
pre code { background: none; padding: 0; }
blockquote {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem;
  border-left: 0.25rem solid var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}
img, svg { vertical-align: middle; }
ul, ol { padding-left: 1.5rem; }

.text-xs { font-size: 0.7rem !important; }
.text-sm { font-size: 0.8125rem !important; }
.text-md { font-size: 0.9444rem !important; }
.text-lg { font-size: 1.15rem !important; }
.text-secondary { color: var(--bs-secondary-color) !important; }
.text-body { color: var(--bs-body-color) !important; }
.text-success { color: var(--bs-success) !important; }
.text-danger { color: var(--bs-danger) !important; }
.text-primary { color: var(--bs-primary) !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-decoration-none { text-decoration: none !important; }
.text-decoration-underline { text-decoration: underline !important; }
.lh-1 { line-height: 1 !important; }
.link-secondary { color: var(--bs-secondary-color); }

.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-grid { display: grid !important; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-fill { flex: 1 1 auto !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-self-center { align-self: center !important; }
.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.pe-2 { padding-right: 0.5rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mx-n1 { margin-left: -0.25rem; margin-right: -0.25rem; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0 { left: 0 !important; }
.end-0 { right: 0 !important; }
.translate-middle-x { transform: translateX(-50%) !important; }
.min-width-0 { min-width: 0 !important; }
.overflow-hidden { overflow: hidden !important; }
.opacity-50 { opacity: 0.5 !important; }
.z-1 { z-index: 1 !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.rounded { border-radius: var(--bs-border-radius) !important; }
.rounded-1 { border-radius: 0.25rem !important; }
.rounded-circle { border-radius: 50% !important; }
.border { border: var(--bs-border-width) solid var(--bs-border-color) !important; }
.border-0 { border: 0 !important; }
.shadow-sm { box-shadow: var(--bs-box-shadow-sm) !important; }
.shadow { box-shadow: var(--bs-box-shadow) !important; }
.sticky-top { position: sticky; top: 0; z-index: 100; }

.container { width: 100%; max-width: 1320px; margin-inline: auto; }
.row { display: flex; flex-wrap: wrap; margin: -0.75rem; }
.row > * { padding: 0.75rem; }
.col-12 { flex: 0 0 auto; width: 100%; }
.col-lg-3 { flex: 0 0 auto; width: 100%; }
.col-lg-6 { flex: 0 0 auto; width: 100%; }
.col-lg-9 { flex: 0 0 auto; width: 100%; }
@media (min-width: 992px) {
  .col-lg-3 { width: 25%; }
  .col-lg-6 { width: 50%; }
  .col-lg-9 { width: 75%; }
}

.btn {
  --btn-color: var(--bs-body-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.375rem 0.75rem;
  font-size: var(--bs-body-font-size);
  font-weight: 400;
  line-height: 1.5;
  color: var(--btn-color);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.65; pointer-events: none; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8125rem; border-radius: 0.375rem; }
.btn-primary {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.btn-primary:hover { background-color: #0b5ed7; border-color: #0a58ca; color: #fff; }
.btn-secondary {
  color: #fff;
  background-color: var(--bs-secondary);
  border-color: var(--bs-secondary);
}
.btn-secondary:hover { background-color: #5c636a; color: #fff; }
.btn-warning {
  color: #000;
  background-color: var(--bs-warning);
  border-color: var(--bs-warning);
}
.btn-warning:hover { background-color: #ffca2c; color: #000; }
.btn-info {
  color: #000;
  background-color: var(--bs-info);
  border-color: var(--bs-info);
}
.btn-info:hover { background-color: #31d2f2; color: #000; }
.btn-outline-secondary {
  color: var(--bs-secondary);
  border-color: var(--bs-secondary);
}
.btn-outline-secondary:hover {
  color: #fff;
  background-color: var(--bs-secondary);
}
.btn-ghost {
  color: var(--bs-secondary-color);
  background-color: transparent;
  border: 0;
}
.btn-ghost:hover { background-color: var(--btn-ghost-hover-color); color: var(--bs-body-color); }
.btn-ghost.active, .btn-ghost:active { background-color: var(--btn-ghost-active-color); color: var(--bs-body-color); }
.btn-link { color: var(--bs-link-color); }
.btn-link:hover { color: var(--bs-link-hover-color); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  border-radius: 0.375rem;
}
.badge.bg-secondary { background-color: var(--bs-secondary) !important; }
.badge.bg-primary { background-color: var(--bs-primary) !important; }
.badge.bg-danger { background-color: var(--bs-danger) !important; }
.badge.bg-success { background-color: var(--bs-success) !important; }
.badge.bg-info { background-color: var(--bs-info) !important; color: #000; }
.badge.bg-warning { background-color: var(--bs-warning) !important; color: #000; }
.badge.border { border: 1px solid var(--bs-border-color) !important; }
.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  background-color: var(--bs-secondary-bg);
  border-radius: 1rem;
  text-decoration: none;
}
.tag-item:hover { color: var(--bs-body-color); background-color: var(--bs-border-color); text-decoration: none; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}
.card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  background-color: transparent;
  font-weight: 600;
}
.card-body { padding: 1rem; flex: 1 1 auto; }
.card-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--bs-border-color);
  background-color: transparent;
}
.card-title { margin-bottom: 0.5rem; font-weight: 600; }

.list-group {
  display: flex;
  flex-direction: column;
  border-radius: var(--bs-border-radius);
}
.list-group-flush > .list-group-item { border-inline: 0; border-radius: 0; }
.list-group-item {
  position: relative;
  display: block;
  padding: 0.75rem 1rem;
  background-color: var(--card-bg);
  border: 1px solid var(--bs-border-color);
}
.list-group-item + .list-group-item { border-top: 0; }
.list-group-item:first-child { border-top-left-radius: var(--bs-border-radius); border-top-right-radius: var(--bs-border-radius); }
.list-group-item:last-child { border-bottom-left-radius: var(--bs-border-radius); border-bottom-right-radius: var(--bs-border-radius); }
.list-group-item:hover { background-color: var(--bs-tertiary-bg); }

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font: inherit;
  color: var(--bs-body-color);
  background-color: var(--card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: 0;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}
.form-control-sm { padding: 0.25rem 0.5rem; font-size: 0.8125rem; border-radius: 0.375rem; }
textarea.form-control { min-height: 6rem; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 1rem; height: 1rem; accent-color: var(--bs-primary); }
.form-label { margin-bottom: 0.25rem; font-weight: 600; font-size: 0.875rem; }

.dropdown, .dropup, .dropstart, .dropend { position: relative; }
.dropdown-toggle::after {
  content: "";
  display: inline-block;
  margin-left: 0.4em;
  vertical-align: 0.15em;
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-left: 0.3em solid transparent;
}
.dropdown-menu {
  position: absolute;
  z-index: 1000;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0.25rem;
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--bs-body-color);
  list-style: none;
  background-color: var(--card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
}
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.75rem;
  clear: both;
  font-weight: 400;
  color: var(--bs-body-color);
  text-align: inherit;
  white-space: nowrap;
  border: 0;
  border-radius: 0.25rem;
  background: none;
  cursor: pointer;
  text-decoration: none;
}
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--bs-tertiary-bg); text-decoration: none; }
.dropdown-item.text-danger { color: var(--bs-danger) !important; }
.dropdown-header {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  white-space: nowrap;
}
.dropdown-divider { height: 0; margin: 0.5rem 0; border-top: 1px solid var(--bs-border-color); opacity: 0.5; }

.alert {
  position: relative;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius);
}
.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffec99;
}
[data-bs-theme="dark"] .alert-warning {
  color: #ffda6a;
  background-color: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
}
.alert-danger { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.alert-dismissible { padding-right: 3rem; }
.btn-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  color: currentColor;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
}
.btn-close:hover { opacity: 1; }
.btn-close::before { content: "\00d7"; font-size: 1.4em; line-height: 0.6; }

#toaster {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, calc(100vw - 2rem));
}
.toast {
  position: relative;
  overflow: hidden;
  padding: 0.75rem 1rem;
  color: #fff;
  background-color: rgba(var(--bs-secondary-rgb), 0.95);
  border: 0;
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
}
.toast-success { background-color: rgba(25, 135, 84, 0.95); }
.toast-danger { background-color: rgba(220, 53, 69, 0.95); }
.toast-warning { background-color: rgba(253, 126, 20, 0.95); }
.toast-info { background-color: rgba(13, 202, 240, 0.95); color: #000; }
.toast .alert-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.35);
  transform-origin: left;
  animation: toast-timer 3s linear forwards;
}
@keyframes toast-timer { to { transform: scaleX(0); } }

.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--navbar-bg);
  border-bottom: 1px solid var(--bs-border-color);
}
.navbar-toggler {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  background: none;
  border: 0;
  color: var(--bs-body-color);
  cursor: pointer;
}
.offcanvas {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1045;
  width: 280px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--bs-border-color);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}
.offcanvas.show { transform: none; }
.offcanvas-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background-color: rgba(0, 0, 0, 0.5);
}
.offcanvas-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; }
.offcanvas-body { overflow-y: auto; padding: 0 1rem 1rem; }

.caret {
  display: inline-block;
  margin-left: 0.4em;
  vertical-align: 0.15em;
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-left: 0.3em solid transparent;
}

.avatar {
  --avatar-size: 2.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  font-size: calc(var(--avatar-size) * 0.45);
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background-color: var(--bs-secondary);
  border-radius: 50%;
  text-decoration: none;
  user-select: none;
  vertical-align: middle;
}
.avatar.avatar-rounded { border-radius: 50%; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar.avatar-xs { --avatar-size: 1.5rem; }
.avatar.avatar-sm { --avatar-size: 2rem; }
.avatar.avatar-lg { --avatar-size: 3rem; }
.avatar.avatar-xl { --avatar-size: 4rem; }
.avatar.status-indicator { --avatar-size: 0.65rem; background-clip: padding-box; border: 2px solid var(--card-bg); }
.status-online { background-color: var(--bs-success) !important; }
.status-away { background-color: var(--bs-warning) !important; }
.status-dnd { background-color: var(--bs-danger) !important; }
.status-offline { background-color: var(--bs-secondary) !important; opacity: 0.6; }
.avatar-stack { display: flex; }
.avatar-stack > .avatar {
  margin-left: calc(var(--avatar-size) * -0.3);
  border: 2px solid var(--card-bg);
}
.avatar-stack > .avatar:first-child { margin-left: 0; }

.fa {
  display: inline-flex;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
  flex-shrink: 0;
}
.fa.fas, .fa.fa-solid { fill: currentColor; stroke: none; }
svg.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.fa-fw { width: 1.25em; }

#app-layout { display: flex; min-height: 100vh; }

#sidebar-left {
  position: sticky;
  top: 0;
  display: none;
  flex-direction: column;
  width: 300px;
  height: 100vh;
  overflow-y: auto;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--bs-border-color);
  padding: 1rem;
  scrollbar-width: thin;
}
.sidebar-brand { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.5rem 1rem; text-decoration: none; }
.sidebar-brand img { height: 32px; }
.sidebar-brand:hover { text-decoration: none; }
.brand-text { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--bs-emphasis-color); }
.brand-text .brand-accent { color: var(--bs-primary); }

.main-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.main-nav > li > a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--bs-border-radius);
  color: var(--bs-body-color);
  text-decoration: none;
  font-weight: 500;
}
.main-nav > li > a:hover { background-color: var(--btn-ghost-hover-color); text-decoration: none; }
.main-nav > li > a.active {
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
  font-weight: 600;
}
.main-nav .badge { margin-left: auto; }
.nav-divider {
  height: 1px;
  margin: 0.5rem 0.75rem;
  background-color: var(--bs-border-color);
}

#content { flex: 1 1 auto; min-width: 0; padding: 1.5rem 1rem; }
#content > .container { max-width: 1100px; }

#mobile-navbar { display: flex; }
@media (min-width: 992px) {
  #sidebar-left { display: flex; }
  #mobile-navbar { display: none; }
}

#sidebar-right { display: none; }
@media (min-width: 1200px) {
  #sidebar-right { display: block; }
  #sidebar-right .sticky-inner { position: sticky; top: 1.5rem; }
}

/* Online card is SSI-injected at the top of .sticky-inner; pin it last
   visually (sticky-inner is a flex column, siblings default to order 0). */
#sidebar-right .online-users-card { order: 99; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0; margin: 0 0 0.5rem; font-size: 0.8125rem; list-style: none; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; padding-right: 0.25rem; color: var(--bs-secondary-color); }

.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-header h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }

[component="categories/category"] {
  margin-bottom: 1rem;
}
.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  min-width: 3rem;
  border-radius: var(--bs-border-radius);
  font-size: 1.35rem;
  color: #fff;
}
.category-icon.sm { width: 2rem; height: 2rem; min-width: 2rem; font-size: 0.95rem; border-radius: 0.375rem; }
.category-card { transition: box-shadow 0.15s ease; }
.category-card:hover { box-shadow: var(--bs-box-shadow-sm); }
.category-card .teaser { border-top: 1px solid var(--bs-border-color); background-color: var(--bs-tertiary-bg); border-radius: 0 0 calc(var(--bs-border-radius) - 1px) calc(var(--bs-border-radius) - 1px); }
.subcategory {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
}
.stats-text { font-size: 0.8125rem; color: var(--bs-secondary-color); white-space: nowrap; }
.stats-text strong { color: var(--bs-body-color); }

[component="category/topic"] {
  display: grid;
  grid-template-areas: "icon body" "icon meta";
  grid-template-columns: 3rem 1fr;
  gap: 0.25rem 1rem;
  padding: 1rem;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--bs-border-color);
}
[component="category/topic"]:hover { background-color: var(--bs-tertiary-bg); }
[component="category/topic"]:first-child { border-top-left-radius: var(--bs-border-radius); border-top-right-radius: var(--bs-border-radius); }
[component="category/topic"]:last-child { border-bottom: 0; border-bottom-left-radius: var(--bs-border-radius); border-bottom-right-radius: var(--bs-border-radius); }
.topic-row-icon { grid-area: icon; align-self: start; }
.topic-row-body { grid-area: body; min-width: 0; }
.topic-row-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; font-size: 0.8125rem; color: var(--bs-secondary-color); }
.topic-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bs-body-color);
  text-decoration: none;
}
.topic-title:hover { color: var(--bs-link-color); text-decoration: none; }
.topic-title.unread { color: var(--bs-emphasis-color); font-weight: 700; }
.topic-title.unread::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.4rem;
  border-radius: 50%;
  background-color: var(--bs-primary);
  vertical-align: super;
}
[component="topic/labels"] { display: inline-flex; gap: 0.3rem; vertical-align: middle; margin-left: 0.35rem; }
.topic-pin-icon, .topic-lock-icon { color: var(--bs-secondary-color); }
.topic-meta-cell { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 3.5rem; }
.topic-meta-cell strong { color: var(--bs-body-color); }
[component="topic/teaser"] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: 0 0 10rem;
  min-width: 0;
}
[component="topic/teaser"] .teaser-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
@media (max-width: 767.98px) {
  [component="category/topic"] { grid-template-columns: 2.5rem 1fr; padding: 0.75rem 0.5rem; }
  [component="topic/teaser"] { display: none; }
  .topic-row-meta .hide-mobile { display: none; }
}

.category-tools .btn { font-size: 0.875rem; }

.topic-header h1 { font-size: 1.6rem; font-weight: 700; }
.topic-info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

[component="post"] {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0.5rem;
  border-bottom: 1px solid var(--bs-border-color);
  scroll-margin-top: 5rem;
}
[component="post"]:target { background-color: rgba(var(--bs-primary-rgb), 0.06); }
[component="post"] .post-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 3rem;
  min-width: 3rem;
}
.post-author-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.post-author { font-weight: 600; color: var(--bs-body-color); }
.post-author:hover { text-decoration: none; color: var(--bs-link-color); }
.group-badge {
  display: inline-flex;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 1rem;
  color: #fff;
  background-color: var(--bs-purple);
}
[component="post/content"] { min-width: 0; overflow-wrap: anywhere; }
[component="post/content"] h2, [component="post/content"] h3, [component="post/content"] h4 { margin-top: 1.25rem; }
.post-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin-top: 0.75rem; }
.vote-container {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}
.vote-container .btn { padding: 0.1rem 0.4rem; }
[component="post/vote-count"] { min-width: 1.25rem; text-align: center; font-weight: 600; font-size: 0.875rem; }
[data-upvoted] .fa-chevron-up { color: var(--bs-primary); }
[data-upvoted] [component="post/vote-count"] { color: var(--bs-primary); }
[data-downvoted] .fa-chevron-down { color: var(--bs-danger); }
[component="post/bookmark-count"] { font-size: 0.7rem; }
.bookmarked .fa-bookmark { color: var(--bs-warning); fill: currentColor; }
.signature {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--bs-border-color);
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  font-style: italic;
}
[component="post/parent"] {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  background-color: var(--bs-tertiary-bg);
  border-left: 3px solid var(--bs-border-color);
  border-radius: 0.25rem;
  color: var(--bs-secondary-color);
}
[component="topic/event"] {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem 0.4rem 4rem;
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  border-bottom: 1px solid var(--bs-border-color);
}

[component="topic/quickreply/container"] {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: var(--card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}
[component="topic/quickreply/text"] { min-height: 5rem; }

#post-navigator {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--bs-body-color);
  background-color: var(--card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 2rem;
  box-shadow: var(--bs-box-shadow-sm);
  opacity: 0;
  transition: opacity 0.2s;
}
#post-navigator.visible { opacity: 1; }
#post-navigator .btn { padding: 0 0.4rem; }

.user-card { text-align: center; }
.user-card .avatar { margin: 1.5rem auto 0.5rem; --avatar-size: 4rem; font-size: 1.75rem; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-cloud .tag-item { font-size: 0.9rem; padding: 0.35rem 0.8rem; }
.tag-cloud .tag-item strong { color: var(--bs-primary); }

#footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 2rem auto 0.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.ghost-scrollbar { scrollbar-width: thin; scrollbar-color: var(--bs-border-color) transparent; }
.ghost-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.ghost-scrollbar::-webkit-scrollbar-thumb { background-color: var(--bs-border-color); border-radius: 3px; }
.ghost-scrollbar::-webkit-scrollbar-track { background: transparent; }

.timeago { white-space: nowrap; }
.deleted-post [component="post/content"] { opacity: 0.55; font-style: italic; }
.no-items {
  display: none;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--bs-secondary-color);
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(var(--bs-primary-rgb), 0.08), transparent),
    radial-gradient(1000px 500px at 110% 110%, rgba(var(--bs-primary-rgb), 0.06), transparent),
    var(--bs-body-bg);
}
.auth-wrapper { width: 100%; max-width: 26rem; }
.auth-card { border-radius: 0.75rem; }
.auth-title { font-size: 1.35rem; font-weight: 700; margin-top: 0.75rem; }

.forum-banner { width: 100%; height: auto; display: block; }

/* Pagination */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  margin: 0;
}
.page-link {
  position: relative;
  display: block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--bs-link-color);
  background-color: var(--card-bg);
  border: var(--bs-border-width) solid var(--bs-border-color);
  text-decoration: none;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}
.page-item:first-child .page-link { border-top-left-radius: var(--bs-border-radius); border-bottom-left-radius: var(--bs-border-radius); }
.page-item:last-child .page-link { border-top-right-radius: var(--bs-border-radius); border-bottom-right-radius: var(--bs-border-radius); }
.page-item + .page-item .page-link { margin-left: calc(var(--bs-border-width) * -1); }
.page-link:hover {
  z-index: 2;
  color: var(--bs-link-hover-color);
  background-color: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}
.page-item.active .page-link {
  z-index: 3;
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.page-item.disabled .page-link {
  color: var(--bs-secondary-color);
  pointer-events: none;
  background-color: var(--card-bg);
  border-color: var(--bs-border-color);
}
