@import url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css");

@font-face {
  font-family: "AppLatin";
  src: local("Arial"), local("Arial MT"), local("Helvetica");
  unicode-range: U+0000-002F, U+003A-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand: #1e5a8a;
  --brand-dark: #0f4c75;
  --brand-soft: #e8f1f8;
  --accent: #2a9d8f;
  --accent-soft: #e8f6f4;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #263238;
  --text-muted: #607d8b;
  --success: #198754;
  --warning: #f59e0b;
  --danger: #dc3545;
  --draft: #6c757d;
  --published: #198754;
  --archived: #c2410c;
  --border: #e3e8ef;
  --shadow: 0 8px 24px rgba(15, 76, 117, 0.06);
  --radius: 10px;
  --sidebar-width: 248px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: "AppLatin", "Vazirmatn", "Vazir", Arial, sans-serif;
  font-feature-settings: "ss01";
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.7;
  font-size: 13.5px;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea,
.form-control, .form-select, .btn, .dropdown-menu, .nav-link {
  font-family: inherit;
}

a { text-decoration: none; }

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f4c75 0%, #163d5c 100%);
  color: #fff;
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  min-height: var(--header-height);
  max-height: var(--header-height);
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  box-sizing: border-box;
}

.brand-text {
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-subtitle {
  font-size: .72rem;
  opacity: .7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  padding: 16px 12px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.32) #163d5c;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: #163d5c;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.28);
  border-radius: 8px;
  border: 2px solid #163d5c;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.4);
}

.nav-label {
  font-size: .72rem;
  letter-spacing: .04em;
  opacity: .55;
  padding: 10px 12px 6px;
  text-transform: none;
}

.sidebar .nav-link {
  color: rgba(255,255,255,.82);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sidebar .nav-link i {
  width: 22px;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.sidebar .nav-link.active {
  background: rgba(42, 157, 143, .22);
}

.sidebar .submenu .nav-link {
  padding-right: 42px;
  font-size: .92rem;
}

.app-main {
  flex: 1;
  margin-right: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-right 0.2s ease;
}

.topbar {
  height: var(--header-height);
  min-height: var(--header-height);
  max-height: var(--header-height);
  box-sizing: border-box;
  background:
    radial-gradient(180px 90px at 8% 0%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(125deg, #0f4c75 0%, #1e5a8a 48%, #2a9d8f 100%);
  color: #fff;
  border-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 10px 28px rgba(15, 76, 117, .18);
  overflow: visible;
}

.topbar-start,
.topbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-copy {
  min-width: 0;
}

.topbar-page {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
}

.topbar-welcome {
  font-size: .86rem;
  color: rgba(255,255,255,.86);
}

.topbar-welcome strong {
  color: #fff;
  font-weight: 800;
}

.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-topbar {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-topbar:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
}

.btn-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  max-width: 280px;
}

.btn-user:hover,
.btn-user:focus,
.btn-user[aria-expanded="true"] {
  background: rgba(255,255,255,.22);
  color: #fff;
}

.user-hello {
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-caret {
  font-size: .75rem;
  opacity: .85;
  transition: transform .2s ease;
}

.btn-user[aria-expanded="true"] .user-caret {
  transform: rotate(180deg);
}

.user-menu {
  margin-top: 10px;
  min-width: 230px;
  padding: 8px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 76, 117, .18);
  z-index: 1080;
}

.user-menu-head {
  padding: 10px 12px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #eef2f6;
}

.user-menu .dropdown-item {
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 600;
}

.user-menu .dropdown-item:hover,
.user-menu .dropdown-item:focus {
  background: #eef6fb;
  color: #0f4c75;
}

.topbar .user-meta {
  color: rgba(255,255,255,.75);
}

.topbar .avatar {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.category-card-chart {
  padding: 12px 16px 16px;
  background: #fff;
}

.page-content {
  padding: 24px;
  flex: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--text-muted);
  margin: 4px 0 0;
  font-size: .92rem;
}

.dash-welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
  padding: 22px 24px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(180px 120px at 8% 0%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(125deg, #0f4c75 0%, #1e5a8a 48%, #2a9d8f 100%);
  box-shadow: 0 16px 36px rgba(15, 76, 117, .18);
}

.dash-welcome::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  left: -40px;
  bottom: -70px;
  background: rgba(255,255,255,.1);
  pointer-events: none;
}

.dash-welcome-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.dash-welcome-text {
  margin: 8px 0 0;
  font-size: 1rem;
  color: rgba(255,255,255,.86);
}

.dash-welcome-text strong {
  color: #fff;
  font-weight: 800;
}

.dash-welcome-aside {
  position: relative;
  z-index: 1;
  text-align: center;
}

.dash-welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}

.dash-welcome-date {
  font-size: .82rem;
  font-weight: 700;
  color: rgba(255,255,255,.82);
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  border: 1px solid #e6eef5;
  box-shadow: 0 8px 22px rgba(15, 76, 117, .06);
}

.section-toolbar-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.section-toolbar-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #0f4c75, #2a9d8f);
  box-shadow: 0 8px 16px rgba(15, 76, 117, .18);
  font-size: 1.15rem;
}

.section-heading {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #16384f;
  line-height: 1.4;
}

.section-lead {
  margin: 4px 0 0;
  color: #607d8b;
  font-size: .88rem;
}

.btn-catalog {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: .88rem;
  color: #fff !important;
  background-image: linear-gradient(105deg, #0f4c75 0%, #1e5a8a 48%, #2a9d8f 100%);
  background-size: 180% 100%;
  background-position: 100% 50%;
  box-shadow: 0 10px 20px rgba(15, 76, 117, .18);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .22s ease, box-shadow .22s ease, background-position .4s ease, filter .22s ease;
}

.btn-catalog::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 15%, rgba(255,255,255,.38) 50%, transparent 78%);
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .55s ease, opacity .25s ease;
}

.btn-catalog:hover,
.btn-catalog:focus-visible {
  color: #fff !important;
  background-position: 0 50%;
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.06);
  box-shadow: 0 16px 28px rgba(42, 157, 143, .28);
  border-color: rgba(255,255,255,.2);
}

.btn-catalog:hover::after,
.btn-catalog:focus-visible::after {
  opacity: 1;
  transform: translateX(-100%);
}

.btn-catalog:hover .bi-arrow-left {
  transform: translateX(-4px);
}

.btn-catalog .bi-arrow-left {
  transition: transform .22s ease;
}

.btn-catalog > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .dash-welcome,
  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-catalog {
    justify-content: center;
  }
}

.card-soft {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-case {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}

.card-case:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 76, 117, 0.10);
}

.dash-title {
  font-size: .95rem;
  font-weight: 700;
  color: #1e3348;
  margin: 0;
  line-height: 1.4;
}

.dash-title::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  border-radius: 99px;
  margin-top: 8px;
  background: var(--brand);
}

.dash-title.tone-blue::after { background: linear-gradient(90deg, #1e5a8a, #7eb6d9); }
.dash-title.tone-green::after { background: linear-gradient(90deg, #198754, #8ed4b0); }
.dash-title.tone-amber::after { background: linear-gradient(90deg, #d97706, #f5c36b); }
.dash-title.tone-teal::after { background: linear-gradient(90deg, #0f766e, #5ec8bc); }
.dash-title.tone-brand::after { background: linear-gradient(90deg, #1e5a8a, #2a9d8f); }

.panel-head {
  margin-bottom: 16px;
}

.panel-head .dash-title {
  font-size: 1rem;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 156px;
  height: 100%;
  padding: 22px 22px 18px;
  border-radius: 22px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 36px rgba(15, 76, 117, .18);
  cursor: default;
  transition: transform .28s ease, box-shadow .28s ease, filter .28s ease, border-color .28s ease;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.28) 48%, transparent 70%);
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.kpi-card:hover {
  transform: translateY(-8px) scale(1.015);
  filter: saturate(1.08) brightness(1.06);
  border-color: rgba(255,255,255,.28);
}

.kpi-card:hover::after {
  opacity: 1;
  animation: kpi-shine .75s ease;
}

.kpi-blue:hover { box-shadow: 0 22px 48px rgba(30, 90, 138, .42); }
.kpi-green:hover { box-shadow: 0 22px 48px rgba(25, 135, 84, .4); }
.kpi-amber:hover { box-shadow: 0 22px 48px rgba(217, 119, 6, .4); }
.kpi-teal:hover { box-shadow: 0 22px 48px rgba(15, 118, 110, .42); }

@keyframes kpi-shine {
  from { transform: translateX(110%); opacity: .15; }
  to { transform: translateX(-110%); opacity: 0; }
}

.kpi-blue {
  background:
    radial-gradient(120px 80px at 12% 18%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(155deg, #0b3a5c 0%, #1e5a8a 52%, #2b7cb8 100%);
}

.kpi-green {
  background:
    radial-gradient(120px 80px at 12% 18%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(155deg, #0f5132 0%, #198754 55%, #2fb344 100%);
}

.kpi-amber {
  background:
    radial-gradient(120px 80px at 12% 18%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(155deg, #9a3412 0%, #d97706 52%, #f59e0b 100%);
}

.kpi-teal {
  background:
    radial-gradient(120px 80px at 12% 18%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(155deg, #115e59 0%, #0f766e 48%, #2a9d8f 100%);
}

.kpi-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.kpi-orb-lg {
  width: 150px;
  height: 150px;
  left: -36px;
  bottom: -48px;
  background: rgba(255,255,255,.1);
}

.kpi-orb-sm {
  width: 72px;
  height: 72px;
  left: 52px;
  bottom: 18px;
  background: rgba(255,255,255,.08);
}

.kpi-orb-lg,
.kpi-orb-sm {
  transition: transform .45s ease, background .3s ease;
}

.kpi-card:hover .kpi-orb-lg {
  transform: translate(-10px, -8px) scale(1.12);
  background: rgba(255,255,255,.18);
}

.kpi-card:hover .kpi-orb-sm {
  transform: translate(8px, -6px) scale(1.18);
  background: rgba(255,255,255,.16);
}

.kpi-icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
  margin-bottom: 16px;
  transition: transform .28s ease, background .28s ease, box-shadow .28s ease;
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.1) rotate(-6deg);
  background: rgba(255,255,255,.26);
  box-shadow: 0 10px 20px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.3);
}

.kpi-number {
  position: relative;
  z-index: 1;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  margin: 8px 0 0;
  text-shadow: 0 8px 18px rgba(0,0,0,.18);
  font-variant-numeric: tabular-nums;
  transition: transform .28s ease, text-shadow .28s ease;
}

.kpi-card:hover .kpi-number {
  transform: translateY(-2px);
  text-shadow: 0 12px 24px rgba(0,0,0,.28);
}

.kpi-label {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(255,255,255,.82);
}

.kpi-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: rgba(255,255,255,.78);
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(255,255,255,.16);
  color: #fff;
}

.kpi-delta.up { background: rgba(34, 197, 94, .28); }
.kpi-delta.down { background: rgba(239, 68, 68, .32); }

.badge-status {
  border-radius: 999px;
  padding: .35rem .7rem;
  font-weight: 500;
}

.badge-draft { background: #eef1f4; color: var(--draft); }
.badge-published { background: #eaf7f0; color: var(--published); }
.badge-archived { background: #fff1e8; color: var(--archived); }
.badge-active { background: #eaf7f0; color: var(--success); }
.badge-inactive { background: #f4f4f5; color: #6b7280; }

.table-modern {
  margin: 0;
}

.table-modern thead th {
  background: #f3f7fb;
  color: #5b7285;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 14px 16px;
}

.table-modern td {
  vertical-align: middle;
  border-color: #eef3f7;
  padding: 14px 16px;
}

.table-modern tbody tr {
  transition: background .15s ease;
}

.table-modern tbody tr:hover {
  background: #f6fafc;
}

.filter-panel {
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(15, 76, 117, .06);
  padding: 18px;
  margin-bottom: 16px;
}

.filter-grid,
.filter-advanced {
  display: grid;
  grid-template-columns: 1.4fr .9fr auto;
  gap: 14px;
  align-items: end;
}

.filter-advanced {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #d7e3ee;
}

.filter-field-wide { grid-column: span 2; }

.filter-field .form-label {
  font-size: .82rem;
  color: #5b7285;
  margin-bottom: 6px;
}

.filter-panel .form-control,
.filter-panel .form-select {
  min-height: 46px;
  border-radius: 12px;
  border-color: #d7e1ea;
}

.filter-panel .form-control:focus,
.filter-panel .form-select:focus {
  border-color: #1e5a8a;
  box-shadow: 0 0 0 .2rem rgba(30, 90, 138, .12);
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #7b93a6;
}

.input-icon .form-control {
  padding-right: 38px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-filter-more {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid #d7e1ea;
  background: #f7fafc;
  color: #1e5a8a;
  font-weight: 700;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-filter-more:hover {
  background: #e8f1f8;
  color: #0f4c75;
}

.table-shell {
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(15, 76, 117, .06);
  overflow: hidden;
}

.code-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef5fa;
  color: #1e5a8a;
  font-weight: 700;
  font-size: .82rem;
}

.table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-table {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e3eaf1;
  background: #f7fafc;
  color: #1e5a8a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-table:hover {
  background: linear-gradient(135deg, #0f4c75, #2a9d8f);
  border-color: transparent;
  color: #fff;
}

.mobile-case-card {
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 8px 18px rgba(15, 76, 117, .05);
}

.pagination .page-link {
  border-radius: 10px;
  margin: 0 3px;
  border-color: #e3eaf1;
  color: #1e5a8a;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #0f4c75, #2a9d8f);
  border-color: transparent;
}

@media (max-width: 992px) {
  .filter-grid,
  .filter-advanced {
    grid-template-columns: 1fr;
  }
  .filter-field-wide { grid-column: auto; }
}

.form-label { font-weight: 500; }
.required::after { content: " *"; color: var(--danger); }

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.btn:disabled { opacity: .65; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 8px;
}

.footer-bar {
  padding: 16px 24px;
  color: var(--text-muted);
  font-size: .85rem;
  border-top: 1px solid var(--border);
  background: transparent;
}

html.login-page,
body.login-page {
  overflow: hidden;
  height: 100dvh;
  margin: 0;
}

.login-wrap {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  position: relative;
}

.login-clip-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.login-hero {
  position: relative;
  isolation: isolate;
  z-index: 1;
  color: #fff;
  margin-left: clamp(-2.5rem, -3.5vw, -3.75rem);
  padding: clamp(36px, 12vh, 96px) clamp(24px, 4vw, 48px) clamp(20px, 3vh, 36px);
  padding-left: clamp(36px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  overflow: hidden;
  clip-path: url(#loginHeroClip);
  -webkit-clip-path: url(#loginHeroClip);
  background:
    radial-gradient(ellipse 70% 55% at 18% 22%, rgba(56, 189, 168, .42) 0%, transparent 58%),
    radial-gradient(ellipse 55% 45% at 88% 78%, rgba(56, 132, 196, .45) 0%, transparent 55%),
    radial-gradient(circle at 55% 8%, rgba(255, 255, 255, .1) 0%, transparent 38%),
    linear-gradient(148deg, #082f49 0%, #0f4c75 28%, #1a5f8f 52%, #1e7a72 78%, #2a9d8f 100%);
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    conic-gradient(from 210deg at 62% 42%, rgba(255, 255, 255, .07), transparent 28%, rgba(42, 157, 143, .14) 52%, transparent 78%);
  pointer-events: none;
  z-index: 0;
}

.login-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, .1) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.login-hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
}

.login-hero-glow-a {
  width: min(280px, 40vw);
  height: min(280px, 40vw);
  top: 8%;
  right: 10%;
  background: rgba(45, 212, 191, .22);
}

.login-hero-glow-b {
  width: min(220px, 32vw);
  height: min(220px, 32vw);
  bottom: 12%;
  left: 14%;
  background: rgba(56, 132, 196, .28);
}

.login-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 1.8vh, 18px);
  width: min(100%, 560px);
  margin-top: 0;
}

.login-hero-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
  margin-inline: auto;
  flex-shrink: 0;
}

.login-hero-title {
  margin: 0 auto;
  font-size: clamp(1.35rem, 2.35vw, 1.85rem);
  font-weight: 800;
  line-height: 1.6;
  max-width: 22rem;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 12px rgba(8, 47, 73, .35);
}

.login-faculty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-inline: auto;
  margin-top: clamp(18px, 3.5vh, 36px);
}

.login-faculty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(2px);
  color: #fff;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-faculty-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
}

.login-faculty-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: .95rem;
  flex-shrink: 0;
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .22);
}

.login-faculty-card.accent-rose .login-faculty-icon { background: linear-gradient(135deg, rgba(157, 23, 77, .85), rgba(219, 39, 119, .85)); }
.login-faculty-card.accent-teal .login-faculty-icon { background: linear-gradient(135deg, rgba(15, 118, 110, .85), rgba(42, 157, 143, .85)); }
.login-faculty-card.accent-sky .login-faculty-icon { background: linear-gradient(135deg, rgba(3, 105, 161, .85), rgba(14, 165, 233, .85)); }

.login-faculty-name {
  margin: 0;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 8px rgba(8, 47, 73, .3);
}

.login-faculty-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-faculty-spec {
  margin: 1px 0 0;
  font-size: .72rem;
  color: rgba(255, 255, 255, .96);
  line-height: 1.4;
}

.login-faculty-meta {
  margin: 0;
  font-size: .66rem;
  color: rgba(255, 255, 255, .82);
  line-height: 1.35;
}

.login-faculty-mail {
  margin-top: 4px;
  font-size: .62rem;
  color: #dbeafe;
  text-decoration: none;
  word-break: break-all;
  line-height: 1.3;
}

.login-faculty-mail:hover {
  color: #fff;
  text-decoration: underline;
}

.login-faculty-link {
  margin-top: 2px;
  font-size: .62rem;
  color: #bfdbfe;
  text-decoration: none;
  line-height: 1.3;
}

.login-faculty-link:hover {
  color: #fff;
  text-decoration: underline;
}

.login-panel {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.5vh, 28px) clamp(16px, 3vw, 28px);
  background:
    radial-gradient(circle at 12% 20%, rgba(42, 157, 143, .08), transparent 42%),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
  overflow: hidden;
}

.login-card {
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid rgba(15, 76, 117, .12);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(15, 76, 117, .06),
    0 14px 36px rgba(15, 76, 117, .12);
  padding: clamp(20px, 2.8vh, 28px) clamp(18px, 2.5vw, 26px);
}

.login-card-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a5f;
}

.login-card-lead {
  margin: 0 0 14px;
  font-size: .82rem;
  color: var(--text-muted);
}

.login-form .form-label {
  font-size: .82rem;
  margin-bottom: 4px;
}

.login-form .form-check-label {
  font-size: .82rem;
}

.login-submit {
  padding-block: .55rem;
  font-size: .9rem;
}

.login-form .form-control {
  border-radius: 10px;
  min-height: 40px;
  font-size: .88rem;
  border-color: #d7e1ea;
  box-shadow: inset 0 1px 2px rgba(15, 76, 117, .04);
}

.login-form .form-control:focus {
  border-color: #1e5a8a;
  box-shadow: 0 0 0 .25rem rgba(30, 90, 138, .12);
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f4f8fb;
  border: 1px solid #d5e0ea;
  border-radius: 12px;
  padding: 4px;
}

.captcha-box img {
  display: block;
  border-radius: 8px;
}

.captcha-refresh {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
}

@media (max-width: 576px) {
  .captcha-row { grid-template-columns: 1fr; }
}

.case-form .form-label {
  font-weight: 700;
  color: #334e68;
  margin-bottom: 6px;
}

.case-form .form-control,
.case-form .form-select {
  border-radius: 12px;
  border-color: #d7e2ee;
  min-height: 46px;
  padding: 8px 14px;
  background: #fbfcfe;
}

.case-form textarea.form-control {
  min-height: 120px;
}

.case-form .form-control:focus,
.case-form .form-select:focus {
  border-color: #7eb0d4;
  box-shadow: 0 0 0 4px rgba(30, 90, 138, .12);
  background: #fff;
}

.case-panel {
  background: #fff;
  border: 1px solid #e4edf5;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(15, 76, 117, .05);
}

.case-hint {
  background: linear-gradient(90deg, #eef8f6, #f7fbfd);
  border: 1px solid #cdeae5;
  color: #0f5b52;
  border-radius: 12px;
  padding: 12px 14px;
}

.case-tabs {
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #e4edf5;
  border-radius: 16px;
}

.case-tabs .nav-link {
  color: var(--text-muted);
  border: 0;
  border-radius: 12px;
  white-space: nowrap;
  padding: 8px 14px;
  font-weight: 700;
}

.case-tabs .nav-link:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.case-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #2a7ab0);
  box-shadow: 0 8px 16px rgba(30, 90, 138, .22);
}

.stepper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #e4edf5;
  border-radius: 18px;
}

.stepper .step {
  flex: 1;
  min-width: 108px;
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  position: relative;
  background: transparent;
  border: 0;
  padding: 8px 4px;
  border-radius: 12px;
}

.stepper .step:hover {
  background: #f4f8fc;
  color: var(--brand);
}

.stepper .step .dot {
  width: 30px;
  height: 30px;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  background: #fff;
  font-weight: 800;
  font-feature-settings: "ss01";
}

.stepper .step.active { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
.stepper .step.active .dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.stepper .step.done { color: var(--accent); }
.stepper .step.done .dot { border-color: var(--accent); background: var(--accent); color: #fff; }

.case-form-actions {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e4edf5;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 76, 117, .08);
  backdrop-filter: blur(8px);
}

.case-form-actions-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.btn-case-cancel {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: .4rem 1rem;
  border-radius: 11px;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  color: #3d5a73;
  text-decoration: none;
  background: linear-gradient(180deg, #fff 0%, #f4f8fb 100%);
  border: 1px solid #c9dae8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 4px 12px rgba(15, 76, 117, .06);
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.btn-case-cancel .bi {
  font-size: .95rem;
  color: #0f4c75;
  transition: transform .2s ease, color .2s ease;
}

.btn-case-cancel:hover,
.btn-case-cancel:focus-visible {
  color: #0f4c75;
  border-color: #9fc0d8;
  background: linear-gradient(180deg, #fff 0%, #eaf4fa 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 8px 18px rgba(15, 76, 117, .12);
  transform: translateY(-1px);
}

.btn-case-cancel:hover .bi,
.btn-case-cancel:focus-visible .bi {
  color: #2a9d8f;
  transform: translateX(3px);
}

.btn-case-cancel:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 6px rgba(15, 76, 117, .08);
}

.case-form-actions .btn {
  min-height: 34px;
  padding: .35rem .9rem;
  font-size: .86rem;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 10px;
}

.callout {
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
}

.callout-edu { background: #eef8f6; color: #0f5b52; }
.callout-warn { background: #fff8eb; color: #8a5a00; }
.callout-final { background: #eef8f6; border: 1px solid #cdeae5; }

.dropzone {
  border: 2px dashed #b7cde0;
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  background: linear-gradient(180deg, #f7fbfe, #fff);
  cursor: pointer;
  display: grid;
  gap: 4px;
  color: var(--text-muted);
}

.dropzone i {
  font-size: 1.8rem;
  color: var(--brand);
}

.dropzone strong { color: var(--text); }

.dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.user-meta { color: var(--text-muted); font-size: .82rem; }

.card-case {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-case .card-body { flex: 1; }

.tag {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .78rem;
}

body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .app-main { margin-right: var(--sidebar-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .submenu { display: none !important; }
body.sidebar-collapsed .sidebar .nav-link { justify-content: center; }

.offcanvas-sidebar {
  background: linear-gradient(180deg, #0f4c75 0%, #163d5c 100%);
  color: #fff;
}

.offcanvas-sidebar .sidebar {
  display: flex !important;
  position: relative;
  width: 100%;
  inset: auto;
  height: auto;
}

@media (max-height: 760px) {
  .login-hero-inner { gap: 10px; }
  .login-hero-icon { width: 44px; height: 44px; font-size: 1.25rem; }
  .login-hero-title { font-size: 1.25rem; line-height: 1.5; }
  .login-faculty-card { padding: 8px 6px; }
  .login-card { padding: 18px 20px; }
  .login-card-lead { margin-bottom: 10px; }
}

@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .app-main { margin-right: 0; }
  html.login-page,
  body.login-page {
    overflow: auto;
    height: auto;
    min-height: 100dvh;
  }
  .login-wrap {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
  }
  .login-hero { display: none; }
  .page-header { flex-direction: column; }
}

.form-control:focus,
.form-select:focus {
  border-color: #7aa7c7;
  box-shadow: 0 0 0 .2rem rgba(30, 90, 138, .15);
}

.toast-stack {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reading-section {
  line-height: 2;
}

.reading-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.reading-section p {
  white-space: pre-line;
  margin-bottom: 0.85rem;
}

.meta-chip {
  background: #f3f6fa;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .82rem;
  color: var(--text-muted);
}

.category-card {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  border: 1px solid #e6eef5;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 76, 117, .08);
  overflow: hidden;
  position: relative;
}

.category-card-tile {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}

.dash-fold {
  display: block;
  margin: 0;
}

.dash-fold > summary {
  list-style: none;
}

.dash-fold > summary::-webkit-details-marker {
  display: none;
}

.category-card-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(15, 76, 117, .14);
}

.category-card-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

summary.category-card-banner {
  width: 100%;
  border: 0;
  text-align: inherit;
  font: inherit;
  cursor: pointer;
}

.collapse-caret {
  font-size: 1.15rem;
  opacity: .9;
  transition: transform .2s ease;
  flex-shrink: 0;
}

.dash-fold[open] .collapse-caret {
  transform: rotate(180deg);
}

.category-card-banner::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  left: -24px;
  bottom: -36px;
  background: rgba(255,255,255,.1);
  pointer-events: none;
}

.accent-rose .category-card-banner { background: linear-gradient(135deg, #9d174d, #db2777); }
.accent-teal .category-card-banner { background: linear-gradient(135deg, #0f766e, #2a9d8f); }
.accent-sky .category-card-banner { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.accent-amber .category-card-banner { background: linear-gradient(135deg, #b45309, #f59e0b); }
.accent-indigo .category-card-banner { background: linear-gradient(135deg, #4338ca, #6366f1); }
.accent-violet .category-card-banner { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.accent-red .category-card-banner { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.accent-green .category-card-banner { background: linear-gradient(135deg, #047857, #22c55e); }
.accent-blue .category-card-banner { background: linear-gradient(135deg, #0f4c75, #3b82c4); }

.category-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.category-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.45;
}

.category-count {
  text-align: center;
  min-width: 52px;
  position: relative;
  z-index: 1;
}

.category-count span {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  color: #fff;
  text-shadow: 0 6px 14px rgba(0,0,0,.18);
}

.category-count small {
  color: rgba(255,255,255,.8);
  font-size: .75rem;
}

.category-card-body {
  padding: 12px;
}

.category-card-body.is-scroll {
  max-height: 260px;
  overflow-y: auto;
}

.case-row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.case-row-list > li {
  display: block;
  min-width: 0;
}

.category-case-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  border-inline-start-width: 4px;
  color: inherit;
  min-width: 0;
  text-decoration: none;
}

.category-card-foot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55) 48%, transparent 72%);
  transform: translateX(85%);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.category-card-foot:hover::after {
  opacity: 1;
  animation: case-shine .7s ease;
}

@keyframes case-shine {
  from { transform: translateX(85%); opacity: .2; }
  to { transform: translateX(-85%); opacity: 0; }
}

.category-case-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  border: 0;
  font-size: 1.05rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
}

.category-case-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-case-title {
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.4;
  color: #1e3348;
  overflow-wrap: anywhere;
}

.category-case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-case-meta span {
  font-size: .72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
}

.category-case-arrow {
  font-size: .9rem;
  flex-shrink: 0;
}

.category-empty {
  color: var(--text-muted);
  font-size: .88rem;
  padding: 12px;
  text-align: center;
  background: rgba(255,255,255,.65);
  border-radius: 12px;
}

.category-card-foot {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 14px 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .88rem;
  border: 1px solid transparent;
  overflow: hidden;
  background-size: 220% 100%;
  background-position: 100% 50%;
  transition: transform .22s ease, box-shadow .22s ease, background .35s ease, background-position .45s ease, color .22s ease, border-color .22s ease;
}

.category-card-foot:hover {
  transform: translateY(-2px);
  background-position: 0 50%;
  color: #fff;
}

.accent-rose .category-card-body { background: linear-gradient(180deg, #fff5f8, #ffffff); }
.accent-rose .category-case-link { background: linear-gradient(105deg, #ffe4ef 0%, #fff7fa 48%, #ffffff 100%); border-color: #f8cfe0; border-inline-start-color: #db2777; }
.accent-rose .category-case-link:hover { background: linear-gradient(105deg, #fbcfe8, #fda4d4 42%, #fff1f7); border-color: #f9a8d4; box-shadow: 0 14px 28px rgba(190, 24, 93, .2); }
.accent-rose .category-case-icon { background: linear-gradient(135deg, #9d174d, #ec4899); }
.accent-rose .category-case-title, .accent-rose .category-case-arrow { color: #9d174d; }
.accent-rose .category-case-meta span { color: #be185d; background: rgba(255,255,255,.7); border: 1px solid #f5c2d6; }
.accent-rose .category-card-foot { color: #9d174d; background: linear-gradient(90deg, #ffe4ef, #fff1f6); border-color: #f8cfe0; }
.accent-rose .category-card-foot:hover { background: linear-gradient(105deg, #9d174d, #db2777 55%, #f472b6); border-color: #db2777; box-shadow: 0 12px 26px rgba(190, 24, 93, .24); }

.accent-teal .category-card-body { background: linear-gradient(180deg, #f3fbf9, #ffffff); }
.accent-teal .category-case-link { background: linear-gradient(105deg, #d9f4ef 0%, #f3fbf9 48%, #ffffff 100%); border-color: #bfe8e1; border-inline-start-color: #0f766e; }
.accent-teal .category-case-link:hover { background: linear-gradient(105deg, #99f6e4, #5eead4 42%, #f0fdfa); border-color: #5eead4; box-shadow: 0 14px 28px rgba(15, 118, 110, .2); }
.accent-teal .category-case-icon { background: linear-gradient(135deg, #0f766e, #2a9d8f); }
.accent-teal .category-case-title, .accent-teal .category-case-arrow { color: #0f766e; }
.accent-teal .category-case-meta span { color: #0f766e; background: rgba(255,255,255,.7); border: 1px solid #bfe8e1; }
.accent-teal .category-card-foot { color: #0f766e; background: linear-gradient(90deg, #d9f4ef, #f3fbf9); border-color: #bfe8e1; }
.accent-teal .category-card-foot:hover { background: linear-gradient(105deg, #0f766e, #14b8a6 55%, #2dd4bf); border-color: #0f766e; box-shadow: 0 12px 26px rgba(15, 118, 110, .24); }

.accent-sky .category-card-body { background: linear-gradient(180deg, #f0f9ff, #ffffff); }
.accent-sky .category-case-link { background: linear-gradient(105deg, #dbeafe 0%, #f0f9ff 48%, #ffffff 100%); border-color: #bfdbfe; border-inline-start-color: #0369a1; }
.accent-sky .category-case-link:hover { background: linear-gradient(105deg, #bae6fd, #7dd3fc 42%, #f0f9ff); border-color: #7dd3fc; box-shadow: 0 14px 28px rgba(3, 105, 161, .2); }
.accent-sky .category-case-icon { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.accent-sky .category-case-title, .accent-sky .category-case-arrow { color: #0369a1; }
.accent-sky .category-case-meta span { color: #0369a1; background: rgba(255,255,255,.7); border: 1px solid #bfdbfe; }
.accent-sky .category-card-foot { color: #0369a1; background: linear-gradient(90deg, #dbeafe, #f0f9ff); border-color: #bfdbfe; }
.accent-sky .category-card-foot:hover { background: linear-gradient(105deg, #0369a1, #0ea5e9 55%, #38bdf8); border-color: #0284c7; box-shadow: 0 12px 26px rgba(3, 105, 161, .24); }

.accent-amber .category-card-body { background: linear-gradient(180deg, #fff8eb, #ffffff); }
.accent-amber .category-case-link { background: linear-gradient(105deg, #fde68a 0%, #fff7ed 52%, #ffffff 100%); border-color: #fcd34d; border-inline-start-color: #d97706; }
.accent-amber .category-case-link:hover { background: linear-gradient(105deg, #fcd34d, #fbbf24 42%, #fffbeb); border-color: #f59e0b; box-shadow: 0 14px 28px rgba(180, 83, 9, .2); }
.accent-amber .category-case-icon { background: linear-gradient(135deg, #b45309, #f59e0b); }
.accent-amber .category-case-title, .accent-amber .category-case-arrow { color: #9a3412; }
.accent-amber .category-case-meta span { color: #b45309; background: rgba(255,255,255,.75); border: 1px solid #fcd34d; }
.accent-amber .category-card-foot { color: #9a3412; background: linear-gradient(90deg, #fde68a, #fff7ed); border-color: #fcd34d; }
.accent-amber .category-card-foot:hover { background: linear-gradient(105deg, #9a3412, #d97706 55%, #fbbf24); border-color: #d97706; box-shadow: 0 12px 26px rgba(180, 83, 9, .24); }

.accent-indigo .category-card-body { background: linear-gradient(180deg, #eef2ff, #ffffff); }
.accent-indigo .category-case-link { background: linear-gradient(105deg, #e0e7ff 0%, #eef2ff 48%, #ffffff 100%); border-color: #c7d2fe; border-inline-start-color: #4338ca; }
.accent-indigo .category-case-link:hover { background: linear-gradient(105deg, #c7d2fe, #a5b4fc 42%, #eef2ff); border-color: #818cf8; box-shadow: 0 14px 28px rgba(67, 56, 202, .2); }
.accent-indigo .category-case-icon { background: linear-gradient(135deg, #4338ca, #6366f1); }
.accent-indigo .category-case-title, .accent-indigo .category-case-arrow { color: #3730a3; }
.accent-indigo .category-case-meta span { color: #4338ca; background: rgba(255,255,255,.7); border: 1px solid #c7d2fe; }
.accent-indigo .category-card-foot { color: #3730a3; background: linear-gradient(90deg, #e0e7ff, #eef2ff); border-color: #c7d2fe; }
.accent-indigo .category-card-foot:hover { background: linear-gradient(105deg, #3730a3, #4f46e5 55%, #818cf8); border-color: #4f46e5; box-shadow: 0 12px 26px rgba(67, 56, 202, .24); }

.accent-violet .category-card-body { background: linear-gradient(180deg, #f5f3ff, #ffffff); }
.accent-violet .category-case-link { background: linear-gradient(105deg, #ede9fe 0%, #f5f3ff 48%, #ffffff 100%); border-color: #ddd6fe; border-inline-start-color: #6d28d9; }
.accent-violet .category-case-link:hover { background: linear-gradient(105deg, #ddd6fe, #c4b5fd 42%, #f5f3ff); border-color: #a78bfa; box-shadow: 0 14px 28px rgba(109, 40, 217, .2); }
.accent-violet .category-case-icon { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.accent-violet .category-case-title, .accent-violet .category-case-arrow { color: #5b21b6; }
.accent-violet .category-case-meta span { color: #6d28d9; background: rgba(255,255,255,.7); border: 1px solid #ddd6fe; }
.accent-violet .category-card-foot { color: #5b21b6; background: linear-gradient(90deg, #ede9fe, #f5f3ff); border-color: #ddd6fe; }
.accent-violet .category-card-foot:hover { background: linear-gradient(105deg, #5b21b6, #7c3aed 55%, #c4b5fd); border-color: #7c3aed; box-shadow: 0 12px 26px rgba(109, 40, 217, .24); }

.accent-red .category-card-body { background: linear-gradient(180deg, #fff5f5, #ffffff); }
.accent-red .category-case-link { background: linear-gradient(105deg, #fee2e2 0%, #fff5f5 48%, #ffffff 100%); border-color: #fecaca; border-inline-start-color: #b91c1c; }
.accent-red .category-case-link:hover { background: linear-gradient(105deg, #fecaca, #fca5a5 42%, #fef2f2); border-color: #f87171; box-shadow: 0 14px 28px rgba(185, 28, 28, .2); }
.accent-red .category-case-icon { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.accent-red .category-case-title, .accent-red .category-case-arrow { color: #991b1b; }
.accent-red .category-case-meta span { color: #b91c1c; background: rgba(255,255,255,.7); border: 1px solid #fecaca; }
.accent-red .category-card-foot { color: #991b1b; background: linear-gradient(90deg, #fee2e2, #fff5f5); border-color: #fecaca; }
.accent-red .category-card-foot:hover { background: linear-gradient(105deg, #991b1b, #dc2626 55%, #f87171); border-color: #dc2626; box-shadow: 0 12px 26px rgba(185, 28, 28, .24); }

.accent-green .category-card-body { background: linear-gradient(180deg, #f0fdf4, #ffffff); }
.accent-green .category-case-link { background: linear-gradient(105deg, #dcfce7 0%, #f0fdf4 48%, #ffffff 100%); border-color: #bbf7d0; border-inline-start-color: #047857; }
.accent-green .category-case-link:hover { background: linear-gradient(105deg, #bbf7d0, #86efac 42%, #f0fdf4); border-color: #4ade80; box-shadow: 0 14px 28px rgba(4, 120, 87, .2); }
.accent-green .category-case-icon { background: linear-gradient(135deg, #047857, #22c55e); }
.accent-green .category-case-title, .accent-green .category-case-arrow { color: #166534; }
.accent-green .category-case-meta span { color: #047857; background: rgba(255,255,255,.7); border: 1px solid #bbf7d0; }
.accent-green .category-card-foot { color: #166534; background: linear-gradient(90deg, #dcfce7, #f0fdf4); border-color: #bbf7d0; }
.accent-green .category-card-foot:hover { background: linear-gradient(105deg, #166534, #16a34a 55%, #4ade80); border-color: #16a34a; box-shadow: 0 12px 26px rgba(4, 120, 87, .24); }

.accent-blue .category-card-body { background: linear-gradient(180deg, #f3f8fc, #ffffff); }
.accent-blue .category-case-link { background: linear-gradient(105deg, #dbeafe 0%, #f3f8fc 48%, #ffffff 100%); border-color: #bfdbfe; border-inline-start-color: #0f4c75; }
.accent-blue .category-case-link:hover { background: linear-gradient(105deg, #bfdbfe, #93c5fd 42%, #eff6ff); border-color: #60a5fa; box-shadow: 0 14px 28px rgba(15, 76, 117, .2); }
.accent-blue .category-case-icon { background: linear-gradient(135deg, #0f4c75, #3b82c4); }
.accent-blue .category-case-title, .accent-blue .category-case-arrow { color: #0f4c75; }
.accent-blue .category-case-meta span { color: #1e5a8a; background: rgba(255,255,255,.7); border: 1px solid #bfdbfe; }
.accent-blue .category-card-foot { color: #0f4c75; background: linear-gradient(90deg, #dbeafe, #f3f8fc); border-color: #bfdbfe; }
.accent-blue .category-card-foot:hover { background: linear-gradient(105deg, #0f4c75, #1d4ed8 55%, #60a5fa); border-color: #1e5a8a; box-shadow: 0 12px 26px rgba(15, 76, 117, .24); }

.accent-slate .category-card-banner { background: linear-gradient(135deg, #334155, #64748b); }
.accent-slate .category-card-body { background: linear-gradient(180deg, #f8fafc, #ffffff); }
.accent-slate .category-case-link { background: linear-gradient(105deg, #e2e8f0 0%, #f8fafc 48%, #ffffff 100%); border-color: #cbd5e1; border-inline-start-color: #475569; }
.accent-slate .category-case-link:hover { background: linear-gradient(105deg, #cbd5e1, #94a3b8 42%, #f8fafc); border-color: #94a3b8; box-shadow: 0 14px 28px rgba(51, 65, 85, .2); }
.accent-slate .category-case-icon { background: linear-gradient(135deg, #334155, #64748b); }
.accent-slate .category-case-title, .accent-slate .category-case-arrow { color: #334155; }
.accent-slate .category-case-meta span { color: #475569; background: rgba(255,255,255,.75); border: 1px solid #cbd5e1; }
.accent-slate .category-card-foot { color: #334155; background: linear-gradient(90deg, #e2e8f0, #f8fafc); border-color: #cbd5e1; }
.accent-slate .category-card-foot:hover { background: linear-gradient(105deg, #334155, #475569 55%, #94a3b8); border-color: #475569; box-shadow: 0 12px 26px rgba(51, 65, 85, .24); }

/* Catalog — complements dashboard category-card tiles */
.catalog-filter-grid {
  grid-template-columns: 1.35fr .95fr .85fr auto;
}

.catalog-case-summary {
  margin: 10px 2px 0;
  font-size: .84rem;
  line-height: 1.8;
  color: #607d8b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.catalog-case-meta span {
  font-size: .76rem;
  font-weight: 600;
  color: #5b7285;
  background: rgba(255, 255, 255, .75);
  border: 1px solid #e3eaf1;
  border-radius: 999px;
  padding: 3px 10px;
}

.catalog-case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.catalog-case-tags span {
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
}

.accent-rose .catalog-case-tags span { color: #be185d; background: rgba(255,255,255,.7); border: 1px solid #f5c2d6; }
.accent-teal .catalog-case-tags span { color: #0f766e; background: rgba(255,255,255,.7); border: 1px solid #bfe8e1; }
.accent-sky .catalog-case-tags span { color: #0369a1; background: rgba(255,255,255,.7); border: 1px solid #bfdbfe; }
.accent-amber .catalog-case-tags span { color: #b45309; background: rgba(255,255,255,.75); border: 1px solid #fcd34d; }
.accent-indigo .catalog-case-tags span { color: #4338ca; background: rgba(255,255,255,.7); border: 1px solid #c7d2fe; }
.accent-violet .catalog-case-tags span { color: #6d28d9; background: rgba(255,255,255,.7); border: 1px solid #ddd6fe; }
.accent-red .catalog-case-tags span { color: #991b1b; background: rgba(255,255,255,.7); border: 1px solid #fecaca; }
.accent-green .catalog-case-tags span { color: #166534; background: rgba(255,255,255,.7); border: 1px solid #bbf7d0; }
.accent-blue .catalog-case-tags span { color: #1e5a8a; background: rgba(255,255,255,.7); border: 1px solid #bfdbfe; }

.catalog-pager {
  margin-top: 20px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 76, 117, .05);
}

@media (max-width: 992px) {
  .catalog-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Categories admin table */
.category-filter-grid {
  grid-template-columns: 1.4fr .8fr;
}

.cat-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: calc(var(--cat-level, 0) * 16px);
  min-width: 0;
}

.cat-accent-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  font-size: 1.05rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
}

.accent-rose.cat-accent-icon,
.cat-accent-icon.accent-rose { background: linear-gradient(135deg, #9d174d, #db2777); }
.accent-teal.cat-accent-icon,
.cat-accent-icon.accent-teal { background: linear-gradient(135deg, #0f766e, #2a9d8f); }
.accent-sky.cat-accent-icon,
.cat-accent-icon.accent-sky { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.accent-amber.cat-accent-icon,
.cat-accent-icon.accent-amber { background: linear-gradient(135deg, #b45309, #f59e0b); }
.accent-indigo.cat-accent-icon,
.cat-accent-icon.accent-indigo { background: linear-gradient(135deg, #4338ca, #6366f1); }
.accent-violet.cat-accent-icon,
.cat-accent-icon.accent-violet { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.accent-red.cat-accent-icon,
.cat-accent-icon.accent-red { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.accent-green.cat-accent-icon,
.cat-accent-icon.accent-green { background: linear-gradient(135deg, #047857, #22c55e); }
.accent-blue.cat-accent-icon,
.cat-accent-icon.accent-blue { background: linear-gradient(135deg, #0f4c75, #3b82c4); }
.accent-slate.cat-accent-icon,
.cat-accent-icon.accent-slate { background: linear-gradient(135deg, #334155, #64748b); }

.cat-title-text {
  font-weight: 700;
  color: #1e3348;
  line-height: 1.45;
}

.cat-desc {
  margin-top: 2px;
  font-size: .78rem;
  color: #7b93a6;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.parent-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #5b7285;
  font-size: .82rem;
  font-weight: 600;
}

.parent-chip-root {
  background: linear-gradient(90deg, #e8f1f8, #eef8f6);
  color: #0f4c75;
  border: 1px solid #cfe0ed;
}

.count-chip {
  display: inline-flex;
  min-width: 36px;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8f1f8, #eef8f6);
  color: #0f4c75;
  font-weight: 800;
  font-size: .86rem;
}

.sort-chip {
  display: inline-flex;
  min-width: 32px;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 10px;
  background: #f7fafc;
  border: 1px solid #e3eaf1;
  color: #607d8b;
  font-weight: 700;
  font-size: .82rem;
}

.btn-table-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  border-color: transparent;
  color: #fff;
}

.category-mobile-card {
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 8px 18px rgba(15, 76, 117, .05);
}

.category-mobile-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.category-mobile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.category-mobile-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 992px) {
  .category-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin pages: Users, Roles, Activity Logs, Profile */
.users-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(0, .85fr)) auto;
}

.activity-filter-grid {
  grid-template-columns: 1fr 1fr auto;
}

.user-title-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #0f4c75, #2a9d8f);
  box-shadow: 0 6px 14px rgba(15, 76, 117, .18);
  font-size: 1.05rem;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: .95rem;
  border-radius: 10px;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}

.role-tag.accent-blue { color: #0f4c75; background: #dbeafe; border: 1px solid #bfdbfe; }
.role-tag.accent-teal { color: #0f766e; background: #d9f4ef; border: 1px solid #bfe8e1; }
.role-tag.accent-sky { color: #0369a1; background: #dbeafe; border: 1px solid #bfdbfe; }
.role-tag.accent-green { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.role-tag.accent-indigo { color: #3730a3; background: #e0e7ff; border: 1px solid #c7d2fe; }
.role-tag.accent-slate { color: #334155; background: #e2e8f0; border: 1px solid #cbd5e1; }

.role-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

.role-type-system {
  background: #eaf7f0;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.role-type-custom {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.log-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.log-success { background: #eaf7f0; color: #166534; border: 1px solid #bbf7d0; }
.log-muted { background: #f4f4f5; color: #6b7280; border: 1px solid #e5e7eb; }
.log-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.log-blue { background: #e8f1f8; color: #0f4c75; border: 1px solid #cfe0ed; }
.log-teal { background: #d9f4ef; color: #0f766e; border: 1px solid #bfe8e1; }
.log-amber { background: #fff8eb; color: #9a3412; border: 1px solid #fcd34d; }
.log-violet { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.log-brand { background: linear-gradient(90deg, #e8f1f8, #eef8f6); color: #1e5a8a; border: 1px solid #cfe0ed; }

.entity-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 10px;
  background: #f7fafc;
  border: 1px solid #e3eaf1;
  color: #1e3348;
  font-size: .8rem;
  font-weight: 700;
}

.ip-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #607d8b;
  font-size: .78rem;
  font-weight: 600;
  font-family: "AppLatin", monospace;
  direction: ltr;
}

.log-desc {
  color: #5b7285;
  font-size: .86rem;
  line-height: 1.7;
  max-width: 360px;
}

.profile-shell {
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(15, 76, 117, .07);
  overflow: hidden;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #0f4c75 0%, #1e5a8a 45%, #2a9d8f 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  left: -40px;
  bottom: -80px;
  background: rgba(255, 255, 255, .1);
  pointer-events: none;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .28);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.profile-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.profile-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.profile-sub {
  margin: 4px 0 10px;
  opacity: .88;
  font-size: .92rem;
}

.profile-hero .role-tag {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .24);
  color: #fff;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

.profile-field {
  background: linear-gradient(180deg, #f8fbfd, #fff);
  border: 1px solid #e6eef5;
  border-radius: 14px;
  padding: 14px 16px;
}

.profile-label {
  display: block;
  font-size: .78rem;
  color: #7b93a6;
  margin-bottom: 6px;
  font-weight: 600;
}

.profile-value {
  display: block;
  font-weight: 700;
  color: #1e3348;
  line-height: 1.5;
}

@media (max-width: 992px) {
  .users-filter-grid,
  .activity-filter-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    flex-direction: column;
    text-align: center;
  }
}

/* Learner study: bookmarks, progress, read status */
.learner-progress-panel {
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 8px 22px rgba(15, 76, 117, .06);
}

.learner-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #1e3348;
  font-size: .92rem;
}

.learner-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e8f1f8;
  overflow: hidden;
}

.learner-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f4c75, #2a9d8f);
  transition: width .25s ease;
}

.learner-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: .84rem;
  color: #5b7285;
}

.learner-progress-meta a {
  color: #1e5a8a;
  font-weight: 700;
}

.catalog-filter-advanced {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d7e3ee;
}

.catalog-filter-checks .catalog-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 46px;
  align-items: center;
}

.catalog-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 600;
  color: #334e68;
  cursor: pointer;
}

.category-card-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.bookmark-form {
  margin: 0;
}

.btn-bookmark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform .15s ease, background .15s ease;
}

.btn-bookmark:hover,
.btn-bookmark.is-active {
  background: rgba(255, 255, 255, .92);
  color: #0f4c75;
  transform: translateY(-1px);
}

.study-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}

.study-badge-read {
  background: rgba(255, 255, 255, .92);
  color: #166534;
}

.study-badge-new {
  background: rgba(255, 255, 255, .92);
  color: #9a3412;
}

.catalog-tag-link {
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}

.catalog-tag-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 76, 117, .12);
}

.case-row-flag {
  font-size: .82rem;
  margin-inline-start: 4px;
  color: #0f4c75;
}

.case-row-flag-read {
  color: #166534;
}

.details-header-actions .btn-bookmark {
  border-color: #cfe0ed;
  background: #f7fafc;
  color: #1e5a8a;
}

.details-header-actions .btn-bookmark.is-active {
  background: linear-gradient(135deg, #0f4c75, #2a9d8f);
  color: #fff;
  border-color: transparent;
}

/* ===== Case Report reading page ===== */
.case-read {
  --case-accent: #1e5a8a;
  --case-accent-2: #2a9d8f;
  --case-soft: #e8f1f8;
  display: grid;
  gap: 20px;
  animation: caseReadIn .45s ease both;
}

@keyframes caseReadIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.case-read.accent-rose { --case-accent: #9d174d; --case-accent-2: #db2777; --case-soft: #fff1f6; }
.case-read.accent-teal { --case-accent: #0f766e; --case-accent-2: #2a9d8f; --case-soft: #e8f6f4; }
.case-read.accent-sky { --case-accent: #0369a1; --case-accent-2: #0ea5e9; --case-soft: #eef7ff; }
.case-read.accent-amber { --case-accent: #b45309; --case-accent-2: #f59e0b; --case-soft: #fff8eb; }
.case-read.accent-indigo { --case-accent: #4338ca; --case-accent-2: #6366f1; --case-soft: #eef2ff; }
.case-read.accent-violet { --case-accent: #6d28d9; --case-accent-2: #8b5cf6; --case-soft: #f5f3ff; }
.case-read.accent-red { --case-accent: #b91c1c; --case-accent-2: #ef4444; --case-soft: #fff5f5; }
.case-read.accent-green { --case-accent: #047857; --case-accent-2: #22c55e; --case-soft: #f0fdf4; }
.case-read.accent-blue { --case-accent: #0f4c75; --case-accent-2: #3b82c4; --case-soft: #e8f1f8; }

.case-read-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: clamp(22px, 3vw, 34px);
  color: #fff;
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(135deg, var(--case-accent) 0%, color-mix(in srgb, var(--case-accent) 55%, var(--case-accent-2)) 55%, var(--case-accent-2) 100%);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--case-accent) 28%, transparent);
}

.case-read-hero-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  filter: blur(40px);
  top: -60px;
  left: -40px;
  pointer-events: none;
}

.case-read-hero-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.case-read-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.24);
  flex-shrink: 0;
}

.case-read-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.case-read-hero-actions {
  margin-inline-start: auto;
}

.case-read-hero-actions .btn-bookmark {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}

.case-read-hero-actions .btn-bookmark:hover,
.case-read-hero-actions .btn-bookmark.is-active {
  background: #fff;
  color: var(--case-accent);
  border-color: #fff;
}

.case-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
}

.case-read-title {
  position: relative;
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.55;
  max-width: 46rem;
}

.case-read-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: .88rem;
  opacity: .95;
}

.case-read-meta i { opacity: .9; }

.case-read-tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.case-tag {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .78rem;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  transition: background .15s ease, transform .15s ease;
}

.case-tag:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
  transform: translateY(-1px);
}

.case-read-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.case-read-toc {
  position: sticky;
  top: 96px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.case-read-toc-title {
  font-size: .78rem;
  font-weight: 800;
  color: var(--case-accent);
  margin-bottom: 10px;
  letter-spacing: .02em;
}

.case-read-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  counter-reset: toc;
}

.case-read-toc-list li a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: .84rem;
  color: var(--text-muted);
  border-inline-start: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.case-read-toc-list li a:hover {
  background: var(--case-soft);
  color: var(--case-accent);
  border-inline-start-color: var(--case-accent-2);
}

.case-read-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.case-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: 0 8px 24px rgba(15, 76, 117, .04);
  scroll-margin-top: 100px;
  animation: caseSectionIn .5s ease both;
}

.case-section:nth-child(1) { animation-delay: .04s; }
.case-section:nth-child(2) { animation-delay: .08s; }
.case-section:nth-child(3) { animation-delay: .12s; }
.case-section:nth-child(4) { animation-delay: .16s; }
.case-section:nth-child(5) { animation-delay: .2s; }

@keyframes caseSectionIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.case-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f6;
}

.case-section-num {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--case-accent), var(--case-accent-2));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--case-accent) 25%, transparent);
}

.case-section-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #1e3a5f;
}

.case-section-lead {
  margin: 2px 0 0;
  font-size: .82rem;
  color: var(--text-muted);
}

.case-prose {
  margin: 0;
  white-space: pre-line;
  line-height: 2;
  color: #334e68;
  font-size: .98rem;
}

.case-section-summary {
  background:
    linear-gradient(180deg, var(--case-soft) 0%, #fff 48%);
  border-color: color-mix(in srgb, var(--case-accent) 18%, var(--border));
}

.case-fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.case-fact {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--case-soft), #fff);
  border: 1px solid color-mix(in srgb, var(--case-accent) 14%, var(--border));
}

.case-fact-label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.case-fact-value {
  font-weight: 800;
  color: var(--case-accent);
  font-size: 1.02rem;
}

.case-field-list {
  display: grid;
  gap: 10px;
}

.case-field {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
}

.case-field-emphasis {
  background: linear-gradient(105deg, var(--case-soft), #fff);
  border-color: color-mix(in srgb, var(--case-accent) 20%, var(--border));
  border-inline-start: 4px solid var(--case-accent);
}

.case-field h3 {
  margin: 0 0 6px;
  font-size: .86rem;
  font-weight: 800;
  color: #1e3a5f;
}

.case-field p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.9;
  color: #334e68;
  font-size: .95rem;
}

.case-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3f7fb;
  border: 1px dashed #c9d9e8;
  color: #486581;
  font-size: .88rem;
}

.case-note i {
  color: var(--case-accent);
  margin-top: 3px;
}

.case-note p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.8;
}

.case-table-wrap {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.case-table {
  margin: 0;
}

.case-table-result {
  font-weight: 700;
  color: var(--case-accent);
}

.case-diff-grid {
  display: grid;
  gap: 12px;
}

.case-diff-card {
  position: relative;
  padding: 16px 16px 16px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--case-accent-2);
  box-shadow: 0 4px 14px rgba(15, 76, 117, .04);
  transition: transform .15s ease, box-shadow .15s ease;
}

.case-diff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 76, 117, .1);
}

.case-diff-index {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  color: var(--case-accent);
  background: var(--case-soft);
}

.case-diff-card h3 {
  margin: 0 0 12px;
  padding-inline-end: 36px;
  font-size: 1rem;
  font-weight: 800;
  color: #1e3a5f;
}

.case-diff-row {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.case-diff-row:last-child { margin-bottom: 0; }

.case-diff-row span {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.case-diff-row p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.75;
  white-space: pre-line;
}

.case-diff-consider {
  background: #f0faf7;
}

.case-diff-consider span { color: #0f766e; }

.case-diff-reject {
  background: #fff7f0;
}

.case-diff-reject span { color: #b45309; }

.case-section-final {
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--case-accent-2) 12%, transparent), transparent 45%),
    linear-gradient(180deg, var(--case-soft), #fff 55%);
  border-color: color-mix(in srgb, var(--case-accent) 22%, var(--border));
}

.case-final-box {
  padding: 18px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--case-accent) 18%, var(--border));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--case-accent) 10%, transparent);
}

.case-final-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 800;
  color: var(--case-accent);
  background: var(--case-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.case-final-box h3 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f4c75;
  line-height: 1.55;
}

.case-final-reason {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d7e3ee;
}

.case-final-reason strong {
  display: block;
  margin-bottom: 6px;
  font-size: .86rem;
  color: #1e3a5f;
}

.case-final-reason p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.9;
  color: #334e68;
}

.case-conclusion {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f3f8fc;
  border: 1px solid #dce8f3;
}

.case-conclusion strong {
  display: block;
  margin-bottom: 6px;
  color: #0f4c75;
  font-size: .88rem;
}

.case-conclusion p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.9;
  color: #334e68;
}

.case-section-edu {
  background: linear-gradient(180deg, #eef8f6, #fff 50%);
  border-color: #cdeae5;
}

.case-key-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #bfe8e1;
  box-shadow: 0 6px 18px rgba(15, 118, 110, .08);
}

.case-key-message i {
  color: #0f766e;
  font-size: 1.2rem;
  margin-top: 2px;
}

.case-key-message p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.9;
  color: #0f5b52;
  font-weight: 600;
}

.case-section-warn {
  background: linear-gradient(180deg, #fff8eb, #fff 50%);
  border-color: #f5d9a0;
}

.case-file-list {
  display: grid;
  gap: 10px;
}

.case-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e8eef4;
}

.case-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--case-soft);
  color: var(--case-accent);
  flex-shrink: 0;
}

.case-file-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.case-file-info strong {
  font-size: .92rem;
  color: #1e3a5f;
}

.case-file-info span {
  font-size: .8rem;
  color: var(--text-muted);
}

.case-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: .92rem;
}

.case-hx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}

.case-hx-card {
  position: relative;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8eef4;
  border-inline-start: 4px solid var(--case-accent);
}

.case-hx-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 2px 8px;
  margin-bottom: 6px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--case-accent);
  background: var(--case-soft);
}

.case-hx-card h3 {
  margin: 0 0 6px;
  font-size: .86rem;
  font-weight: 800;
  color: #1e3a5f;
}

.case-hx-list {
  margin: 0;
  padding: 0 1.1rem 0 0;
  list-style: disc;
}

.case-hx-list li {
  margin: 0 0 4px;
  color: #334e68;
  font-size: .92rem;
  line-height: 1.55;
}

.case-hx-list li:last-child {
  margin-bottom: 0;
}

.case-hx-note {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  color: #64748b;
  font-size: .86rem;
  line-height: 1.6;
  white-space: pre-line;
}

.case-hx-card p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.8;
  color: #334e68;
  font-size: .92rem;
}

.hx-editor {
  padding: 12px;
  border: 1px solid #e8eef4;
  border-radius: 12px;
  background: #fbfcfe;
  height: 100%;
}

.hx-editor .form-label {
  font-size: .86rem;
  line-height: 1.3;
  max-width: 60%;
}

.hx-editor [data-add-hx],
.hx-editor [data-add-vital] {
  flex-shrink: 0;
  white-space: nowrap;
}

.case-exam-block {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--case-soft), #fff 42%);
  border: 1px solid color-mix(in srgb, var(--case-accent) 16%, var(--border));
}

.case-exam-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.case-exam-title i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--case-accent), var(--case-accent-2));
}

.case-exam-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #1e3a5f;
}

.case-exam-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.case-exam-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8eef4;
}

.case-exam-vitals {
  grid-column: 1 / -1;
  background: linear-gradient(105deg, #fff, var(--case-soft));
  border-color: color-mix(in srgb, var(--case-accent) 22%, var(--border));
}

.case-exam-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--case-accent);
}

.case-exam-body {
  margin: 0;
  white-space: pre-line;
  line-height: 1.85;
  color: #334e68;
  font-size: .92rem;
}

.case-vital-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-vital-chip {
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--case-accent) 18%, #dbe4ee);
  text-align: center;
}

.case-vital-label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.case-vital-chip strong {
  font-size: .95rem;
  color: var(--case-accent);
}

.case-para-stack {
  display: grid;
  gap: 12px;
}

.case-para-panel {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: #fff;
}

.case-para-orders {
  background: linear-gradient(180deg, #eef6ff, #fff 55%);
  border-color: #c9ddf3;
}

.case-para-labs {
  background: linear-gradient(180deg, #eef8f6, #fff 55%);
  border-color: #c5e8e1;
}

.case-para-imaging {
  background: linear-gradient(180deg, #f5f3ff, #fff 55%);
  border-color: #ddd6fe;
}

.case-para-panel-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.case-para-panel-head i {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--case-accent), var(--case-accent-2));
  flex-shrink: 0;
}

.case-para-orders .case-para-panel-head i { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.case-para-labs .case-para-panel-head i { background: linear-gradient(135deg, #0f766e, #2a9d8f); }
.case-para-imaging .case-para-panel-head i { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }

.case-para-panel-head h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  color: #1e3a5f;
}

.case-para-panel-head span {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.case-para-list {
  margin: 0;
  padding: 0 1.2rem 0 0;
  display: grid;
  gap: 8px;
}

.case-para-list li {
  line-height: 1.75;
  color: #334e68;
  font-size: .92rem;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(15, 76, 117, .06);
}

.case-gallery {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #d7e3ee;
}

.case-gallery-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 800;
  color: #1e3a5f;
}

.case-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.case-gallery-item {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e4ebf2;
  color: #486581;
  transition: transform .15s ease, box-shadow .15s ease;
}

.case-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 76, 117, .12);
  color: var(--case-accent);
}

.case-gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e8eef4;
}

.case-gallery-item span {
  font-size: .75rem;
  text-align: center;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .case-read-layout {
    grid-template-columns: 1fr;
  }

  .case-read-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 14px;
  }

  .case-read-toc-title {
    margin: 0;
    width: 100%;
  }

  .case-read-toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .case-read-toc-list li a {
    padding: 6px 10px;
    background: #f3f7fb;
    border-inline-start: 0;
    font-size: .8rem;
  }
}

@media (max-width: 640px) {
  .case-fact-grid {
    grid-template-columns: 1fr;
  }

  .case-hx-grid,
  .case-exam-grid {
    grid-template-columns: 1fr;
  }

  .case-diff-index {
    position: static;
    margin-bottom: 8px;
  }

  .case-diff-card h3 {
    padding-inline-end: 0;
  }

  .case-file-item {
    flex-wrap: wrap;
  }
}

@media (max-width: 992px) {
  .catalog-filter-advanced {
    grid-template-columns: 1fr;
  }
}
