:root {
  --app-primary: #48BECE;
  --app-secondary: #10B981;
  --app-warning: #F59E0B;
  --app-danger: #EF4444;
  --bg: #F5F7FB;
  --card: #FFFFFF;
}

body {
  background: linear-gradient(160deg, #EEF2FF 0%, var(--bg) 45%, #ECFDF5 100%);
  min-height: 100vh;
  font-family: 'Kanit', 'Leelawadee UI', Tahoma, sans-serif;
  color: #1F2937;
}

/* ---------- Glassmorphism ---------- */
.glass-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(31, 41, 55, 0.08);
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  margin: 0 auto 1rem;
}

/* ---------- Navbar ---------- */
.navbar-glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(72, 190, 206, 0.08);
  box-shadow: 0 2px 12px rgba(31, 41, 55, 0.04);
}

.navbar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-right: .5rem;
}

/* ---------- Stat tiles ---------- */
.stat-tile {
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.12);
}
.stat-tile .stat-icon {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 2.25rem;
  opacity: .35;
}
.stat-tile .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.stat-tile .stat-label {
  opacity: .9;
  font-size: .85rem;
  margin-top: .35rem;
}
.stat-tile.bg-primary-grad { background: linear-gradient(135deg, #48BECE, #7DD3DC); }
.stat-tile.bg-secondary-grad { background: linear-gradient(135deg, #10B981, #34D399); }
.stat-tile.bg-warning-grad { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.stat-tile.bg-danger-grad { background: linear-gradient(135deg, #EF4444, #F87171); }

/* ---------- Chart card ---------- */
.chart-card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(31, 41, 55, 0.06);
  height: 100%;
}
.chart-card h6 {
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
}
.chart-wrap { position: relative; height: 280px; }

/* ---------- Badges ---------- */
.badge-status-draft { background: #9CA3AF; }
.badge-status-pending, .badge-status-pending_assoc, .badge-status-pending_dean, .badge-status-pending_editor, .badge-status-pending_assoc_dev,
.badge-status-cancel_pending_assoc, .badge-status-cancel_pending_dean { background: var(--app-warning); }
.badge-status-approved { background: var(--app-secondary); }
.badge-status-rejected { background: var(--app-danger); }
.badge-status-recalled { background: #9CA3AF; }
.badge-status-cancelled { background: #6B7280; }

/* ---------- Buttons ---------- */
.btn-primary { background: var(--app-primary); border-color: var(--app-primary); }
.btn-primary:hover { background: #3A98A5; border-color: #3A98A5; }
.btn-secondary { background: var(--app-secondary); border-color: var(--app-secondary); }

/* ---------- Photo upload ---------- */
.photo-upload-box {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: .75rem;
  border: 2px dashed #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #F8FAFC;
  cursor: pointer;
  position: relative;
}
.photo-upload-box img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-disclosure { overflow: hidden; }
.profile-photo-disclosure__summary {
  min-height: 64px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--app-text, #14313F);
}
.profile-photo-disclosure__summary::-webkit-details-marker { display: none; }
.profile-photo-disclosure__summary:hover { background: #F4FAFA; }
.profile-photo-disclosure__summary:focus-visible { outline: 3px solid #147D8C; outline-offset: -3px; }
.profile-photo-disclosure__heading { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; white-space: nowrap; }
.profile-photo-disclosure__heading i { color: var(--app-primary, #1AA9A4); }
.profile-photo-disclosure__hint { flex: 1; color: #617784; font-size: .86rem; }
.profile-photo-disclosure__chevron { color: #617784; transition: transform .18s ease; }
.profile-photo-disclosure[open] .profile-photo-disclosure__chevron { transform: rotate(180deg); }
.profile-photo-disclosure__content { border-top: 1px solid #E3ECEE; background: #FBFDFD; }
.profile-photo-disclosure .photo-upload-box { max-width: 180px; padding: 0; }

@media (max-width: 575.98px) {
  .profile-photo-disclosure__summary { align-items: flex-start; gap: .75rem; }
  .profile-photo-disclosure__summary { flex-wrap: wrap; }
  .profile-photo-disclosure__hint { flex-basis: calc(100% - 2rem); order: 3; }
  .profile-photo-disclosure__chevron { margin-left: auto; }
}

/* ---------- Directory card ---------- */
.person-card {
  background: var(--card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(31, 41, 55, 0.07);
  transition: transform .15s ease, box-shadow .15s ease;
  height: 100%;
}
.person-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(31, 41, 55, 0.12); }
.person-card .person-photo { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #E5E7EB; }
.person-card .person-education { line-height: 1.45; overflow-wrap: anywhere; }

@media (max-width: 576px) {
  .stat-tile .stat-value { font-size: 1.5rem; }
}

/* ---------- Sidebar labels ---------- */
/* Thai script has no spaces between words, so a narrow sidebar's default line-breaking
   wraps labels one character per line ("vertical" text) unless forced flat — applies to
   the group collapse-toggle links, their submenu items, and any leftover menu-title. */
#sidebarNavList > li > a,
#sidebarNavList ul.collapse a,
#sidebarNavList .menu-title,
#sidebarNavList .menu-title span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- System Health ---------- */
.sh-status-banner {
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: #fff;
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.14);
  background: linear-gradient(135deg, #10B981, #059669);
}
.sh-status-banner.is-warning { background: linear-gradient(135deg, #F59E0B, #D97706); }
.sh-status-banner .sh-status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.sh-status-banner .sh-status-title { font-size: 1.15rem; font-weight: 700; margin-bottom: .15rem; }
.sh-status-banner .sh-status-detail { opacity: .92; font-size: .875rem; }

.kpi-card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  box-shadow: 0 4px 18px rgba(31, 41, 55, 0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(31, 41, 55, 0.1); }
.approval-type-card { cursor: pointer; user-select: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.approval-type-card:focus-visible { outline: 3px solid rgba(8,145,178,.28); outline-offset: 2px; }
.approval-type-card.is-active { border-color: #0891B2; box-shadow: 0 0 0 3px rgba(8,145,178,.14), 0 10px 24px rgba(15,23,42,.09); }
.approval-type-card.is-active::after { content: 'กำลังกรอง'; margin-left: auto; align-self: flex-start; border-radius: 999px; background: #E6F7F9; color: #0E7490; padding: .18rem .48rem; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.profile-field-pending { color: #6B7280 !important; background-color: #F9FAFB; border-color: #D1D5DB; }
.profile-field-pending:focus { color: #4B5563 !important; background-color: #FFF; }
.profile-pending-badge { margin-left: .45rem; vertical-align: .08rem; background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; font-size: .67rem; font-weight: 700; letter-spacing: 0; }
.approval-group-item--unreviewed { position: relative; border-color: #DC2626 !important; background: #FEF2F2; box-shadow: 0 0 0 3px rgba(220,38,38,.10); }
.approval-group-item--unreviewed::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; border-radius: .65rem 0 0 .65rem; background: #DC2626; }
.approval-decision-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.approval-reject-with-comment { display: flex; flex: 0 1 auto; align-items: center; gap: .75rem; min-width: 0; }
.approval-decision-row > .form-check,
.approval-reject-option { display: flex; flex: 0 0 auto; align-items: center; min-height: 2.375rem; margin: 0; }
.approval-decision-row .form-check-input { margin-top: 0; }
.approval-comment-field { display: flex; flex: 0 1 22rem; flex-wrap: wrap; align-items: center; gap: .35rem; width: clamp(15rem, 28vw, 22rem); min-width: 0; margin: 0; }
.approval-comment-field .approval-comment-autogrow { flex: 1 1 100%; }
.approval-comment-label { flex: 0 0 auto; color: #617784; font-size: .875rem; }
.approval-comment-field textarea.form-control.approval-comment-autogrow { height: 2.375rem; min-height: 2.375rem; max-height: 10rem; overflow-y: hidden; resize: none; line-height: 1.35; padding-top: .45rem; padding-bottom: .45rem; }
.approval-comment-field .invalid-feedback { flex-basis: 100%; }
@media (max-width: 575.98px) {
  .approval-reject-with-comment, .approval-comment-field { flex-basis: 100%; }
  .approval-reject-with-comment { flex-wrap: wrap; }
  .approval-comment-field { width: 100%; min-width: 0; align-items: flex-start; flex-direction: column; gap: .35rem; }
  .approval-comment-autogrow { width: 100%; }
}
.approval-decision-required { color: #B91C1C; font-size: .82rem; font-weight: 700; }
.approval-decision-required[hidden] { display: none !important; }
.kpi-card-warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
}
.kpi-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}
.kpi-card .kpi-value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; color: #1F2937; }
.kpi-card .kpi-label { font-size: .78rem; color: #6B7280; margin-top: .1rem; }

.table-count-card {
  background: var(--card);
  border-radius: .85rem;
  padding: .9rem 1rem;
  box-shadow: 0 3px 14px rgba(31, 41, 55, 0.05);
  height: 100%;
}
.table-count-card .tc-name { font-family: 'Consolas', 'SFMono-Regular', monospace; font-size: .78rem; color: #6B7280; }
.table-count-card .tc-value { font-size: 1.4rem; font-weight: 700; color: #1F2937; }
.table-count-card.is-empty .tc-value { color: #D1D5DB; }

.locked-row {
  border-left: 3px solid var(--app-danger);
  background: #FEF2F2;
  border-radius: .6rem;
  padding: .6rem .9rem;
}

.pill-tabs .nav-link {
  border: none;
  border-radius: 2rem;
  padding: .5rem 1.1rem;
  font-weight: 600;
  color: #6B7280;
  margin-right: .4rem;
}
.pill-tabs .nav-link.active {
  background: linear-gradient(135deg, var(--app-primary), #7DD3DC);
  color: #fff;
  box-shadow: 0 6px 16px rgba(72, 190, 206, 0.25);
}

/* ---------- CV print ---------- */
#cvPrintArea { display: none; }
.cv-table th { width: 240px; color: #374151; }
.cv-footer { font-size: .75rem; color: #9CA3AF; margin-top: 2rem; }

@media print {
  body * { visibility: hidden; }
  #cvPrintArea, #cvPrintArea * { visibility: visible; }
  #cvPrintArea {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
  }
}

/* ปุ่มที่กดได้แต่จะขึ้นคำอธิบายแทนการทำงาน (เช่น CV ตอนข้อมูลยังไม่อนุมัติ) */
.disabled-look { opacity: .55; }

/* ===== Linear/Sequential Approval Workflow (แบบย่อ) =====
   ใช้แสดงในการ์ด "รอพิจารณาอนุมัติ" ของหน้าแรกส่วนตัว — รูปแบบเดียวกับ .lv-stepper
   ในระบบการลา แต่ตั้งชื่อ class แยก (.pp-) เพราะใช้กับหลายประเภทข้อมูลที่มีชื่อขั้นกลั่นกรอง
   ไม่ตายตัว (ระบุผ่านพารามิเตอร์ ไม่ใช่ข้อความคงที่แบบของระบบการลา) */
.pp-stepper { display: flex; width: 100%; align-items: flex-start; gap: 0; margin: .5rem 0 0; }
.pp-step { flex: 1; text-align: center; position: relative; min-width: 0; }
.pp-step:not(:last-child)::after { content: ''; position: absolute; top: 12px; left: 50%; width: 100%; height: 2px; background: #E5E7EB; z-index: 0; }
.pp-step.done:not(:last-child)::after { background: #10B981; }
.pp-step-circle { width: 24px; height: 24px; border-radius: 50%; background: #E5E7EB; color: #6B7280; display: flex; align-items: center; justify-content: center; margin: 0 auto 4px; position: relative; z-index: 1; font-size: .65rem; }
.pp-step.done .pp-step-circle { background: #10B981; color: #fff; }
.pp-step.current .pp-step-circle { background: #F59E0B; color: #fff; }
.pp-step.rejected .pp-step-circle { background: #EF4444; color: #fff; }
.pp-step-label { font-size: .7rem; color: #6B7280; line-height: 1.25; overflow-wrap: anywhere; }
.pp-step-elapsed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  margin-top: .3rem;
  color: var(--bs-secondary-color, #617784);
  font-size: .64rem;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pp-step-elapsed i { font-size: .6rem; opacity: .8; }
.pp-step-elapsed-value { font-family: Consolas, 'SFMono-Regular', monospace; letter-spacing: .02em; }
@media (max-width: 575.98px) {
  .pp-step-label { font-size: .62rem; }
  .pp-step-elapsed { font-size: .58rem; gap: .18rem; }
}

/* ===== Step-by-Step Guide (คำแนะนำการใช้งานแบบทีละขั้นตอน) =====
   บังคับแสดงอัตโนมัติเฉพาะครั้งแรกที่เข้าหน้านั้น (เก็บสถานะแยกตามผู้ใช้ + แยกตามหน้า
   ใน localStorage) ครั้งต่อไปแสดงผ่านปุ่ม "คำแนะนำการใช้งาน" ที่แถบด้านบนแทน
   ดู public/js/guide.js สำหรับตรรกะการทำงาน */

.guide-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 23, 42, .55);
  opacity: 0; transition: opacity .2s ease;
}
.guide-overlay.guide-visible { opacity: 1; }

.guide-spotlight {
  position: fixed; z-index: 2001;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(72,190,206,.85), 0 0 0 9999px rgba(15,23,42,.55);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease;
  pointer-events: none;
}
/* ขั้นที่ไม่มีเป้าหมายบนจอ (เช่น "ยินดีต้อนรับ" ทั่วไป) ไม่มี spotlight ไม่ต้อง cutout */
.guide-spotlight.guide-no-target { box-shadow: 0 0 0 9999px rgba(15,23,42,.55); opacity: 0; }

.guide-card {
  position: fixed; z-index: 2002;
  width: min(340px, calc(100vw - 2rem));
  background: #fff; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15,23,42,.28);
  padding: 1.1rem 1.25rem 1rem;
  transition: top .25s ease, left .25s ease;
}
.guide-card-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: #48BECE; text-transform: uppercase; margin-bottom: .3rem; }
.guide-card-title { font-size: 1rem; font-weight: 700; color: #1F2933; margin-bottom: .4rem; }
.guide-card-text { font-size: .85rem; color: #4B5563; line-height: 1.55; margin-bottom: .9rem; }
.guide-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.guide-dots { display: flex; gap: 5px; }
.guide-dot { width: 6px; height: 6px; border-radius: 50%; background: #E5E7EB; }
.guide-dot.guide-dot-active { background: #48BECE; width: 16px; border-radius: 3px; }
.guide-card-btns { display: flex; gap: .4rem; }
.guide-btn { font-size: .8rem; font-weight: 600; padding: .35rem .8rem; border-radius: 7px; border: 1px solid transparent; cursor: pointer; }
.guide-btn-skip { background: transparent; color: #9CA3AF; }
.guide-btn-skip:hover { color: #6B7280; }
.guide-btn-prev { background: #F3F4F6; color: #374151; }
.guide-btn-prev:hover { background: #E5E7EB; }
.guide-btn-next { background: #48BECE; color: #fff; }
.guide-btn-next:hover { background: #3AA8B8; }

/* ปุ่ม "คำแนะนำการใช้งาน" ที่แถบด้านบน */
.guide-trigger-btn { white-space: nowrap; }

@media (max-width: 576px) {
  .guide-card { width: calc(100vw - 1.5rem); left: .75rem !important; }
}

/* Research dashboard: keep researcher names and roles legible in the dense detail table. */
#researchTable th:nth-child(3),
#researchTable td:nth-child(3) {
  min-width: 190px;
}

#researchTable .rf-researcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem .4rem;
  padding: .16rem 0;
  font-size: .86rem;
  line-height: 1.25;
}

#researchTable .rf-researcher + .rf-researcher {
  margin-top: .08rem;
}

#researchTable .rf-person-link,
#researchTable .rf-researcher > .fw-semibold {
  font-size: .86rem;
  font-weight: 600 !important;
}

#researchTable .rf-researcher .badge {
  padding: .18rem .42rem;
  font-size: .7rem;
  line-height: 1.15;
  white-space: normal;
  text-align: left;
}

.cr-picker {
  max-height: 430px;
  overflow: auto;
  border: 1px solid #DDE5EA;
  border-radius: 12px;
  background: #F8FBFC;
  scrollbar-gutter: stable;
}

.cr-picker-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  margin: 0;
  border-bottom: 1px solid #E8EEF1;
  cursor: pointer;
}

.cr-picker-row:last-child { border-bottom: 0; }
.cr-picker-row:hover { background: #EFF9FA; }
.cr-picker-row:focus-within { outline: 2px solid rgba(72,190,206,.45); outline-offset: -2px; }
.cr-picker-row small { display: block; color: #6B7280; margin-top: .15rem; }
.cr-picker-row .cr-role-select { width: min(190px, 42%); flex: 0 0 auto; }

@media (max-width: 576px) {
  .cr-picker-row { align-items: flex-start; flex-wrap: wrap; }
  .cr-picker-row .cr-role-select { width: calc(100% - 2rem); margin-left: 2rem; }
}

/* Approval center: surface only actionable counts and make the review target unmistakable. */
#acCountCards[hidden],
#acCountCards > .col[hidden],
.approval-count-empty[hidden] { display: none !important; }

.approval-count-empty {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  border: 1px solid #BBF7D0;
  border-radius: .75rem;
  background: #F0FDF4;
  color: #166534;
}

.approval-count-empty > i { font-size: 1.35rem; }
.approval-count-empty strong,
.approval-count-empty small { display: block; }
.approval-count-empty small { margin-top: .1rem; color: #4B5563; }

.approval-review-focus {
  margin-bottom: 1rem;
  padding: .9rem 1rem;
  border-left: 5px solid var(--app-danger);
  border-radius: .65rem;
  background: #FEF2F2;
}

.approval-review-focus__label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .25rem;
  color: #7F1D1D;
  font-size: .8rem;
  font-weight: 700;
}

.approval-review-focus__value {
  display: block;
  color: #B91C1C;
  font-size: clamp(1.35rem, 2.7vw, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
/* ========================================================================== 
   2026 application shell — login, sidebar navigation and top navigation only.
   Page content keeps the existing Bootstrap/Ra-admin component ownership.
   ========================================================================== */
:root {
  --shell-navy: #0B2734;
  --shell-navy-raised: #103746;
  --shell-primary: #1AA9A4;
  --shell-primary-deep: #0C817F;
  --shell-primary-soft: #E6F7F5;
  --shell-canvas: #F3F7F9;
  --shell-surface: #FFFFFF;
  --shell-border: #DCE7EB;
  --shell-ink: #14313F;
  --shell-muted: #617784;
  --shell-sidebar-width: 280px;
  --shell-header-height: 72px;
}

/* Login */
body.auth-page {
  min-height: 100vh;
  display: block;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--shell-canvas);
  color: var(--shell-ink);
  font-family: 'Kanit', 'Leelawadee UI', Tahoma, sans-serif;
  animation: none;
}

.auth-page .login-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(420px, .92fr) minmax(520px, 1.08fr);
  margin: 0;
  padding: 0;
}

.auth-page .login-story {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 42px clamp(34px, 5vw, 82px);
  background: var(--shell-navy);
  color: #FFFFFF;
}

.auth-page .login-story::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -230px;
  bottom: -150px;
  border: 1px solid rgba(113, 216, 209, .18);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(113, 216, 209, .035),
    0 0 0 145px rgba(113, 216, 209, .025);
}

.auth-page .login-story::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .13;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(140deg, #000 0%, transparent 65%);
  mask-image: linear-gradient(140deg, #000 0%, transparent 65%);
}

.auth-page .login-brand {
  position: relative;
  z-index: 1;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #FFFFFF;
  text-decoration: none;
}

.auth-page .login-brand__mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 15px;
  background: #FFFFFF;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.auth-page .login-brand__mark img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.auth-page .login-brand__copy {
  display: grid;
  line-height: 1.35;
}

.auth-page .login-brand__copy strong {
  font-size: 1.05rem;
  letter-spacing: .01em;
}

.auth-page .login-brand__copy small {
  color: #9DB6BF;
  font-size: .68rem;
}

.auth-page .login-story__content {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  margin: auto 0;
}

.auth-page .login-eyebrow {
  margin: 0 0 8px;
  color: var(--shell-primary-deep);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-page .login-story .login-eyebrow {
  color: #71D8D1;
}

.auth-page .login-story h1 {
  max-width: 650px;
  margin: 0;
  color: #FFFFFF;
  font-size: clamp(2.05rem, 3.8vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.22;
}

.auth-page .login-story h1 span {
  color: #DCE9ED;
  font-size: .62em;
  font-weight: 650;
  letter-spacing: -.02em;
}

.auth-page .login-story__content > p:not(.login-eyebrow) {
  max-width: 580px;
  margin: 22px 0 0;
  color: #B8CDD4;
  font-size: .95rem;
  line-height: 1.8;
}

.auth-page .login-story ul {
  display: grid;
  gap: 13px;
  padding: 0;
  margin: 32px 0 0;
  list-style: none;
}

.auth-page .login-story li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #DCE9ED;
  font-size: .86rem;
  line-height: 1.55;
}

.auth-page .login-story li i {
  margin-top: .2em;
  color: #71D8D1;
}

.auth-page .login-story__foot {
  position: relative;
  z-index: 1;
  color: #7897A2;
  font-size: .72rem;
}

.auth-page .login-panel {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 64px clamp(28px, 6vw, 110px);
  background: var(--shell-canvas);
}

.auth-page .login-card {
  width: min(100%, 500px);
}

.auth-page .login-card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-page .login-card__icon {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--shell-primary-soft);
  color: var(--shell-primary-deep);
  font-size: 1.25rem;
}

.auth-page .login-card h2 {
  margin: 0;
  color: var(--shell-ink);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.025em;
}

.auth-page .login-card__intro {
  margin: 20px 0 26px;
  color: var(--shell-muted);
  font-size: .83rem;
  line-height: 1.75;
}

.auth-page .login-form-alert {
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid #F5BFC2;
  border-radius: 10px;
  background: #FFF1F2;
  color: #9F2430;
  font-size: .82rem;
  line-height: 1.5;
}

.auth-page .login-form-alert.is-info {
  border-color: #A7D8D5;
  background: #EAF7F6;
  color: #0A6664;
}

.auth-page .login-field + .login-field {
  margin-top: 17px;
}

.auth-page .login-field > label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--shell-ink);
  font-size: .8rem;
  font-weight: 700;
}

.auth-page .login-input-shell {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid #C8D8DE;
  border-radius: 11px;
  background: var(--shell-surface);
  color: #77909A;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.auth-page .login-input-shell:hover {
  border-color: #86AEB8;
}

.auth-page .login-input-shell:focus-within {
  border-color: var(--shell-primary-deep);
  box-shadow: 0 0 0 3px rgba(20, 125, 140, .14);
}

.auth-page .login-input-shell:has(input[aria-invalid="true"]) {
  border-color: #D94350;
  box-shadow: 0 0 0 3px rgba(217, 67, 80, .1);
}

.auth-page .login-input-shell input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--shell-ink);
  font: inherit;
  font-size: .88rem;
}

.auth-page .login-input-shell input::placeholder {
  color: #9BB0B9;
}

.auth-page .login-password-toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #657E89;
}

.auth-page .login-password-toggle:hover {
  background: #EEF5F6;
  color: var(--shell-primary-deep);
}

.auth-page .login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 22px;
  font-size: .76rem;
}

.auth-page .login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--shell-muted);
  cursor: pointer;
}

.auth-page .login-remember input {
  width: 17px;
  height: 17px;
  accent-color: var(--shell-primary);
}

.auth-page .login-options a,
.auth-page .login-register a {
  color: var(--shell-primary-deep);
  font-weight: 750;
  text-decoration: none;
}

.auth-page .login-options a:hover,
.auth-page .login-register a:hover {
  text-decoration: underline;
}

.auth-page .login-submit {
  width: 100%;
  min-height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--shell-primary);
  border-radius: 11px;
  background: var(--shell-primary);
  color: #FFFFFF;
  font-size: .88rem;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(26, 169, 164, .2);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.auth-page .login-submit:hover {
  border-color: var(--shell-primary-deep);
  background: var(--shell-primary-deep);
  box-shadow: 0 12px 25px rgba(12, 129, 127, .24);
}

.auth-page .login-submit:active {
  box-shadow: 0 5px 14px rgba(12, 129, 127, .2);
}

.auth-page .login-submit:disabled {
  border-color: #77C9C4;
  background: #77C9C4;
  box-shadow: none;
}

.auth-page .login-register {
  margin: 16px 0 0;
  color: var(--shell-muted);
  font-size: .78rem;
  text-align: center;
}

.auth-page .login-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  color: var(--shell-muted);
  font-size: .7rem;
  text-align: center;
}

.auth-page .login-notice i {
  color: var(--shell-primary-deep);
}

.auth-page .login-support {
  margin: 7px 0 0;
  color: #8CA0A8;
  font-size: .64rem;
  line-height: 1.55;
  text-align: center;
}

/* Authenticated application shell */
#appShell {
  min-height: 100vh;
  display: flex;
  background: var(--shell-canvas);
}

#appShell > nav {
  width: var(--shell-sidebar-width);
  height: 100vh;
  position: fixed;
  z-index: 460;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--shell-border);
  border-radius: 0;
  background: #FFFFFF;
  color: var(--shell-ink);
  box-shadow: 8px 0 28px rgba(11, 39, 52, .035);
}

#appShell > nav .app-logo {
  height: var(--shell-header-height);
  min-height: var(--shell-header-height);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--shell-border);
}

#appShell > nav .app-logo::after {
  content: none;
}

#appShell > nav .app-logo .logo {
  width: auto;
  height: auto;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  color: var(--shell-ink);
  box-shadow: none;
  text-decoration: none;
}

/* Legacy Clinical UI locks the old icon-only logo with !important; this shell owns the replacement brand row. */
#appShell > nav .app-logo .logo {
  display: flex !important;
}

#appShell > nav .app-logo .logo img {
  width: 43px !important;
  height: 43px;
  max-height: 43px !important;
  flex: 0 0 auto;
  float: none;
  object-fit: contain;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid var(--shell-border);
  box-shadow: 0 4px 14px rgba(11, 39, 52, .08);
}

#appShell .shell-brand-copy {
  min-width: 0;
  display: grid;
  white-space: nowrap;
  line-height: 1.3;
}

#appShell .shell-brand-copy strong {
  overflow: hidden;
  font-size: .92rem;
  text-overflow: ellipsis;
}

#appShell .shell-brand-copy small {
  overflow: hidden;
  color: var(--shell-muted);
  font-size: .62rem;
  text-overflow: ellipsis;
}

#appShell > nav .toggle-semi-nav {
  display: none;
}

#appShell > nav .app-nav {
  height: auto;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 15px 12px 22px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

#appShell > nav .shell-nav-footer {
  flex: 0 0 auto;
  padding: 11px 12px;
  border-top: 1px solid var(--shell-border);
}

#appShell > nav .shell-nav-collapse-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--shell-muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  text-align: left;
}

#appShell > nav .shell-nav-collapse-button:hover {
  background: #F4F9FA;
  color: var(--shell-primary-deep);
}

#appShell > nav .shell-nav-collapse-button:focus-visible {
  outline: 3px solid rgba(20, 125, 140, .28);
  outline-offset: 1px;
}

@media (min-width: 1200px) {
  #appShell.shell-nav-collapsed { --shell-sidebar-width: 78px; }
  #appShell.shell-nav-collapsed > nav .app-logo { justify-content: center; padding-inline: 0; }
  #appShell.shell-nav-collapsed > nav .shell-brand-copy,
  #appShell.shell-nav-collapsed > nav .mis-nav-group-toggle,
  #appShell.shell-nav-collapsed > nav .main-nav a > span,
  #appShell.shell-nav-collapsed > nav .shell-nav-collapse-label { display: none; }
  #appShell.shell-nav-collapsed > nav .app-nav { padding-inline: 10px; }
  #appShell.shell-nav-collapsed > nav .mis-nav-submenu { display: block !important; margin: 0 !important; padding: 0 !important; border-left: 0 !important; }
  #appShell.shell-nav-collapsed > nav .mis-nav-group { margin-top: 2px !important; }
  #appShell.shell-nav-collapsed > nav .main-nav a,
  #appShell.shell-nav-collapsed > nav .shell-nav-collapse-button { justify-content: center; padding-inline: 0; }
  #appShell.shell-nav-collapsed > nav .main-nav a i { width: 22px; margin: 0; font-size: 1.18rem; text-align: center; }
  #appShell.shell-nav-collapsed > nav .shell-nav-footer { padding-inline: 10px; }
}

@media (max-width: 1199.98px) {
  #appShell > nav .shell-nav-footer { display: none; }
}

#appShell > nav .app-nav .main-nav {
  margin: 0;
}

#appShell > nav .app-nav .main-nav > li {
  padding: 0;
}

#appShell > nav .app-nav .menu-title {
  padding: 14px 10px 6px;
  margin: 0;
}

/* Theme compatibility: neutralize the older !important teal-pill section heading. */
#appShell > nav .app-nav .menu-title span {
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--shell-muted) !important;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

#appShell > nav .app-nav .main-nav > li:not(.menu-title) {
  margin: 2px 0;
}

#appShell > nav .app-nav .main-nav > li:not(.menu-title) > a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--shell-muted);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.35;
  text-transform: none;
  transition: background-color .14s ease, color .14s ease;
}

#appShell > nav .app-nav .main-nav > li:not(.menu-title) > a:hover {
  background: #F4F9FA;
  color: var(--shell-primary-deep);
}

#appShell > nav .app-nav .main-nav > li:not(.menu-title).active > a {
  position: relative;
  background: #E7F8F6;
  color: var(--shell-primary-deep);
}

#appShell > nav .app-nav .main-nav > li:not(.menu-title).active > a::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 24px;
  left: -12px;
  border-radius: 0 4px 4px 0;
  background: var(--shell-primary);
}

#appShell > nav .app-nav .main-nav > li:not(.menu-title) > a i {
  width: 20px;
  flex: 0 0 auto;
  margin: 0;
  color: currentColor;
  font-size: 1.15rem;
  text-align: center;
}

#appShell > nav .app-nav .main-nav > li:not(.menu-title) > a::after {
  content: none;
}

#appShell > .app-content {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  height: auto;
  overflow: visible;
  padding: var(--shell-header-height) 0 0 var(--shell-sidebar-width);
  background: transparent;
  box-shadow: none;
}

#appShell > .app-content > header.header-main {
  width: auto;
  height: var(--shell-header-height);
  position: fixed;
  z-index: 450;
  inset: 0 0 auto var(--shell-sidebar-width);
  padding: 0;
  border-bottom: 1px solid var(--shell-border);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 18px rgba(20, 49, 63, .045);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

#appShell > .app-content > header.header-main::before {
  content: none;
}

#appShell > .app-content > header.header-main .container-fluid {
  height: 100%;
  padding: 0 24px;
  border: 0;
}

#appShell > .app-content > header.header-main .container-fluid > .row {
  height: 100%;
  align-items: center;
}

#appShell .header-left {
  gap: 8px;
}

/* The left side of the top bar is reserved for the mobile navigation trigger. */
#appShell .header-left > .fw-bold {
  display: none !important;
}

#appShell .header-toggle {
  width: 42px;
  height: 42px;
  display: none;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  background: #F8FBFC !important;
  color: var(--shell-ink);
}

#appShell .topbar-live-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid #CFE6E3;
  border-radius: 999px;
  background: #F0FAF8;
  color: #246B69;
  font-size: .69rem;
  font-weight: 750;
  white-space: nowrap;
}

#appShell .topbar-live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #24A86A;
  box-shadow: 0 0 0 4px rgba(36, 168, 106, .11);
}

#appShell #topbarUserInfo {
  min-width: 0;
  gap: 8px;
}

#appShell .topbar-utility-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  position: relative;
  padding: 0 11px;
  border: 1px solid var(--shell-border);
  border-radius: 9px;
  background: #FFFFFF;
  color: var(--shell-muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

#appShell .topbar-utility-button:hover,
#appShell .topbar-utility-button:focus-visible {
  border-color: var(--shell-primary);
  color: var(--shell-primary-deep);
  background: #F7FAFB;
}

#appShell .topbar-icon-button { width: 40px; padding: 0; border-color: transparent; background: transparent; }
#appShell .topbar-utility-button i { font-size: 1.15rem; }
#appShell .topbar-notification-count {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  position: absolute;
  top: -5px;
  right: -5px;
  padding: 0 4px;
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  background: #D33F49;
  color: #FFFFFF;
  font-size: .56rem;
  font-weight: 800;
  line-height: 1;
}

#appShell .topbar-scale-menu { position: relative; flex: 0 0 auto; }
#appShell .topbar-scale-button { min-width: 94px; }
#appShell .topbar-scale-aa { color: var(--shell-primary-deep); font-weight: 800; }
#appShell .topbar-scale-button .ph-caret-down { font-size: .75rem; }
#appShell .topbar-scale-dropdown { width: min(280px, calc(100vw - 24px)); padding: 10px; border: 1px solid var(--shell-border); border-radius: 12px; box-shadow: 0 18px 46px rgba(11,39,52,.16); }
#appShell .topbar-scale-heading { display: grid; gap: 2px; padding: 4px 4px 10px; }
#appShell .topbar-scale-heading strong { color: var(--shell-ink); font-size: .84rem; }
#appShell .topbar-scale-heading small { color: var(--shell-muted); font-size: .68rem; }
#appShell .topbar-scale-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#appShell .topbar-scale-options button { min-height: 40px; border: 1px solid var(--shell-border); border-radius: 8px; background: #FFFFFF; color: var(--shell-muted); font: inherit; font-size: .72rem; font-weight: 700; }
#appShell .topbar-scale-options button:hover { border-color: var(--shell-primary); color: var(--shell-primary-deep); }
#appShell .topbar-scale-options button.active { border-color: var(--shell-primary); background: #E7F8F6; color: var(--shell-primary-deep); box-shadow: inset 0 0 0 1px var(--shell-primary); }
#appShell .topbar-scale-reset { width: 100%; min-height: 38px; margin-top: 8px; border: 0; border-radius: 8px; background: #F4F9FA; color: var(--shell-muted); font: inherit; font-size: .72rem; font-weight: 700; }
#appShell .topbar-scale-reset:hover { color: var(--shell-primary-deep); background: #E7F8F6; }

.mis-spin { animation: mis-topbar-spin .8s linear infinite; }
@keyframes mis-topbar-spin { to { transform: rotate(360deg); } }

html[data-bs-theme="dark"] body.mis-dark-mode {
  --shell-canvas: #081D27;
  --shell-ink: #EDF6F7;
  --shell-muted: #AAC0C8;
  --shell-border: #294753;
  color: #EDF6F7;
  background: #081D27;
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > .app-content > header.header-main,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-utility-button {
  background: #0D2631;
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .app-logo .logo,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .shell-brand-copy strong { color: #EDF6F7; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-notification-count { border-color: #0D2631; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-scale-options button { background: #12323F; }

/* Complete dark palette: keep surfaces and text in the same contrast system. */
html[data-bs-theme="dark"] body.mis-dark-mode {
  --bs-body-color: #DCE9ED;
  --bs-body-color-rgb: 220, 233, 237;
  --bs-body-bg: #081D27;
  --bs-body-bg-rgb: 8, 29, 39;
  --bs-secondary-color: #A9C0C8;
  --bs-secondary-bg: #112F3B;
  --bs-tertiary-bg: #12323F;
  --bs-border-color: #294753;
  --bs-emphasis-color: #FFFFFF;
  --bs-link-color: #74DAD4;
  --bs-link-hover-color: #9BE8E3;
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > .app-content,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main {
  background: #081D27;
  color: #DCE9ED;
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav {
  border-right-color: #294753;
  background: #0D2631;
  box-shadow: 8px 0 28px rgba(0, 0, 0, .2);
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .app-logo,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .shell-nav-footer { border-color: #294753; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .mis-nav-group-toggle,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .main-nav a,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .shell-nav-collapse-button { color: #A9C0C8; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .mis-nav-group-toggle:hover,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .mis-nav-group.is-open > .mis-nav-group-toggle,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .main-nav a:hover,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .shell-nav-collapse-button:hover { color: #7CE2DC; background: #12323F; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .main-nav li.active > a { color: #7CE2DC; background: #173F43; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .mis-nav-group-symbol { border-color: #315663; background: #12323F; color: #A9C0C8; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell > nav .mis-nav-submenu { border-left-color: #315663; }

html[data-bs-theme="dark"] body.mis-dark-mode #appShell > .app-content > header.header-main {
  border-bottom-color: #294753;
  background: rgba(13, 38, 49, .96);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-live-badge,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .header-toggle,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-user-trigger,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-action { border-color: #315663; background: #112F3B !important; color: #DCE9ED; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-live-badge { color: #91DDD7; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-user-trigger:hover,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .topbar-user-trigger[aria-expanded="true"] { border-color: #54D4CD; background: #173F43; }

html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .card,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .glass-card,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .kpi-card,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .list-group-item,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .accordion-item {
  border-color: #294753 !important;
  background: #0D2631 !important;
  color: #DCE9ED;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .card-header,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .card-footer,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .accordion-header {
  border-color: #294753 !important;
  background: #112F3B !important;
  color: #EDF6F7;
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell main h1,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main h2,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main h3,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main h4,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main h5,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main h6,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main label,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .kpi-value { color: #EDF6F7 !important; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell .text-muted,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .kpi-label,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main small { color: #A9C0C8 !important; }

html[data-bs-theme="dark"] body.mis-dark-mode .form-control,
html[data-bs-theme="dark"] body.mis-dark-mode .form-select,
html[data-bs-theme="dark"] body.mis-dark-mode .input-group-text,
html[data-bs-theme="dark"] body.mis-dark-mode .dataTables_wrapper input,
html[data-bs-theme="dark"] body.mis-dark-mode .dataTables_wrapper select {
  border-color: #315663 !important;
  background-color: #12323F !important;
  color: #EDF6F7 !important;
}
html[data-bs-theme="dark"] body.mis-dark-mode .form-control::placeholder { color: #7897A2; }
html[data-bs-theme="dark"] body.mis-dark-mode .form-control:focus,
html[data-bs-theme="dark"] body.mis-dark-mode .form-select:focus { border-color: #54D4CD !important; box-shadow: 0 0 0 .2rem rgba(84,212,205,.16) !important; }

html[data-bs-theme="dark"] body.mis-dark-mode .table {
  --bs-table-color: #DCE9ED;
  --bs-table-bg: transparent;
  --bs-table-border-color: #294753;
  --bs-table-striped-color: #DCE9ED;
  --bs-table-striped-bg: rgba(255,255,255,.025);
  --bs-table-hover-color: #FFFFFF;
  --bs-table-hover-bg: rgba(84,212,205,.07);
}
html[data-bs-theme="dark"] body.mis-dark-mode .table > thead,
html[data-bs-theme="dark"] body.mis-dark-mode .table-light { --bs-table-bg: #112F3B; --bs-table-color: #DCE9ED; }
html[data-bs-theme="dark"] body.mis-dark-mode .table tbody tr { background: transparent; }

html[data-bs-theme="dark"] body.mis-dark-mode .pill-tabs,
html[data-bs-theme="dark"] body.mis-dark-mode .nav-tabs,
html[data-bs-theme="dark"] body.mis-dark-mode .nav-pills { border-color: #294753; background: #0D2631; }
html[data-bs-theme="dark"] body.mis-dark-mode .nav-link { color: #A9C0C8; }
html[data-bs-theme="dark"] body.mis-dark-mode .nav-link.active { color: #FFFFFF; }

html[data-bs-theme="dark"] body.mis-dark-mode .dropdown-menu,
html[data-bs-theme="dark"] body.mis-dark-mode .modal-content,
html[data-bs-theme="dark"] body.mis-dark-mode .swal2-popup {
  border-color: #315663 !important;
  background: #0D2631 !important;
  color: #DCE9ED !important;
}
html[data-bs-theme="dark"] body.mis-dark-mode .dropdown-item { color: #DCE9ED; }
html[data-bs-theme="dark"] body.mis-dark-mode .dropdown-item:hover,
html[data-bs-theme="dark"] body.mis-dark-mode .dropdown-item:focus { background: #173F43; color: #FFFFFF; }
html[data-bs-theme="dark"] body.mis-dark-mode .modal-header,
html[data-bs-theme="dark"] body.mis-dark-mode .modal-footer { border-color: #294753; }

html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-heading small,
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-month-label,
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-filter-label,
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-day,
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-more { color: #A9C0C8; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-filter-panel { border-top-color: #294753; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-filter { border-color: #315663; background: #12323F; color: #DCE9ED; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-filter.is-active { color: #14313F; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-status { background: #112F3B; color: #A9C0C8; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-scroll { border-color: #315663; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-grid { background: #294753; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-dow { background: #112F3B; color: #A9C0C8; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-cell { background: #0D2631; }
html[data-bs-theme="dark"] body.mis-dark-mode .dashboard-calendar-cell.is-outside { background: #0A222D; }

html[data-bs-theme="dark"] body.mis-dark-mode .bg-white,
html[data-bs-theme="dark"] body.mis-dark-mode .bg-light { background-color: #112F3B !important; }
html[data-bs-theme="dark"] body.mis-dark-mode .border,
html[data-bs-theme="dark"] body.mis-dark-mode .border-bottom,
html[data-bs-theme="dark"] body.mis-dark-mode .border-top { border-color: #294753 !important; }

html[data-bs-theme="dark"] body.mis-dark-mode #appShell main :is(.table-responsive, .dataTables_wrapper, .tab-content, .table-section, .content-panel),
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main :is([class$="-card"], [class*="-card "]):not(.approval-card):not(.pending-approval-card):not(.alert-card) {
  border-color: #294753;
  background-color: #0D2631;
  color: #DCE9ED;
}

html[data-bs-theme="dark"] body.mis-dark-mode #appShell main :is(.form-check-label, .dataTables_info, .dataTables_length, .dataTables_filter, .pagination, dt, dd) { color: #DCE9ED; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .page-link { border-color: #315663; background: #12323F; color: #A9C0C8; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .page-item.active .page-link { border-color: #54D4CD; background: #1AA9A4; color: #FFFFFF; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .apexcharts-text,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .apexcharts-legend-text { fill: #A9C0C8 !important; color: #A9C0C8 !important; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .apexcharts-gridline { stroke: #294753; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .fc-theme-standard td,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .fc-theme-standard th,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .fc-theme-standard .fc-scrollgrid { border-color: #294753; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .fc .fc-daygrid-day,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .fc .fc-list { background: #0D2631; }
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .fc .fc-col-header-cell,
html[data-bs-theme="dark"] body.mis-dark-mode #appShell main .fc .fc-list-day-cushion { background: #112F3B; color: #DCE9ED; }

/* Mobile drawer owns one backdrop only. Neutralize the legacy pseudo-overlay that
   otherwise sits above the drawer and intercepts every touch. */
@media (max-width: 1199.98px) {
  #appShell {
    isolation: isolate;
  }

  #appShell > nav {
    z-index: 1050 !important;
    pointer-events: none;
    will-change: transform;
    transition: transform .18s ease-out !important;
  }

  #appShell > nav.semi-nav,
  #appShell > nav.semi-nav:hover { pointer-events: auto; }

  .shell-nav-backdrop { z-index: 1040; pointer-events: none; }
  body.shell-nav-open .shell-nav-backdrop { display: block; pointer-events: auto; }
  .app-wrapper .semi-nav ~ .app-content::before,
  #appShell > nav.semi-nav ~ .app-content::before { content: none !important; display: none !important; pointer-events: none !important; }
  body.shell-nav-open #appShell > .app-content { pointer-events: none; }
  body.shell-nav-open #appShell > nav { pointer-events: auto; }
}

@media (prefers-reduced-motion: reduce) {
  #appShell > nav { transition: none !important; }
}

/* Mobile/iPad disclosure state must win over the legacy semi-nav rules that set
   every nested list to height:0. The button owns only its group; the drawer stays open. */
@media (max-width: 1199.98px) {
  #appShell > nav.semi-nav #sidebarNavList > .mis-nav-group > .mis-nav-submenu {
    display: none !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
  }

  #appShell > nav.semi-nav #sidebarNavList > .mis-nav-group.is-open > .mis-nav-submenu {
    display: block !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
  }
}

#appShell .topbar-user-cluster {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--shell-border);
  border-radius: 11px;
  background: #F8FBFC;
}

#appShell .topbar-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--shell-navy);
  color: #FFFFFF;
  font-size: .74rem;
  font-weight: 800;
}

#appShell .topbar-user-meta {
  max-width: min(18vw, 220px);
  min-width: 0;
  display: grid;
  line-height: 1.3;
}

#appShell .topbar-user-email,
#appShell .topbar-user-role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell .topbar-user-email {
  color: var(--shell-ink);
  font-size: .69rem;
  font-weight: 750;
}

#appShell .topbar-user-role {
  color: var(--shell-muted);
  font-size: .6rem;
}

#appShell .topbar-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 7px 10px;
  border-color: var(--shell-border);
  border-radius: 10px;
  background: #FFFFFF;
  font-size: .72rem;
  font-weight: 750;
  white-space: nowrap;
}

#appShell .guide-trigger-btn {
  color: #3A6675;
}

#appShell .guide-trigger-btn:hover {
  border-color: #B5D5DC;
  background: #EDF7F8;
  color: var(--shell-primary-deep);
}

#appShell .btn-outline-danger.topbar-action {
  border-color: #F1CED1;
  color: #B52E3B;
}

#appShell .btn-outline-danger.topbar-action:hover {
  border-color: #B52E3B;
  background: #B52E3B;
  color: #FFFFFF;
}

#appShell .phone-requirement-banner {
  position: relative;
  z-index: 149;
  margin: 0;
  padding: .65rem clamp(1rem, 2.2vw, 2rem);
  color: #FFFFFF;
  background: #B42318;
  border-bottom: 1px solid #861F18;
  box-shadow: 0 3px 12px rgba(120, 20, 14, .18);
}

#appShell .phone-requirement-banner[hidden] {
  display: none !important;
}

#appShell .phone-requirement-banner__content {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
}

#appShell .phone-requirement-banner__message,
#appShell .phone-requirement-banner__action {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

#appShell .phone-requirement-banner__message {
  min-width: 0;
  font-size: .875rem;
  line-height: 1.45;
}

#appShell .phone-requirement-banner__action {
  flex: 0 0 auto;
  min-height: 32px;
  padding: .25rem .65rem;
  color: #7A1812;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: .55rem;
  font-size: .8rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

#appShell .phone-requirement-banner__action:hover {
  color: #5C120D;
  background: #FFF4F2;
}

#appShell .phone-requirement-banner__action:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}

.shell-nav-backdrop {
  position: fixed;
  z-index: 740;
  inset: 0;
  display: none;
  border: 0;
  background: rgba(5, 20, 28, .58);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

/* Public research dashboard: no authenticated sidebar, no reserved sidebar gap. */
body.rf-public-view #appShell > .app-content {
  padding-left: 0 !important;
}

body.rf-public-view #appShell > .app-content > .header-main {
  left: 0 !important;
}

body.rf-public-view #appShell main {
  max-width: 1440px;
  margin-inline: auto;
}

@media (max-width: 1199.98px) {
  #appShell > nav {
    width: min(310px, calc(100vw - 44px)) !important;
    z-index: 750;
    transform: translateX(-105%) !important;
    transition: none;
    overscroll-behavior: contain;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
  }

  #appShell > nav .app-nav {
    height: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: scroll !important;
    overscroll-behavior-y: contain;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
  }

  /* iPad keeps :hover after a touch. Keep the open transform identical for
     .semi-nav and .semi-nav:hover so a swipe can never slide the drawer away. */
  #appShell > nav.semi-nav,
  #appShell > nav.semi-nav:hover {
    transform: translateX(0) !important;
  }

  #appShell > nav .app-logo {
    padding-right: 10px;
  }

  #appShell > nav .toggle-semi-nav {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    margin-left: auto;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: #B8CDD4;
    cursor: pointer;
  }

  #appShell > nav .toggle-semi-nav:hover {
    background: rgba(255, 255, 255, .11);
    color: #FFFFFF;
  }

  #appShell > .app-content {
    padding-left: 0;
  }

  #appShell > .app-content > header.header-main {
    left: 0;
  }

  #appShell .header-toggle {
    display: grid;
  }

  body.shell-nav-open {
    overflow: hidden;
  }

  body.shell-nav-open .shell-nav-backdrop {
    display: block;
  }

  body.shell-nav-open #appShell > nav {
    pointer-events: auto !important;
    touch-action: pan-y;
  }
}

@media (max-width: 767.98px) {
  .auth-page .login-page {
    display: block;
  }

  .auth-page .login-story {
    min-height: auto;
    padding: 24px 22px 30px;
  }

  .auth-page .login-story__content {
    margin: 42px 0 10px;
  }

  .auth-page .login-story h1 {
    font-size: 1.9rem;
  }

  .auth-page .login-story h1 span {
    font-size: .58em;
  }

  .auth-page .login-story__content > p:not(.login-eyebrow) {
    font-size: .8rem;
  }

  .auth-page .login-story ul,
  .auth-page .login-story__foot {
    display: none;
  }

  .auth-page .login-panel {
    min-height: auto;
    padding: 40px 22px 54px;
  }

  .auth-page .login-card h2 {
    font-size: 1.62rem;
  }

  #appShell > .app-content > header.header-main .container-fluid {
    padding: 0 13px;
  }

  #appShell .topbar-live-badge {
    display: none;
  }

  #appShell .topbar-user-meta {
    display: none;
  }

  #appShell .topbar-user-cluster {
    min-height: 40px;
    padding: 2px;
    border: 0;
    background: transparent;
  }

  #appShell .topbar-avatar {
    width: 38px;
    height: 38px;
  }

  #appShell .topbar-action {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  #appShell .topbar-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  #appShell .phone-requirement-banner {
    padding: .65rem .8rem;
  }

  #appShell .phone-requirement-banner__content {
    align-items: flex-start;
  }

  #appShell .phone-requirement-banner__detail {
    display: none;
  }

  #appShell .phone-requirement-banner__action {
    min-height: 36px;
  }
}

@media (max-width: 420px) {
  .auth-page .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  #appShell #topbarUserInfo {
    gap: 5px;
  }

  #appShell .topbar-user-cluster {
    display: none;
  }
}

@media (max-width: 767.98px) {
  #appShell .topbar-refresh-button { width: 40px; padding: 0; }
  #appShell .topbar-utility-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #appShell .topbar-scale-button { min-width: 68px; padding-inline: 7px; }
}

/* Shared proof that a submitted record remains visible to its owner on every page. */
.my-submission-dialog { max-width: min(650px, calc(100vw - 2rem)); }
.my-submission-dialog__toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; color: #617784; font-size: .78rem; }
.my-submission-dialog__toolbar label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; white-space: nowrap; }
.my-submission-dialog__toolbar .form-select { width: 76px; }
.my-submission-dialog { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.my-submission-dialog__list { max-height: min(20vh, 260px); margin: 0; padding: 0; overflow-y: auto; list-style: none; text-align: left; scrollbar-gutter: stable; }
.my-submission-dialog__item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid #E3ECEE; }
.my-submission-dialog__item:last-child { border-bottom: 0; }
.my-submission-dialog__main { min-width: 0; display: grid; gap: .1rem; }
.my-submission-dialog__main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #14313F; }
.my-submission-dialog__main span, .my-submission-dialog__meta time { color: #617784; font-size: .78rem; }
.my-submission-dialog__meta { flex: 0 0 auto; display: grid; gap: .22rem; justify-items: end; text-align: right; }
.my-submission-dialog__empty { padding: 2rem 1rem; color: #617784; text-align: center; }
.my-submission-dialog__pagination { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .75rem; border-top: 1px solid #E3ECEE; color: #47636D; font-size: .78rem; font-weight: 700; }
.my-submission-dialog__pagination .btn { display: inline-flex; align-items: center; gap: .4rem; min-width: 92px; justify-content: center; }
.my-submission-state { padding: .24rem .48rem; border-radius: 999px; color: #735A00; background: #FFF3CD; font-size: .72rem; font-weight: 700; }
.my-submission-state.is-approved { color: #0B6A46; background: #DDF5E9; }
.my-submission-state.is-rejected { color: #9B1C1C; background: #FDE7E7; }
.my-submission-state.is-recalled { color: #52636B; background: #E8EFF1; }

@media (max-width: 767.98px) {
  .my-submission-dialog__item { align-items: flex-start; }
  .my-submission-dialog__toolbar { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .login-input-shell,
  .auth-page .login-submit,
  #appShell > nav,
  #appShell > nav .app-nav .main-nav > li:not(.menu-title) > a {
    transition: none;
  }
}

/* Shared User Profile Menu: guidance stays first; account actions live in one dropdown. */
#appShell #topbarUserInfo { overflow: visible; }
#appShell .topbar-profile-menu { position: relative; flex: 0 0 auto; }
#appShell .topbar-user-trigger {
  min-width: 0; min-height: 46px; display: inline-flex; align-items: center; gap: 9px;
  padding: 4px 9px 4px 5px; border: 1px solid var(--shell-border); border-radius: 11px;
  background: #F8FBFC; color: var(--shell-ink); text-align: left; cursor: pointer;
}
#appShell .topbar-user-trigger:hover,
#appShell .topbar-user-trigger[aria-expanded="true"] { border-color: #9CCDD3; background: #EDF7F8; }
#appShell .topbar-user-trigger:focus-visible { outline: 3px solid #147D8C; outline-offset: 2px; }
#appShell .topbar-profile-caret { flex: 0 0 auto; color: var(--shell-muted); font-size: .78rem; transition: transform .16s ease; }
#appShell .topbar-user-trigger[aria-expanded="true"] .topbar-profile-caret { transform: rotate(180deg); }
#appShell .topbar-profile-dropdown {
  z-index: var(--z-dropdown, 250); width: min(310px, calc(100vw - 24px)); margin-top: 8px !important;
  padding: 8px; border: 1px solid var(--shell-border); border-radius: 14px; background: #FFFFFF;
  box-shadow: 0 16px 40px rgba(11, 39, 52, .16);
}
#appShell .topbar-profile-summary { min-width: 0; display: grid; gap: 2px; padding: 8px 10px 7px; }
#appShell .topbar-profile-summary__email,
#appShell .topbar-profile-summary__role { overflow-wrap: anywhere; }
#appShell .topbar-profile-summary__email { color: var(--shell-ink); font-size: .82rem; font-weight: 800; }
#appShell .topbar-profile-summary__role { color: var(--shell-muted); font-size: .72rem; line-height: 1.45; }
#appShell .topbar-profile-dropdown .dropdown-divider { margin: 5px 3px; border-color: var(--shell-border); }
#appShell .topbar-profile-dropdown .dropdown-item {
  min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0;
  border-radius: 9px; color: #294A57; background: transparent; font-size: .82rem; font-weight: 700; cursor: pointer;
}
#appShell .topbar-profile-dropdown .dropdown-item i { width: 20px; color: #4E7682; font-size: 1.08rem; text-align: center; }
#appShell .topbar-menu-count { min-width: 24px; margin-left: auto; padding: 2px 7px; border-radius: 999px; color: #075F5B; background: #DDF3F0; font-size: .7rem; font-weight: 850; text-align: center; }
#appShell .topbar-profile-dropdown .dropdown-item:hover,
#appShell .topbar-profile-dropdown .dropdown-item:focus { color: var(--shell-primary-deep); background: #EAF7F6; }
#appShell .topbar-profile-dropdown .dropdown-item:focus-visible { outline: 3px solid #147D8C; outline-offset: 1px; }
#appShell .topbar-profile-dropdown .topbar-logout-item,
#appShell .topbar-profile-dropdown .topbar-logout-item i { color: #B4232F; }
#appShell .topbar-profile-dropdown .topbar-logout-item:hover,
#appShell .topbar-profile-dropdown .topbar-logout-item:focus { color: #98202A; background: #FFF0F1; }

@media (max-width: 767.98px) {
  #appShell .topbar-user-trigger {
    width: 40px; height: 40px; min-height: 40px; justify-content: center; padding: 2px;
    border-color: transparent; background: transparent;
  }
  #appShell .topbar-user-trigger .topbar-avatar { width: 38px; height: 38px; }
  #appShell .topbar-user-trigger .topbar-user-meta,
  #appShell .topbar-user-trigger .topbar-profile-caret {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) { #appShell .topbar-profile-caret { transition: none; } }
