:root {
  --ui-font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --ui-font-size-base: 16px;
  --ui-line-height-base: 1.5;
  --ui-color-bg: #f6f8fb;
  --ui-color-surface: #ffffff;
  --ui-color-text: #0b1726;
  --ui-color-muted: #52667a;
  --ui-color-primary: #0b82c4;
  --ui-color-primary-2: #38bdf8;
  --ui-color-accent: #14b8a6;
  --ui-color-success: #059669;
  --ui-color-warning: #b45309;
  --ui-color-danger: #dc2626;
  --ui-color-border: #d8e2ec;
  --ui-glass-bg: rgba(255, 255, 255, 0.74);
  --ui-glass-bg-strong: rgba(255, 255, 255, 0.9);
  --ui-glass-border: rgba(185, 210, 232, 0.55);
  --ui-glass-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
  --ui-glass-shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
  --ui-glass-blur: 14px;
  --ui-radius-sm: 10px;
  --ui-radius-md: 14px;
  --ui-radius-lg: 18px;
  --ui-shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.08);
  --ui-shadow-md: 0 14px 30px rgba(15, 23, 42, 0.12);
  --ui-shadow-lg: 0 22px 44px rgba(15, 23, 42, 0.16);
  --bs-primary: #0b82c4;
  --bs-primary-rgb: 11, 130, 196;
  --bs-link-color: #0b6fa8;
  --bs-link-hover-color: #075985;
}

html {
  font-size: var(--ui-font-size-base);
}

body {
  font-family: var(--ui-font-body);
  line-height: var(--ui-line-height-base);
  color: var(--ui-color-text);
  background:
    linear-gradient(180deg, #fbfdff 0%, #f3f6fa 48%, #f8fafc 100%);
  min-height: 100vh;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role='button']:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(51, 185, 232, 0.36) !important;
}

.text-primary {
  color: #0b6fa8 !important;
}

.bg-primary-subtle {
  background-color: #e8f7ff !important;
}

.border-primary-subtle {
  border-color: #b9e4fb !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1051;
  background: #fff;
  color: #0f2b44;
  padding: 0.5rem 0.85rem;
  border-radius: 0 0 var(--ui-radius-sm) 0;
  border: 1px solid var(--ui-color-border);
}

.skip-link:focus {
  left: 0;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.38rem 0;
  background-image: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.94),
    rgba(247, 251, 255, 0.92) 55%,
    rgba(240, 247, 254, 0.92)
  );
  border-bottom: 1px solid rgba(210, 226, 242, 0.65);
  box-shadow: 0 4px 20px rgba(56, 111, 161, 0.07);
  backdrop-filter: blur(var(--ui-glass-blur)) saturate(135%);
  -webkit-backdrop-filter: blur(var(--ui-glass-blur)) saturate(135%);
}

.navbar .container {
  gap: 0.8rem;
}

.navbar-brand {
  color: #0b1726 !important;
  font-weight: 680;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  padding-top: 0;
  padding-bottom: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-brand:hover {
  transform: translateY(-1px);
  opacity: 0.97;
}

.navbar-brand-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 8px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(174, 206, 232, 0.86), 0 4px 12px rgba(41, 89, 131, 0.14);
}

.offcanvas-brand-logo {
  width: 25px;
  height: 25px;
  object-fit: contain;
  border-radius: 7px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.82);
}

.navbar-toggler {
  border-radius: 10px;
  border-color: rgba(159, 192, 221, 0.84);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.32rem 0.48rem;
}

@media (max-width: 991.98px) {
  .navbar {
    padding: 0.22rem 0;
  }
  .navbar-brand-logo {
    width: 25px;
    height: 25px;
    border-radius: 6px;
    padding: 2px;
  }
  .navbar-brand {
    font-size: 0.9rem;
  }
  .navbar-toggler {
    padding: 0.22rem 0.44rem;
    border-radius: 8px;
  }
  .navbar .navbar-toggler-icon {
    width: 0.95em;
    height: 0.95em;
  }
}

.navbar .navbar-toggler-icon {
  filter: hue-rotate(176deg) saturate(0.95) brightness(0.62);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(84, 177, 235, 0.28);
}

.nav-menu-list {
  gap: 0.44rem;
}

.navbar .nav-link.nav-menu-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.76rem !important;
  border-radius: 999px;
  border: 1px solid rgba(174, 206, 232, 0.76);
  background: rgba(255, 255, 255, 0.64);
  color: #1f3448;
  font-size: 0.89rem;
  font-weight: 580;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.navbar .nav-link.nav-menu-link:hover {
  transform: translateY(-1px);
  color: #075985;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(147, 192, 225, 0.9);
}

.navbar .nav-link.nav-menu-link.active {
  color: #075985 !important;
  background: linear-gradient(135deg, #e8f7ff, #d9f4ff);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.18);
  font-weight: 680;
}

.nav-link-icon {
  font-size: 0.92rem;
  line-height: 1;
}

.navbar .nav-link.nav-menu-link.register-cta {
  color: #1f4f74;
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(174, 206, 232, 0.76);
  box-shadow: none;
}

.navbar .nav-link.nav-menu-link.register-cta:hover {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(147, 192, 225, 0.9);
  color: #0d5f9f;
  box-shadow: none;
}

.navbar .nav-link.nav-menu-link.register-cta.active {
  color: #0c5f9f !important;
  background: linear-gradient(180deg, #ffffff, #f4faff);
  border-color: #d2e7f8;
  box-shadow: 0 8px 20px rgba(56, 111, 161, 0.2);
}

.navbar .nav-link.nav-menu-link.register-cta.active:hover {
  color: #0b5a95 !important;
  background: linear-gradient(180deg, #ffffff, #edf7ff);
  border-color: #c4dff5;
}

.navbar .nav-link.nav-menu-link.nav-menu-logout:hover {
  color: #a71b2d;
  background: rgba(254, 226, 226, 0.72);
  border-color: rgba(252, 165, 165, 0.68);
}

/* Mobile Top Navbar Actions & Controls */
.mobile-top-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.mobile-top-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(174, 206, 232, 0.76);
  background: rgba(255, 255, 255, 0.72);
  color: #1f4f74;
  font-size: 0.98rem;
  transition: all 0.2s ease;
}

.mobile-top-nav-btn:hover,
.mobile-top-nav-btn:focus,
.mobile-top-nav-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(147, 192, 225, 0.95);
  color: #0d5f9f;
  transform: translateY(-1px);
}

.navbar-toggler.mobile-top-nav-btn {
  padding: 0 !important;
  line-height: 1;
}

.navbar-toggler.mobile-top-nav-btn .navbar-toggler-icon {
  width: 1.05em;
  height: 1.05em;
}

.mobile-top-nav-btn .notif-bell-badge {
  top: -4px;
  right: -4px;
}

/* Notification Dropdown Menu */
.notif-dropdown-menu {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(31, 79, 116, 0.2);
  border: 1px solid rgba(177, 207, 231, 0.78);
  background: #ffffff;
}

.notif-dropdown-list {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-x: none;
  width: 100%;
}

.notif-dropdown-list .dropdown-item {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
  border-radius: 0;
}

.notif-dropdown-list .dropdown-item:hover {
  background-color: rgba(235, 245, 255, 0.8);
}

.notif-dropdown-list .dropdown-item:active {
  background-color: rgba(219, 238, 254, 0.9);
}

#navOffcanvas,
#navOffcanvasPublic {
  width: min(80vw, 330px);
  max-width: 80vw;
}

#navOffcanvas .offcanvas-header {
  background: linear-gradient(120deg, #f9fdff, #e8f3ff 52%, #d9ebfb);
  color: #12486f;
  border-bottom: 1px solid var(--ui-color-border);
  padding: 0.45rem 0.85rem;
  min-height: 44px;
}

#navOffcanvas .offcanvas-title {
  font-size: 0.94rem;
  font-weight: 650;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

#navOffcanvas .btn-close {
  opacity: 0.6;
  padding: 0.35rem;
  font-size: 0.75rem;
}

#navOffcanvas .offcanvas-body {
  background: linear-gradient(180deg, #f9fdff, #f2f8ff);
}

.mobile-menu-section-header {
  font-size: 0.76rem;
  font-weight: 700;
  color: #58708b;
  padding: 0.55rem 0.75rem 0.2rem;
}

.mobile-user-footer {
  margin: 0.65rem 0.35rem 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #d7e4f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #16486f;
  font-weight: 600;
  font-size: 0.88rem;
  min-width: 0;
}

.mobile-user-info i {
  font-size: 1.05rem;
  color: var(--ui-color-primary);
  flex-shrink: 0;
}

.mobile-user-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-list {
  padding: 0.65rem;
  gap: 0.2rem;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  border-radius: 11px;
  padding: 0.8rem 0.9rem !important;
  color: #1d4b70;
  font-weight: 570;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-link:hover {
  color: #0e5f9f;
  background: #eaf4ff;
  border-color: #c7ddf0;
}

.mobile-menu-link.active {
  color: #0d5f9f;
  background: #e6f3ff;
  border-color: #a8cde9;
  font-weight: 680;
}

.mobile-menu-link.mobile-menu-link-cta {
  color: #1d4b70;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.mobile-menu-link.mobile-menu-link-cta:hover {
  color: #0e5f9f;
  background: #eaf4ff;
  border-color: #c7ddf0;
  box-shadow: none;
}

.mobile-menu-link.mobile-menu-link-cta.active {
  color: #0d5f9f;
  background: linear-gradient(180deg, #ffffff, #f2f9ff);
  border-color: #cde2f5;
  box-shadow: 0 8px 18px rgba(56, 111, 161, 0.16);
}

.mobile-menu-link.mobile-menu-link-cta.active:hover {
  color: #0b5a95;
  background: linear-gradient(180deg, #ffffff, #ecf6ff);
  border-color: #c2dbf1;
}

.mobile-menu-link i {
  width: 1rem;
  text-align: center;
}

.mobile-logout-btn {
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.32rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1.2;
}

.ui-main-content {
  padding-top: 1.2rem;
  padding-bottom: 1rem;
}

.ui-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ui-page-header:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ui-page-header-compact {
  margin-bottom: 0.75rem;
}

.ui-page-title {
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  color: #103a5d;
}

.ui-page-subtitle {
  margin-top: 0.35rem;
  color: var(--ui-color-muted);
  font-size: 0.95rem;
}

.ui-page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ui-breadcrumb-nav {
  margin-bottom: 0.85rem;
}

.ui-breadcrumb-nav .breadcrumb {
  margin-bottom: 0;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  background: transparent;
  padding: 0;
}

.ui-breadcrumb-nav .breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.ui-breadcrumb-nav .breadcrumb-item a {
  color: #0284c7;
  font-weight: 600;
  transition: color 0.15s ease;
}

.ui-breadcrumb-nav .breadcrumb-item a:hover {
  color: #0369a1;
  text-decoration: underline !important;
}

.ui-breadcrumb-nav .breadcrumb-item.active {
  color: #334155;
  font-weight: 600;
}

.ui-breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
  color: #94a3b8;
  font-weight: 400;
  padding-right: 0.4rem;
  content: "/";
}

.ui-card {
  background: linear-gradient(145deg, var(--ui-glass-bg-strong), rgba(240, 249, 255, 0.78));
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-md);
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn {
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-sm {
  border-radius: 10px;
}

.btn-lg {
  border-radius: 14px;
}

.ui-card .card-header {
  background-image: linear-gradient(135deg, rgba(225, 241, 255, 0.78), rgba(250, 253, 255, 0.92));
  border-bottom: 1px solid #d5e6f7;
  font-weight: 600;
}

.ui-overview-card {
  border-radius: var(--ui-radius-md);
  border: 1px solid #d2e5f5;
  box-shadow: var(--ui-shadow-sm);
}

.ui-overview-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.ui-overview-body {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.ui-overview-stat {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
}

.ui-overview-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(62, 130, 188, 0.16);
}

.ui-overview-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
}

.ui-overview-label {
  font-size: 0.8rem;
  color: var(--ui-color-muted);
}

.ui-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ui-search-input-sm {
  width: min(280px, 100%);
}

.ui-actionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
}

.ui-section-divider {
  border-top: 1px solid #d8e6f5;
  margin: 1rem 0;
}

.ui-card-clickable {
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.ui-card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--ui-shadow-md) !important;
  border-color: #b9d7ee;
}

.ui-empty-state {
  border: 1px dashed #c0d7ec;
  border-radius: var(--ui-radius-md);
  background: var(--ui-glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ui-empty-state-icon {
  font-size: 2.4rem;
  color: #75a0c5;
}

.ui-empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.ui-empty-state-subtitle {
  color: var(--ui-color-muted);
  max-width: 560px;
  margin: 0 auto 0.8rem;
}

footer.ui-footer {
  background-image: linear-gradient(120deg, #f8fcff, #e8f7ff 52%, #dff5ff);
  color: #315268;
  padding: 0.45rem 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--ui-glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

footer.ui-footer p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
}

footer.ui-footer a {
  color: #075985 !important;
}

footer.ui-footer a:hover {
  color: #0b6fa8 !important;
}

@media (max-width: 768px) {
  footer.ui-footer {
    padding: 0.32rem 0;
    margin-top: 1rem;
  }
  footer.ui-footer p {
    font-size: 0.76rem;
  }
}

@media (max-width: 575.98px) {
  .ui-toast-container {
    max-width: calc(100vw - 1rem);
    left: 0.5rem;
    right: 0.5rem !important;
  }

  .ui-toast-container .toast {
    width: 100%;
  }
}

.btn-primary {
  background-image: linear-gradient(135deg, #20a8e0, #0b82c4);
  border: 1px solid rgba(7, 89, 133, 0.08);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.22);
}

.btn-primary:hover {
  background-image: linear-gradient(135deg, #1697d2, #0873ad);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(14, 165, 233, 0.3);
}

.btn-success {
  background-image: linear-gradient(135deg, #17a67b, #0f8a66);
  border: none;
}

.btn-success:hover {
  background-image: linear-gradient(135deg, #0f916b, #0d7c5b);
}

.btn-outline-primary {
  color: #0b6fa8;
  border-color: #a7d9f4;
  background: rgba(255, 255, 255, 0.84);
}

.btn-outline-primary:hover {
  color: #075985;
  border-color: #67c8f2;
  background: #e8f7ff;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.16);
}

.btn-outline-secondary {
  color: #4b6681;
  border-color: #c1d6ea;
  background: rgba(255, 255, 255, 0.58);
}

.btn-outline-secondary:hover {
  color: #304d68;
  border-color: #a9c6df;
  background: rgba(239, 247, 255, 0.88);
}

.btn-light {
  color: #1a4f77;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(179, 207, 230, 0.72);
}

.btn-light:hover {
  color: #0f4f7e;
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(155, 194, 223, 0.86);
  box-shadow: var(--ui-glass-shadow-soft);
}

.card {
  border-radius: var(--ui-radius-md);
  border: 1px solid var(--ui-color-border);
  box-shadow: var(--ui-shadow-sm);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(238, 248, 255, 0.62));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  border-color: #bdd9ee;
  box-shadow: var(--ui-shadow-md);
}

.form-control,
.form-select,
textarea {
  border-radius: 11px;
  border-color: #c5dcee;
  background: rgba(255, 255, 255, 0.86);
  color: #133753;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:hover,
.form-select:hover,
textarea:hover {
  border-color: #aecde7;
  background: rgba(255, 255, 255, 0.94);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: #7fb8e0;
  background: #fff;
  box-shadow: 0 0 0 0.2rem rgba(58, 160, 222, 0.2);
}

.form-control::placeholder,
textarea::placeholder {
  color: #6b85a0;
}

.input-group-text {
  border-color: #c5dcee;
  background: linear-gradient(145deg, rgba(244, 250, 255, 0.96), rgba(232, 245, 255, 0.8));
  color: #42607a;
}

.form-check-input {
  border-color: #aacce6;
}

.form-check-input:checked {
  background-color: #167bc6;
  border-color: #167bc6;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(22, 123, 198, 0.2);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(230, 243, 255, 0.44);
  --bs-table-hover-bg: rgba(220, 237, 252, 0.64);
  border-color: #d3e4f3;
}

.table > :not(caption) > * > * {
  background-color: rgba(255, 255, 255, 0.82);
  border-bottom-color: #d9e7f4;
}

.table thead th {
  color: #325572;
  font-weight: 650;
  background: linear-gradient(145deg, rgba(243, 250, 255, 0.96), rgba(230, 244, 255, 0.85));
  border-bottom-width: 1px;
}

.alert {
  border-radius: 12px;
  border: 1px solid #d1e3f4;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.alert-info {
  color: #0d567b;
  background: rgba(219, 241, 255, 0.78);
  border-color: #acd5ef;
}

.alert-success {
  color: #0f6a50;
  background: rgba(215, 245, 233, 0.84);
  border-color: #9fdcbe;
}

.alert-warning {
  color: #8b4f15;
  background: rgba(255, 240, 213, 0.86);
  border-color: #f1ce89;
}

.alert-danger {
  color: #9b2432;
  background: rgba(255, 229, 234, 0.86);
  border-color: #f2b6bf;
}

/* ==========================================================================
   UNIFIED PROFESSIONAL BADGE DESIGN SYSTEM
   ========================================================================== */

.badge,
.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.015em;
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.badge i,
.app-badge i {
  font-size: 0.85em;
  line-height: 1;
}

/* Badge Sizes */
.badge-xs,
.app-badge-xs {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  gap: 0.25rem;
}

.badge-sm,
.app-badge-sm {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  gap: 0.3rem;
}

.badge-lg,
.app-badge-lg {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  gap: 0.45rem;
}

/* Automatic Upgrade & Shared Classes for Palette */
.badge.bg-primary,
.badge.text-bg-primary,
.app-badge-primary,
.app-badge-blue {
  background: #e6f4fb !important;
  color: #075985 !important;
  border-color: #b8d6e8 !important;
}

.badge.bg-success,
.badge.text-bg-success,
.app-badge-success,
.app-badge-emerald,
.app-badge-green {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-color: #a7f3d0 !important;
}

.badge.bg-warning,
.badge.text-bg-warning,
.app-badge-warning,
.app-badge-amber,
.app-badge-orange {
  background: #fffbeb !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}

.badge.bg-danger,
.badge.text-bg-danger,
.app-badge-danger,
.app-badge-rose,
.app-badge-red {
  background: #fff1f2 !important;
  color: #be123c !important;
  border-color: #fecdd3 !important;
}

.badge.bg-info,
.badge.text-bg-info,
.app-badge-info,
.app-badge-cyan,
.app-badge-sky {
  background: #f0f9ff !important;
  color: #0284c7 !important;
  border-color: #bae6fd !important;
}

.badge.bg-secondary,
.badge.text-bg-secondary,
.app-badge-secondary,
.app-badge-slate,
.app-badge-gray {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

.badge.bg-dark,
.badge.text-bg-dark,
.app-badge-dark {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

.badge.bg-light,
.badge.text-bg-light,
.app-badge-light,
.app-badge-tag,
.app-badge-skill {
  background: #f8fafc !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}

.badge.bg-light:hover,
.app-badge-tag:hover,
.app-badge-skill:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

/* Specific Tonal Badges */
.app-badge-purple,
.app-badge-violet {
  background: #faf5ff !important;
  color: #6b21a8 !important;
  border-color: #e9d5ff !important;
}

.app-badge-pink {
  background: #fdf2f8 !important;
  color: #9d174d !important;
  border-color: #fbcfe8 !important;
}

.app-badge-teal {
  background: #f0fdfa !important;
  color: #0f766e !important;
  border-color: #99f6e4 !important;
}

.app-badge-indigo {
  background: #eef2ff !important;
  color: #4338ca !important;
  border-color: #c7d2fe !important;
}

/* Status Badges */
.app-badge-status-draft {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.app-badge-status-confirmed {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}

.app-badge-status-in-progress,
.app-badge-status-in_progress {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

.app-badge-status-done {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

.app-badge-status-cancelled,
.app-badge-status-canceled {
  background: #fff1f2 !important;
  color: #be123c !important;
  border: 1px solid #fecdd3 !important;
}

/* Pulsing / Status Dot Indicator */
.app-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

/* ==========================================================================
   PREMIUM FULLCALENDAR MODERN DESIGN SYSTEM
   ========================================================================== */

.app-calendar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
}

@media (max-width: 767.98px) {
  .app-calendar-card {
    padding: 1rem 0.75rem;
    border-radius: 14px;
  }
}

/* Toolbar & Header */
.fc .fc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem !important;
  flex-wrap: wrap;
}

.fc .fc-toolbar-title {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.025em !important;
  text-transform: capitalize !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation Controls (< > Today) */
.fc .fc-prev-button,
.fc .fc-next-button {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
  transition: all 0.15s ease !important;
}

.fc .fc-prev-button:hover,
.fc .fc-next-button:hover {
  background: #f8fafc !important;
  color: #0284c7 !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08) !important;
}

.fc .fc-today-button {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.95rem !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
  transition: all 0.15s ease !important;
}

.fc .fc-today-button:hover {
  background: #f8fafc !important;
  color: #0284c7 !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
}

.fc .fc-today-button:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* View Switcher Button Group (Month / Week / List) */
.fc .fc-button-group {
  background: #f1f5f9;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  gap: 2px;
}

.fc .fc-button-group .fc-button {
  background: transparent !important;
  color: #64748b !important;
  border: none !important;
  border-radius: 9px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  padding: 0.35rem 0.85rem !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
}

.fc .fc-button-group .fc-button:hover {
  background: rgba(255, 255, 255, 0.6) !important;
  color: #0f172a !important;
}

.fc .fc-button-group .fc-button.fc-button-active {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1) !important;
}

/* Table Headers */
.fc-theme-standard th {
  border-color: #f1f5f9 !important;
}

.fc .fc-col-header-cell {
  background: #f8fafc;
  padding: 10px 0;
  border-bottom: 1.5px solid #e2e8f0 !important;
}

.fc .fc-col-header-cell-cushion {
  text-decoration: none !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #475569 !important;
  display: inline-block;
  padding: 2px 4px !important;
}

/* Universal FullCalendar Typography & Link Cleanups (NO underlines, NO default link blue) */
.fc a,
.fc a:hover,
.fc a:focus,
.fc a:active,
.fc-theme-standard a {
  text-decoration: none !important;
  color: inherit !important;
}

.fc .fc-col-header-cell-cushion,
.fc .fc-col-header-cell a,
.fc th a {
  color: #475569 !important;
  text-decoration: none !important;
}

.fc .fc-daygrid-day-number,
.fc .fc-daygrid-day-top a {
  color: #475569 !important;
  text-decoration: none !important;
}

/* Table Cells & Grid */
.fc-theme-standard td {
  border-color: #f1f5f9 !important;
}

.fc-theme-standard .fc-scrollgrid {
  border-color: #e2e8f0 !important;
  border-radius: 14px;
  overflow: hidden;
}

.fc .fc-daygrid-day {
  transition: background-color 0.12s ease;
}

.fc .fc-daygrid-day:hover {
  background-color: #fafbfc;
}

/* Day Numbers */
.fc .fc-daygrid-day-top {
  flex-direction: row;
  justify-content: flex-end;
  padding: 4px 6px 2px;
}

.fc .fc-daygrid-day-number {
  text-decoration: none !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  padding: 3px 6px !important;
  border-radius: 6px;
  transition: all 0.12s ease;
}

.fc .fc-day-other .fc-daygrid-day-number {
  color: #cbd5e1 !important;
  opacity: 0.7;
}

/* Today Cell Highlight */
.fc .fc-day-today {
  background: rgba(239, 246, 255, 0.45) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  min-width: 24px;
  height: 24px;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
  padding: 0 !important;
}

/* Event Items inside Calendar */
.fc .fc-daygrid-event {
  border-radius: 7px !important;
  border: none !important;
  padding: 3px 8px !important;
  margin: 2px 4px !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.fc .fc-daygrid-event:hover {
  transform: translateY(-1.5px) scale(1.01) !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15) !important;
  z-index: 15 !important;
}

.fc .fc-event-main {
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc .fc-event-time {
  font-weight: 700 !important;
  font-size: 0.72rem !important;
  opacity: 0.9;
  flex-shrink: 0;
}

.fc .fc-event-title {
  font-weight: 600 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* List View Modern Styling */
.fc .fc-list {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0 !important;
}

.fc .fc-list-day-cushion {
  background: #f8fafc !important;
  padding: 10px 16px !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  color: #1e293b !important;
}

.fc .fc-list-day-cushion a,
.fc .fc-list-day-text,
.fc .fc-list-day-side-text,
.fc .fc-list-day a {
  color: #1e293b !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}

.fc .fc-list-day-side-text {
  color: #64748b !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.fc .fc-list-event {
  cursor: pointer !important;
  transition: background 0.15s ease !important;
}

.fc .fc-list-event:hover td {
  background: #f1f5f9 !important;
}

.fc .fc-list-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.fc .fc-list-event-title,
.fc .fc-list-event-title a,
.fc .fc-list-event a {
  color: #0f172a !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.fc .fc-list-event-time {
  color: #64748b !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
}

/* Popover for (+more events) */
.fc .fc-popover {
  border-radius: 14px !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16) !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.fc .fc-popover-header {
  background: #f8fafc !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  color: #0f172a !important;
  padding: 8px 14px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.fc .fc-more-link {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: #0284c7 !important;
  padding: 1px 6px !important;
  border-radius: 4px;
}

.fc .fc-more-link:hover {
  background: #f0f9ff !important;
  text-decoration: none !important;
}

/* Custom Floating Popover/Tooltip for Events */
.calendar-event-tooltip {
  position: absolute;
  z-index: 1060;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  pointer-events: none;
  min-width: 220px;
  max-width: 300px;
  display: none;
  font-size: 0.8rem;
  color: #334155;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.calendar-event-tooltip-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.3;
}

.calendar-event-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 3px;
}

/* Generic Background gradients for non-badge elements */
div.bg-primary:not([class*="bg-opacity"]),
section.bg-primary:not([class*="bg-opacity"]),
header.bg-primary:not([class*="bg-opacity"]) {
  background: linear-gradient(135deg, #20a8e0, #38bdf8) !important;
}

div.bg-secondary:not([class*="bg-opacity"]),
section.bg-secondary:not([class*="bg-opacity"]) {
  background: linear-gradient(135deg, #67839f, #4f6b88) !important;
}

.dropdown-menu {
  border: 1px solid rgba(177, 207, 231, 0.78);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(31, 79, 116, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.5rem;
  min-width: 220px;
}

.dropdown-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 0.35rem 0.65rem 0.2rem;
}

.dropdown-item {
  color: #1e4b70;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 550;
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: #0c5f9f;
  background: #eaf4ff;
  transform: translateX(2px);
}

.dropdown-divider {
  border-top-color: rgba(207, 224, 242, 0.8);
  margin: 0.35rem 0;
}

.modal-content {
  border-radius: 16px;
  border: 1px solid rgba(178, 206, 231, 0.82);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(235, 246, 255, 0.88));
  box-shadow: var(--ui-shadow-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-header,
.modal-footer {
  border-color: #d7e7f5;
}

.pagination .page-link {
  color: #1e5a83;
  border-color: #c6dcef;
  background: rgba(255, 255, 255, 0.86);
}

.pagination .page-link:hover {
  color: #0f5f9f;
  border-color: #abd0ea;
  background: rgba(237, 247, 255, 0.96);
}

.pagination .page-item.active .page-link {
  color: #0c5f9f;
  border-color: #bddaf0;
  background: linear-gradient(180deg, #ffffff, #edf7ff);
  box-shadow: 0 6px 14px rgba(56, 111, 161, 0.16);
}

.ui-glass-panel {
  background: var(--ui-glass-bg);
  border: 1px solid var(--ui-glass-border);
  box-shadow: var(--ui-glass-shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.htmx-indicator {
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.htmx-request .htmx-indicator,
.htmx-indicator.htmx-request {
  display: inline-block;
  opacity: 1;
}

/* Tự động chặn double submit và đổi con trỏ khi form HTMX đang gửi */
.htmx-request button[type="submit"],
.htmx-request input[type="submit"],
button.htmx-request,
input[type="submit"].htmx-request {
  pointer-events: none !important;
  opacity: 0.82 !important;
  cursor: wait !important;
}

.ui-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 360px;
}

.ui-toast {
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(58, 111, 161, 0.22);
  border: 1px solid rgba(193, 217, 239, 0.92);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}

.ui-toast .toast-header {
  border-bottom: 1px solid rgba(173, 203, 228, 0.6);
  font-weight: 600;
}

.ui-toast.toast-success .toast-header {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.ui-toast.toast-success .toast-body {
  background: rgba(16, 185, 129, 0.08);
}

.ui-toast.toast-danger .toast-header {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.ui-toast.toast-danger .toast-body {
  background: rgba(239, 68, 68, 0.08);
}

.ui-toast.toast-warning .toast-header {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.ui-toast.toast-warning .toast-body {
  background: rgba(245, 158, 11, 0.08);
}

.ui-toast.toast-info .toast-header {
  background: rgba(33, 158, 188, 0.2);
  color: #0c4a6e;
}

.ui-toast.toast-info .toast-body {
  background: rgba(33, 158, 188, 0.08);
}

@media (max-width: 991px) {
  .ui-page-header {
    flex-direction: column;
  }

  .ui-page-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .ui-overview-body {
    gap: 0.85rem 1.1rem;
  }

  .ui-search-input-sm {
    width: 100%;
  }
}

/* -------------------------------------------------------------------------- */
/* HTMX & Page Navigation Global Top Progress Bar                            */
/* -------------------------------------------------------------------------- */
.htmx-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #818cf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7), 0 0 5px rgba(2, 132, 199, 0.5);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.htmx-progress-bar.htmx-active {
  opacity: 1;
  width: 75%;
  transition: width 8s cubic-bezier(0.08, 0.82, 0.17, 1);
}

.htmx-progress-bar.htmx-done {
  width: 100% !important;
  opacity: 0 !important;
  transition: width 0.15s ease, opacity 0.3s ease 0.15s !important;
}

/* -------------------------------------------------------------------------- */
/* Global Page Loading & Transition Overlay                                   */
/* -------------------------------------------------------------------------- */
.page-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.page-loading-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 36px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(15, 42, 68, 0.12), 0 0 0 1px rgba(226, 232, 240, 0.8);
  transform: scale(0.95);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-loading-overlay.active .page-loading-content {
  transform: scale(1);
}

.page-loading-spinner-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-loading-spinner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(2, 132, 199, 0.12);
  border-top-color: #0284c7;
  border-right-color: #38bdf8;
  animation: pageSpinnerRotate 0.85s linear infinite;
}

.page-loading-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  animation: pageLogoPulse 1.8s ease-in-out infinite alternate;
}

.page-loading-text {
  font-size: 0.925rem;
  font-weight: 600;
  color: #0f2a44;
  letter-spacing: -0.01em;
  animation: pageTextPulse 1.8s ease-in-out infinite alternate;
}

@keyframes pageSpinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pageLogoPulse {
  0% { transform: scale(0.92); opacity: 0.85; }
  100% { transform: scale(1.06); opacity: 1; filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.45)); }
}

@keyframes pageTextPulse {
  0% { opacity: 0.75; }
  100% { opacity: 1; }
}

/* -------------------------------------------------------------------------- */
/* HTMX Modal & Offcanvas Styling                                             */
/* -------------------------------------------------------------------------- */
.ui-htmx-modal .modal-dialog {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
  max-height: calc(100vh - 3.5rem);
}

.ui-htmx-modal .modal-content {
  border-radius: 16px;
  border: 1px solid rgba(193, 217, 239, 0.85);
  box-shadow: 0 20px 45px rgba(15, 42, 68, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: calc(100vh - 3.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ui-htmx-modal .modal-header {
  background: rgba(240, 248, 255, 0.7);
  border-bottom: 1px solid rgba(205, 226, 245, 0.75);
  padding: 1.15rem 1.4rem;
  flex-shrink: 0;
}

.ui-htmx-modal .modal-content > form,
.ui-htmx-modal form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ui-htmx-modal .modal-body,
.modal-dialog-scrollable .modal-body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 13.5rem);
}

.ui-htmx-modal .modal-footer {
  background: rgba(247, 251, 255, 0.7);
  border-top: 1px solid rgba(205, 226, 245, 0.75);
  padding: 1rem 1.4rem;
  flex-shrink: 0;
}

/* Custom scrollbar for modal body */
.ui-htmx-modal .modal-body::-webkit-scrollbar {
  width: 6px;
}

.ui-htmx-modal .modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.ui-htmx-modal .modal-body::-webkit-scrollbar-thumb {
  background: rgba(12, 95, 159, 0.25);
  border-radius: 4px;
}

.ui-htmx-modal .modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 95, 159, 0.5);
}

/* uiConfirmModal can open while another modal (e.g. #htmxModal) is already shown, so it
   needs to stack above it instead of relying on DOM order (both default to the same
   Bootstrap z-index). The "+" backdrop selector targets the second backdrop Bootstrap
   appends when nesting modals, so it also stacks above the first modal's content. */
#uiConfirmModal {
  z-index: 1075;
}

.modal-backdrop + .modal-backdrop {
  z-index: 1070;
}

.ui-htmx-offcanvas {
  border-left: 1px solid rgba(193, 217, 239, 0.85);
  box-shadow: -10px 0 35px rgba(15, 42, 68, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.96);
}

.ui-htmx-offcanvas .offcanvas-header {
  background: rgba(240, 248, 255, 0.7);
  border-bottom: 1px solid rgba(205, 226, 245, 0.75);
}

/* -------------------------------------------------------------------------- */
/* HTMX Animation & Transition Utilities                                      */
/* -------------------------------------------------------------------------- */
.htmx-swapping {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.htmx-settling {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.25s ease-in, transform 0.25s ease-in;
}

.htmx-fade-in {
  animation: htmxFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes htmxFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-out-remove {
  opacity: 0 !important;
  transform: scale(0.95) !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  overflow: hidden !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* -------------------------------------------------------------------------- */
/* Skeleton Shimmer Loading Placeholder                                       */
/* -------------------------------------------------------------------------- */
.ui-skeleton {
  background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
  background-size: 200% 100%;
  animation: uiSkeletonShimmer 1.5s infinite;
  border-radius: 6px;
  display: inline-block;
}

.ui-skeleton-text {
  height: 1rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

.ui-skeleton-rect {
  width: 100%;
  height: 120px;
}

.ui-skeleton-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

@keyframes uiSkeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========================================================================== */
/* APP SHELL & COLLAPSIBLE LEFT SIDEBAR LAYOUT                                */
/* ========================================================================== */

:root {
  --app-sidebar-width: 252px;
  --app-sidebar-collapsed-width: 70px;
  --app-topbar-height: 58px;
  --app-sidebar-bg: rgba(255, 255, 255, 0.96);
  --app-sidebar-border: #e0ecf8;
  --app-sidebar-link-color: #334e68;
  --app-sidebar-link-hover-bg: rgba(22, 123, 199, 0.08);
  --app-sidebar-link-active-bg: rgba(22, 123, 199, 0.12);
  --app-sidebar-link-active-color: #167bc7;
}

body.app-workspace-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% -4%, rgba(216, 237, 255, 0.42) 0%, rgba(216, 237, 255, 0) 45%),
    radial-gradient(circle at 86% -2%, rgba(225, 243, 255, 0.38) 0%, rgba(225, 243, 255, 0) 40%),
    linear-gradient(180deg, #fbfdff 0%, #f3f6fa 48%, #f8fafc 100%);
  overflow-x: hidden;
}

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Sidebar Shell */
.app-sidebar {
  width: var(--app-sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  background: var(--app-sidebar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--app-sidebar-border);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 16px rgba(18, 62, 102, 0.05);
  transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1), transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Header */
.app-sidebar-header {
  height: var(--app-topbar-height);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(207, 224, 242, 0.7);
  flex-shrink: 0;
}

.app-sidebar-brand {
  min-width: 0;
}

.app-sidebar-brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.app-sidebar-brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: #14486f;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-sidebar-collapse-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #d4e4f5;
  color: #486581;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding: 0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.app-sidebar-collapse-toggle:hover {
  background: #f0f7ff;
  color: #167bc7;
  border-color: #bcd7f0;
}

/* Sidebar Quick Action */
.app-sidebar-action-wrap {
  padding: 0.75rem 0.85rem 0.5rem 0.85rem;
  flex-shrink: 0;
}

.app-sidebar-create-btn {
  width: 100%;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.48rem 0.75rem;
  background: linear-gradient(135deg, #167bc7, #2ba5e0);
  border: none;
  box-shadow: 0 4px 12px rgba(22, 123, 199, 0.25);
  transition: all 0.2s ease;
}

.app-sidebar-create-btn:hover {
  background: linear-gradient(135deg, #136eb3, #2296cf);
  box-shadow: 0 6px 16px rgba(22, 123, 199, 0.35);
  transform: translateY(-1px);
}

.app-sidebar-create-icon {
  font-size: 0.95rem;
}

/* Sidebar Scrollable Body */
.app-sidebar-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.4rem 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: #d0e1f3 transparent;
}

.app-sidebar-body::-webkit-scrollbar {
  width: 5px;
}

.app-sidebar-body::-webkit-scrollbar-thumb {
  background: #d0e1f3;
  border-radius: 4px;
}

.app-sidebar-section {
  margin-bottom: 0.85rem;
}

.app-sidebar-section-header {
  font-size: 0.68rem;
  font-weight: 700;
  color: #829ab1;
  letter-spacing: 0.8px;
  padding: 0.45rem 0.55rem 0.25rem 0.55rem;
  text-transform: uppercase;
  user-select: none;
}

/* Sidebar Navigation Link */
.app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.46rem 0.65rem;
  border-radius: 9px;
  color: var(--app-sidebar-link-color);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.16s ease;
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}

.app-sidebar-icon {
  font-size: 1.05rem;
  width: 22px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  color: #486581;
  transition: transform 0.18s ease, filter 0.18s ease, color 0.18s ease;
}

/* Sidebar Icon Color Palette */
.sidebar-icon-blue { color: #2563eb !important; }
.sidebar-icon-sky { color: #0284c7 !important; }
.sidebar-icon-cyan { color: #0891b2 !important; }
.sidebar-icon-teal { color: #0d9488 !important; }
.sidebar-icon-emerald { color: #059669 !important; }
.sidebar-icon-green { color: #16a34a !important; }
.sidebar-icon-amber { color: #d97706 !important; }
.sidebar-icon-orange { color: #ea580c !important; }
.sidebar-icon-gold { color: #ca8a04 !important; }
.sidebar-icon-rose { color: #e11d48 !important; }
.sidebar-icon-pink { color: #db2777 !important; }
.sidebar-icon-fuchsia { color: #c026d3 !important; }
.sidebar-icon-purple { color: #7c3aed !important; }
.sidebar-icon-indigo { color: #4f46e5 !important; }
.sidebar-icon-violet { color: #8b5cf6 !important; }
.sidebar-icon-crimson { color: #dc2626 !important; }
.sidebar-icon-slate { color: #64748b !important; }
.sidebar-icon-dark { color: #334155 !important; }

.app-sidebar-link:hover {
  background: var(--app-sidebar-link-hover-bg);
  color: #167bc7;
}

.app-sidebar-link:hover .app-sidebar-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.14));
}

.app-sidebar-link.active {
  background: var(--app-sidebar-link-active-bg);
  color: var(--app-sidebar-link-active-color);
  font-weight: 650;
}

.app-sidebar-link.active .app-sidebar-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 1px 3px rgba(22, 123, 199, 0.2));
}

.app-sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3.5px;
  background: #167bc7;
  border-radius: 0 4px 4px 0;
}

/* Sidebar User Footer */
.app-sidebar-footer {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--app-sidebar-border);
  background: rgba(250, 253, 255, 0.88);
  flex-shrink: 0;
}

.app-sidebar-user-card {
  padding: 0.25rem 0.15rem;
}

.app-sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #167bc7, #38bdf8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 2px 8px rgba(22, 123, 199, 0.28);
}

.app-sidebar-user-name {
  font-size: 0.86rem;
  color: #103a5d;
  line-height: 1.25;
}

.app-sidebar-user-sub {
  font-size: 0.72rem;
  line-height: 1.2;
}

.app-sidebar-logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.app-sidebar-logout-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626 !important;
}

/* ── App Main Wrapper & Content Container ── */
.app-main-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--app-sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-topbar {
  height: var(--app-topbar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--app-sidebar-border);
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 4px 14px rgba(56, 111, 161, 0.04);
}

.app-topbar-mobile-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.app-topbar-title-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  background: color-mix(in srgb, currentColor 14%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.app-topbar-title-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: #103a5d;
  letter-spacing: -0.15px;
  line-height: 1.15;
}

.app-topbar-breadcrumb-sub {
  font-size: 0.72rem;
  color: #627d98;
  margin-top: 2px;
  line-height: 1;
}

.app-topbar-breadcrumb-sub span {
  white-space: nowrap;
}

.app-topbar-breadcrumb-sub a,
.app-topbar-breadcrumb-link {
  color: #627d98;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.app-topbar-breadcrumb-sub a:hover,
.app-topbar-breadcrumb-link:hover {
  color: #0284c7;
  text-decoration: underline !important;
}

.app-topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #d4e4f5;
  background: #ffffff;
  color: #334e68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #d4e4f5;
  background: #ffffff;
  color: #334e68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.app-topbar-icon-btn:hover {
  background: #f0f7ff;
  color: #167bc7;
  border-color: #bcd7f0;
}

.app-topbar-create-mobile-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #167bc7, #0284c7);
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(22, 123, 199, 0.28);
  transition: all 0.2s ease;
}

.app-topbar-create-mobile-btn:hover,
.app-topbar-create-mobile-btn:focus,
.app-topbar-create-mobile-btn:active {
  background: linear-gradient(135deg, #1167a8, #0369a1);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 123, 199, 0.35);
}

.app-topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #167bc7, #38bdf8);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.app-topbar-profile-btn {
  border: 1px solid #d4e4f5;
  background: #ffffff;
  transition: all 0.2s ease;
}

.app-topbar-profile-btn:hover {
  background: #f0f7ff;
  border-color: #bcd7f0;
}

.app-content-container {
  padding: 1.25rem 1.75rem;
  flex: 1 0 auto;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.app-footer {
  margin-top: auto;
  border-top: 1px solid rgba(207, 224, 242, 0.6);
  background: rgba(255, 255, 255, 0.5);
}

/* ========================================================================== */
/* COLLAPSED SIDEBAR MODE (Desktop)                                           */
/* ========================================================================== */

@media (min-width: 992px) {
  body.sidebar-collapsed .app-sidebar {
    width: var(--app-sidebar-collapsed-width);
  }

  body.sidebar-collapsed .app-sidebar-brand-text,
  body.sidebar-collapsed .app-sidebar-text,
  body.sidebar-collapsed .app-sidebar-section-header,
  body.sidebar-collapsed .app-sidebar-user-avatar,
  body.sidebar-collapsed .app-sidebar-user-info,
  body.sidebar-collapsed .app-sidebar-logout-form {
    display: none !important;
  }

  body.sidebar-collapsed .app-sidebar-header {
    justify-content: center;
    padding: 0 0.5rem;
  }

  body.sidebar-collapsed .app-topbar .app-sidebar-collapse-toggle {
    background: #e8f3fc;
    color: #167bc7;
    border-color: #bcd7f0;
  }

  body.sidebar-collapsed .app-sidebar-brand {
    display: flex;
    justify-content: center;
  }

  body.sidebar-collapsed .app-sidebar-action-wrap {
    padding: 0.75rem 0.4rem;
    text-align: center;
  }

  body.sidebar-collapsed .app-sidebar-create-btn {
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin: 0 auto;
  }

  body.sidebar-collapsed .app-sidebar-create-icon {
    font-size: 1.1rem;
    line-height: 1;
    margin: 0 !important;
  }

  body.sidebar-collapsed .app-sidebar-body {
    padding: 0.4rem 0.35rem;
  }

  body.sidebar-collapsed .app-sidebar-link {
    justify-content: center;
    padding: 0.55rem 0;
    margin-bottom: 4px;
    border-radius: 10px;
  }

  body.sidebar-collapsed .app-sidebar-icon {
    font-size: 1.15rem;
    width: auto;
    margin: 0;
  }

  body.sidebar-collapsed .app-sidebar-link.active::before {
    top: 15%;
    bottom: 15%;
    width: 3px;
  }

  body.sidebar-collapsed .app-sidebar-footer {
    padding: 0.65rem 0.35rem;
  }

  body.sidebar-collapsed .app-sidebar-user-card {
    justify-content: center;
  }

  body.sidebar-collapsed .app-main-wrapper {
    margin-left: var(--app-sidebar-collapsed-width);
  }
}

/* ========================================================================== */
/* MOBILE RESPONSIVE (Drawer Mode < 992px)                                    */
/* ========================================================================== */

@media (max-width: 991.98px) {
  .app-sidebar {
    width: 270px;
    transform: translateX(-100%);
    box-shadow: 4px 0 28px rgba(15, 43, 68, 0.22);
    z-index: 1060;
  }

  .app-sidebar.show-mobile {
    transform: translateX(0);
  }

  .app-main-wrapper {
    margin-left: 0 !important;
  }

  .app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 43, 68, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1055;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }

  .app-sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  .app-content-container {
    padding: 1rem 0.85rem;
  }

  .app-topbar-title-icon {
    display: none !important;
  }

  .app-sidebar-mobile-close {
    font-size: 0.85rem;
  }
}

/* ========================================================================== */
/* VIEW MODE TOGGLE (Grid / Table List Switcher)                              */
/* ========================================================================== */
.ui-view-toggle {
  background: #f1f5f9;
  padding: 3px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #cbd5e1;
}

.ui-view-toggle .btn {
  border: none !important;
  background: transparent;
  color: #475569;
  padding: 0.35rem 0.65rem;
  border-radius: 9px !important;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  transition: all 0.15s ease;
  font-weight: 600;
  line-height: 1.2;
}

.ui-view-toggle .btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.85);
  transform: none;
}

.ui-view-toggle .btn.active {
  background: #ffffff !important;
  color: #0284c7 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12) !important;
  font-weight: 700;
}

/* ========================================================================== */
/* MODERN STAT CARDS & METRICS SUMMARY                                        */
/* ========================================================================== */
.ui-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.ui-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.ui-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.ui-stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
}

/* ========================================================================== */
/* MODERN FILTER BAR                                                          */
/* ========================================================================== */
.ui-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ui-filter-card .form-control,
.ui-filter-card .form-select {
  border: 1px solid #cbd5e1;
  font-size: 0.88rem;
  border-radius: 10px;
  color: #0f172a;
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ui-filter-card .form-control:focus,
.ui-filter-card .form-select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background-color: #ffffff;
}

.ui-btn-filter {
  background-image: linear-gradient(135deg, #0f172a, #1e293b);
  border: none;
  color: #ffffff;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.ui-btn-filter:hover {
  background-image: linear-gradient(135deg, #1e293b, #334155);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

/* ========================================================================== */
/* RESOURCE CARDS (Models, Members, Equipment, Rooms, Locations, Concepts)    */
/* ========================================================================== */
.ui-resource-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.22s cubic-bezier(0.2, 0, 0, 1), border-color 0.22s ease;
  overflow: hidden;
}

.ui-resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -4px rgba(15, 43, 68, 0.12), 0 6px 12px -2px rgba(15, 43, 68, 0.06);
  border-color: #7dd3fc;
}

.card-cover-wrapper {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e0f2fe 0%, #f1f5f9 100%);
  cursor: pointer;
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.ui-resource-card:hover .card-cover-img {
  transform: scale(1.04);
}

.card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e2e8f0 100%);
  color: #64748b;
  transition: background 0.2s ease, transform 0.3s ease;
}

.ui-resource-card:hover .card-cover-placeholder {
  background: linear-gradient(135deg, #e0f2fe 0%, #cbd5e1 100%);
  color: #0284c7;
}

.card-badge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 2;
}

.card-badge-glass {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ui-measurements-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  margin: 0.65rem 0;
}

.ui-measurements-box .measurement-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 2px;
}

.ui-measurements-box .measurement-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.card-link-title {
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s ease;
}

.card-link-title:hover {
  color: #0284c7;
}

.btn-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #64748b;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  padding: 0;
  cursor: pointer;
}

.btn-icon-circle:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* ========================================================================== */
/* MODERN DATA TABLES (List Mode)                                             */
/* ========================================================================== */
.ui-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.ui-table-card .table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
}

.ui-table-card .table-light {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.ui-table-card .table-light th {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.ui-table-card tbody tr {
  transition: background-color 0.12s ease;
}

.ui-table-card tbody tr:hover {
  background-color: rgba(240, 249, 255, 0.75) !important;
}
