:root {
  --bg: #f6f9ff;
  --panel: #ffffff;
  --text: #071a3d;
  --muted: #6b7280;
  --line: #e4eaf4;
  --blue: #1677ff;
  --blue-dark: #173b7a;
  --blue-soft: #edf5ff;
  --green: #16b981;
  --orange: #ff7a1a;
  --danger: #d92d20;
  --shadow: 0 10px 30px rgba(25, 68, 135, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: #fff;
  color: var(--blue);
  border: 1px solid #cbd7ef;
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.is-disabled,
.button-link.is-disabled {
  opacity: .55;
  filter: grayscale(.25);
}

input,
select,
textarea {
  min-height: 36px;
  border: 1px solid #d9dee8;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

textarea {
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 79, 179, 0.12);
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(15, 48, 111, 0.86), rgba(15, 48, 111, 0.86)),
    radial-gradient(circle at 30% 20%, #42639f, #142b61 65%);
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  border-radius: 8px;
  background: #fff;
  padding: 34px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.login-logo {
  width: 176px;
  max-height: 72px;
  object-fit: contain;
  justify-self: start;
  margin-bottom: 4px;
}

.login-card h1,
.login-card p {
  margin: 0;
}

.login-card p {
  color: var(--muted);
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  border-radius: 8px;
  background: #f2f6fc;
  padding: 4px;
}

.login-tabs button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #52647f;
  font-weight: 700;
}

.login-tabs button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 6px 16px rgba(25, 68, 135, 0.08);
}

.login-fields {
  display: grid;
  gap: 14px;
}

.sms-code-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.sms-code-line button {
  white-space: nowrap;
}

.login-card label,
.form-grid label {
  display: grid;
  gap: 8px;
}

.error {
  min-height: 20px;
  color: var(--danger);
}

.portal-page {
  min-height: 100vh;
  display: block;
  background: #eaf4ff;
  color: #fff;
  overflow: hidden;
}

.portal-band {
  position: relative;
  min-height: 100vh;
  display: block;
  background: #eaf4ff;
}

.portal-band::before {
  display: none;
}

.portal-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portal-overlay {
  position: absolute;
  left: clamp(42px, 5.4vw, 96px);
  bottom: clamp(42px, 8vh, 96px);
  z-index: 2;
}

.portal-overlay::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(8px);
}

.portal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 18px;
  width: min(660px, calc(100vw - 84px));
}

.portal-actions button {
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 1px solid rgba(22, 119, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #134aa5;
  box-shadow: 0 12px 34px rgba(13, 75, 163, 0.16);
  font-size: 19px;
  font-weight: 800;
}

.portal-actions button:hover {
  background: #eef6ff;
  transform: translateY(-2px);
  border-color: #1677ff;
}

.portal-actions i {
  width: 58px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2f7ff;
  color: #1677ff;
}

.portal-actions .svg-icon {
  width: 28px;
  height: 28px;
}

.portal-page footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: rgba(19, 74, 165, 0.78);
  font-weight: 700;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px 14px;
}

.brand {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  color: #194487;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: #071a3d;
  font-size: 12px;
  letter-spacing: 0;
}

.brand-logo {
  width: 150px;
  height: 64px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-mark {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 55% 50%, #fff 0 18%, transparent 19%),
    conic-gradient(from 30deg, #1677ff, #45c9d0, #1677ff);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: inset 0 0 0 7px #45c9d0;
}

.sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 52px;
  background: #fff;
  color: #2b4068;
  font-weight: 800;
  border-color: transparent;
  border-radius: 10px;
  padding: 0 16px;
  gap: 12px;
}

.nav-item span {
  font-size: 17px;
  letter-spacing: 0.2px;
}

.nav-icon {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #eff3f9;
  color: #3a5785;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.nav-item:hover,
.nav-item.active {
  background: #e8f0fd;
  color: #1e67de;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: #e3ecfb;
  color: #1f66df;
}

.nav-dashboard::before {
  left: 9px;
  top: 9px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-dashboard::after {
  left: 15px;
  top: 10px;
  width: 2px;
  height: 7px;
  background: currentColor;
  transform-origin: bottom center;
  transform: rotate(-36deg);
}

.nav-doctors::before {
  left: 10px;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-doctors::after {
  left: 8px;
  top: 19px;
  width: 16px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 9px 9px;
}

.nav-patients::before {
  left: 7px;
  top: 10px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 10px 0 0 0 currentColor;
}

.nav-patients::after {
  left: 6px;
  top: 19px;
  width: 20px;
  height: 6px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.nav-sessions::before {
  left: 10px;
  top: 7px;
  width: 12px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.nav-sessions::after {
  left: 13px;
  top: 12px;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-referrals::before {
  left: 8px;
  top: 16px;
  width: 12px;
  border-top: 2px solid currentColor;
}

.nav-referrals::after {
  right: 8px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.nav-readings::before {
  left: 8px;
  top: 12px;
  width: 16px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 8px;
}

.nav-readings::after {
  left: 14px;
  top: 14px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.nav-orgTree::before {
  left: 8px;
  top: 10px;
  width: 16px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 2px;
  border-top-width: 0;
}

.nav-orgTree::after {
  left: 11px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.nav-templates::before {
  left: 9px;
  top: 7px;
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.nav-templates::after {
  left: 12px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-users::before {
  left: 6px;
  top: 18px;
  width: 9px;
  height: 9px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 12px 0 0 currentColor;
}

.nav-users::after {
  left: 9px;
  top: 9px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 0 0 12px 12px;
}

.main {
  min-width: 0;
}

.topbar {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--text);
  border-bottom: 1px solid #edf2f8;
  padding: 0 14px;
  box-shadow: none;
}

.topbar > strong,
#orgTitle,
#today {
  flex: 0 0 auto;
  white-space: nowrap;
}

.topbar > strong {
  display: inline-flex !important;
  align-items: center;
  color: #23395f;
  font-size: 14px;
  font-weight: 700;
}

#orgTitle {
  display: none;
}

#today {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

#today::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1.5px solid #8190a9;
  border-radius: 4px;
  background:
    linear-gradient(#8190a9, #8190a9) 3px 5px / 8px 1.5px no-repeat,
    linear-gradient(#8190a9, #8190a9) 3px 8px / 8px 1.5px no-repeat;
  box-sizing: border-box;
}

.topbar select {
  width: 124px;
  max-width: 140px;
  min-width: 104px;
  height: 34px;
  min-height: 34px;
  border: 1px solid #dbe4f3;
  border-radius: 8px;
  background: #fff;
  color: #506280;
  font-size: 13px;
  font-weight: 600;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-spacer {
  flex: 1;
}

.icon-button,
.ghost,
.link {
  border: 1px solid #d9dee8;
  background: #fff;
  color: var(--text);
}

.topbar .ghost,
.topbar .icon-button {
  border-color: #d9dee8;
  background: #fff;
  color: var(--text);
}

.top-icon {
  position: relative;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #5f6f89;
  border-radius: 50%;
  box-shadow: none;
}

.top-icon:hover {
  background: #f2f6fc;
  border-color: transparent;
}

.bell-icon {
  position: relative;
  width: 13px;
  height: 13px;
  display: block;
  margin: 0 auto;
  border: 2px solid #5f6f89;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom: 0;
}

.bell-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: -4px;
  height: 5px;
  border: 2px solid #5f6f89;
  border-top: 0;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.bell-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -7px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #5f6f89;
}

.top-icon .badge {
  position: absolute;
  right: 3px;
  top: 4px;
  width: 6px;
  min-width: 6px;
  height: 6px;
  display: block;
  border-radius: 50%;
  background: #ef4444;
  color: transparent;
  font-size: 0;
  font-weight: 0;
  border: 0;
  line-height: 0;
}

.top-menu-wrap {
  position: relative;
}

.org-tree-picker {
  position: relative;
  min-width: 190px;
  max-width: 280px;
  z-index: 30;
}

.org-tree-toggle {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #cfe0f6;
  border-radius: 8px;
  background: #fff;
  color: #0b2a5b;
  padding: 0 12px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 76, 129, 0.08);
}

.org-tree-toggle span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.org-tree-toggle i {
  font-style: normal;
  color: var(--muted);
}

.org-tree-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(430px, 88vw);
  max-height: min(68vh, 620px);
  overflow: auto;
  border: 1px solid #d6e4f7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 39, 82, 0.18);
  padding: 12px;
}

.org-tree-dropdown section + section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf2f8;
}

.org-tree-dropdown h4 {
  margin: 0 0 8px;
  color: #002050;
  font-size: 14px;
}

.org-tree-choice {
  display: grid;
  gap: 4px;
}

.org-tree-choice button {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #12315f;
  padding: 7px 10px 7px calc(10px + var(--level, 0) * 22px);
  text-align: left;
}

.org-tree-choice button:hover,
.org-tree-choice.active > button {
  background: #eef6ff;
  color: var(--blue);
}

.org-tree-choice button:disabled {
  color: #9aa8ba;
  cursor: not-allowed;
}

.org-tree-choice i {
  color: #72a5dc;
  font-style: normal;
}

.org-tree-choice span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.org-tree-choice em {
  color: #667085;
  font-size: 12px;
  font-style: normal;
}

.org-tree-choice.extra button {
  background: #fbfcff;
}

.user-profile {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #556680;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-shadow: none;
}

.user-profile:hover {
  background: #f5f8fd;
  border-color: #dce6f5;
}

.user-profile span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe6cc, #f9d3b0);
  color: #8c5f38;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}

.user-profile strong {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.user-profile em {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8ba3;
  border-bottom: 1.5px solid #7b8ba3;
  transform: rotate(45deg);
  margin: -2px 0 0 2px;
  flex: 0 0 auto;
}

.user-profile::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 7px;
  width: 1px;
  height: 16px;
  background: #e3e9f3;
}

.top-dropdown {
  position: absolute;
  right: 10px;
  top: 50px;
  z-index: 50;
  width: 340px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 35, 75, 0.18);
  padding: 14px;
}

.top-menu-wrap .top-dropdown {
  right: 0;
  top: 36px;
}

.user-dropdown {
  width: 260px;
}

.top-dropdown h4 {
  margin: 0 0 12px;
  color: #071a3d;
}

.top-dropdown p,
.notice-item {
  margin: 0;
  border-top: 1px solid #edf2fb;
  padding: 10px 0;
}

.top-dropdown p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.top-dropdown p span,
.notice-item span,
.notice-item small,
.muted {
  color: #667085;
}

.top-dropdown p strong {
  color: #071a3d;
  text-align: right;
}

.notice-item {
  width: 100%;
  min-height: auto;
  display: grid;
  gap: 5px;
  justify-content: stretch;
  text-align: left;
  border-width: 1px 0 0;
  border-radius: 0;
  background: #fff;
  color: #071a3d;
  padding: 11px 0;
}

.notice-item.unread {
  background: #f5f9ff;
  color: #174ea6;
}

.notice-item b,
.notice-item span,
.notice-item small {
  display: block;
}

.user-dropdown button {
  width: 100%;
  margin-top: 10px;
}

.link {
  min-height: 30px;
  padding: 0 10px;
  color: var(--blue);
  background: transparent;
  border-color: transparent;
}

.link:hover {
  background: var(--blue-soft);
  border-color: #cbd7ef;
}

.link.danger {
  color: var(--danger);
}

.content {
  padding: 30px 34px 40px;
  overflow: hidden;
}

.app-footer {
  margin-top: 24px;
  padding: 12px 0 0;
  text-align: center;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.layout.bigscreen-mode {
  display: block;
  min-height: 100vh;
  background: #020b1e;
}

.bigscreen-mode .sidebar,
.bigscreen-mode .topbar,
.bigscreen-mode .page-head,
.bigscreen-mode #stats,
.bigscreen-mode .app-footer {
  display: none !important;
}

.bigscreen-mode .content {
  display: grid;
  place-items: center;
  height: 100vh;
  padding: 0;
  overflow: hidden;
  background: #020b1e;
}

.bigscreen-mode #panel {
  width: 100vw;
  height: 100vh;
  margin: 0;
}

.board-screen {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: #020b1e;
  box-shadow: none;
  padding: 0;
  min-height: 100vh;
  overflow: hidden;
}

.board-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: clamp(76px, 8.6vh, 104px) clamp(96px, 10.6vh, 118px) minmax(0, 1fr) clamp(34px, 4vh, 40px);
  gap: clamp(6px, 0.52vw, 10px);
  padding: clamp(8px, 0.75vw, 14px) clamp(18px, 1.45vw, 28px) 0;
  color: #d9f2ff;
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 152, 255, 0.22), transparent 24%),
    radial-gradient(circle at 18% 12%, rgba(0, 110, 255, 0.24), transparent 24%),
    linear-gradient(180deg, #031632 0%, #031026 48%, #010716 100%);
  overflow: hidden;
}

.board-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(45, 179, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 179, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 48%, #000 0, transparent 68%);
}

.board-top,
.board-stats,
.board-grid,
.board-ticker {
  position: relative;
  z-index: 1;
}

.board-top {
  display: grid;
  grid-template-columns: 16% 1fr 18%;
  align-items: center;
  gap: clamp(10px, 1vw, 18px);
}

.board-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
}

.board-logo img {
  width: min(8.8vw, 148px);
  height: min(3.2vw, 54px);
  object-fit: contain;
}

.board-title {
  text-align: center;
}

.board-title h1 {
  margin: 0;
  color: #d9f6ff;
  font-size: clamp(30px, 2.55vw, 50px);
  letter-spacing: clamp(3px, 0.45vw, 8px);
  text-shadow: 0 0 18px rgba(0, 209, 255, 0.75);
}

.board-title p {
  margin: 8px 0 0;
  color: #29e6ff;
  font-size: clamp(11px, 0.9vw, 15px);
}

.board-clock {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: #fff;
}

.board-clock b {
  font-size: clamp(11px, 0.95vw, 16px);
}

.board-clock span,
.board-clock button {
  border: 1px solid rgba(0, 178, 255, 0.55);
  border-radius: 18px;
  background: rgba(0, 112, 190, 0.24);
  color: #b9edff;
  padding: clamp(3px, 0.3vw, 5px) clamp(8px, 0.8vw, 14px);
  font-size: clamp(11px, 0.78vw, 14px);
}

.board-clock button {
  min-height: 30px;
  cursor: pointer;
}

.board-stats {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(8px, 0.7vw, 12px);
  min-height: 0;
}

.board-stat {
  display: grid;
  grid-template-columns: clamp(42px, 3.2vw, 58px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(5px, 0.55vw, 10px);
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(0, 179, 255, 0.72);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(9, 58, 113, 0.82), rgba(4, 20, 52, 0.82));
  box-shadow: inset 0 0 28px rgba(0, 152, 255, 0.18), 0 0 14px rgba(0, 152, 255, 0.16);
  padding: clamp(8px, 0.75vw, 12px) clamp(10px, 0.9vw, 16px);
}

.board-stat i {
  width: clamp(34px, 3.2vw, 54px);
  height: clamp(34px, 3.2vw, 54px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 140, 255, 0.2);
  color: #2ebfff;
  box-shadow: 0 0 28px rgba(46, 191, 255, 0.25);
}

.board-stat.green i { color: #2effa3; background: rgba(46, 255, 163, 0.14); }
.board-stat.purple i { color: #9b7cff; background: rgba(155, 124, 255, 0.14); }
.board-stat.orange i { color: #ff9a38; background: rgba(255, 154, 56, 0.16); }
.board-stat.cyan i { color: #33ecff; background: rgba(51, 236, 255, 0.14); }

.board-stat span,
.board-stat small {
  color: #cde9ff;
}

.board-stat span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(13px, 0.92vw, 16px);
}

.board-stat strong {
  display: block;
  color: #fff;
  font-size: clamp(22px, 1.9vw, 32px);
  line-height: 1.1;
}

.board-stat small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(10px, 0.78vw, 13px);
}

.board-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 26% 38% 34%;
  grid-template-rows: minmax(0, 1fr) minmax(156px, 25%);
  gap: clamp(6px, 0.6vw, 10px);
}

.board-left,
.board-right {
  min-height: 0;
  display: grid;
  gap: clamp(6px, 0.6vw, 10px);
}

.board-left {
  grid-row: 1 / span 2;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.board-center {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(0, 179, 255, 0.36);
  border-radius: 8px;
  background: radial-gradient(circle at center, rgba(0, 174, 255, 0.19), rgba(2, 12, 36, 0.62) 62%);
  overflow: hidden;
}

.board-right {
  grid-row: 1 / span 1;
  grid-template-rows: minmax(0, 1fr);
}

.board-bottom {
  grid-column: 2 / span 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 1.45fr;
  gap: clamp(6px, 0.6vw, 10px);
  min-height: 0;
}

.board-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(0, 179, 255, 0.58);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(3, 35, 78, 0.82), rgba(2, 14, 40, 0.82));
  box-shadow: inset 0 0 24px rgba(0, 178, 255, 0.12), 0 0 18px rgba(0, 143, 255, 0.1);
  padding: clamp(8px, 0.72vw, 12px) clamp(9px, 0.85vw, 14px);
  overflow: hidden;
}

.board-panel h3 {
  margin: 0 0 8px;
  color: #effbff;
  font-size: clamp(13px, 1.05vw, 18px);
}

.board-org-map,
.board-people,
.board-chart,
.board-donut {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.board-panel h3 span {
  color: #b7d8ff;
  font-size: 13px;
  font-weight: 500;
}

.rank-head,
.board-rank p {
  display: grid;
  grid-template-columns: 42px 1fr 110px;
  align-items: center;
  gap: 8px;
}

.board-scroll-viewport {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.board-rank .board-scroll-viewport {
  height: calc(100% - 48px);
}

.board-scroll-track {
  will-change: transform;
}

.board-scroll-track.auto-scroll {
  animation: boardScroll 14s linear infinite;
}

.board-scroll-track.auto-scroll.slow {
  animation-duration: 18s;
}

.board-scroll-track.auto-scroll:hover {
  animation-play-state: paused;
}

@keyframes boardScroll {
  0%, 12% {
    transform: translateY(0);
  }
  88%, 100% {
    transform: translateY(-50%);
  }
}

.rank-head {
  color: #37c8ff;
  font-size: 12px;
  border-bottom: 1px solid rgba(76, 184, 255, 0.2);
  padding-bottom: 4px;
}

.board-rank p {
  margin: clamp(4px, 0.45vh, 7px) 0;
  color: #d8eeff;
  font-size: clamp(12px, 0.82vw, 15px);
}

.board-rank b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff9440, #ff6531);
  color: #fff;
  font-size: 13px;
}

.board-rank p:nth-of-type(3) b { background: linear-gradient(180deg, #47d68d, #22a96a); }
.board-rank p:nth-of-type(n+4) b { background: linear-gradient(180deg, #4aa8ff, #2368d8); }

.board-rank strong {
  color: #fff;
  text-align: right;
}

.board-core {
  height: 100%;
  display: grid;
  place-items: center;
}

.core-orbit {
  width: min(48vh, 26vw, 430px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  border: 2px solid rgba(0, 210, 255, 0.7);
  background:
    radial-gradient(circle, rgba(0, 238, 255, 0.16) 0 42%, transparent 43%),
    conic-gradient(from 20deg, rgba(0, 240, 255, 0.08), #1cc8ff, rgba(0, 240, 255, 0.08), #0b62ff, rgba(0, 240, 255, 0.08));
  box-shadow: 0 0 42px rgba(0, 200, 255, 0.38), inset 0 0 52px rgba(0, 172, 255, 0.28);
}

.core-orbit span {
  color: #8eeaff;
  font-size: 20px;
}

.core-orbit strong {
  color: #bff7ff;
  font-size: clamp(58px, 5vw, 88px);
  text-shadow: 0 0 18px rgba(0, 236, 255, 0.8);
}

.core-orbit em {
  color: #e5fbff;
  font-style: normal;
  font-size: 30px;
}

.board-core-badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.board-core-badges article {
  position: absolute;
  width: clamp(108px, 7.8vw, 148px);
  height: clamp(108px, 7.8vw, 148px);
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(46, 191, 255, 0.7);
  border-radius: 50%;
  background: rgba(5, 39, 83, 0.72);
  box-shadow: inset 0 0 24px rgba(46, 191, 255, 0.18);
  text-align: center;
}

.board-core-badges article:nth-child(1) { left: 5%; top: 8%; }
.board-core-badges article:nth-child(2) { right: 5%; top: 8%; }
.board-core-badges article:nth-child(3) { left: 5%; bottom: 10%; }
.board-core-badges article:nth-child(4) { right: 5%; bottom: 10%; }

.board-core-badges b {
  color: #fff;
  font-size: 28px;
}

.board-core-badges span,
.board-core-badges em {
  color: #d4edff;
  font-style: normal;
  font-size: 13px;
}

.board-core-badges em {
  color: #22f59a;
  font-weight: 800;
}

.board-org-summary {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 46%);
  gap: 12px;
  align-items: center;
  min-height: 0;
}

.board-org-summary h3 {
  margin: 0;
}

.org-stat-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.org-stat-tabs p {
  position: relative;
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(0, 179, 255, 0.3);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(0, 108, 188, 0.28), rgba(2, 23, 58, 0.58));
  color: #cceaff;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.org-stat-tabs span {
  font-size: 11px;
  color: #a5c9ec;
}

.org-stat-tabs b {
  color: #4fd8ff;
  font-size: 22px;
  line-height: 1;
}

.board-org-tree {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.org-root-node {
  position: relative;
  z-index: 2;
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-self: center;
  border: 2px solid rgba(64, 213, 255, 0.84);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 109, 190, 0.72), rgba(3, 29, 71, 0.88));
  box-shadow: 0 0 24px rgba(33, 183, 255, 0.32), inset 0 0 22px rgba(33, 183, 255, 0.22);
  color: #eaf9ff;
  text-align: center;
}

.org-root-node i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #68d9ff;
}

.org-root-node b {
  font-size: 13px;
}

.org-root-node span {
  color: #b5d8ff;
  font-size: 11px;
}

.org-branch-line {
  position: absolute;
  left: 108px;
  top: 20%;
  bottom: 20%;
  width: 48px;
  border-left: 2px solid rgba(223, 243, 255, 0.9);
  border-top: 2px solid rgba(223, 243, 255, 0.9);
  border-bottom: 2px solid rgba(223, 243, 255, 0.9);
  border-radius: 8px 0 0 8px;
}

.org-branch-line::before,
.org-branch-line::after {
  content: "";
  position: absolute;
  left: -2px;
  width: 48px;
  border-top: 2px solid rgba(223, 243, 255, 0.9);
}

.org-branch-line::before {
  top: 33%;
}

.org-branch-line::after {
  top: 66%;
}

.org-node-list {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: block;
  padding: 2px 4px 2px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 216, 255, 0.65) rgba(4, 26, 61, 0.5);
}

.org-node-list::-webkit-scrollbar {
  width: 6px;
}

.org-node-list::-webkit-scrollbar-thumb {
  background: rgba(79, 216, 255, 0.65);
  border-radius: 999px;
}

.board-org-branch {
  position: relative;
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.board-org-branch:first-child {
  margin-top: 0;
}

.board-org-children {
  display: grid;
  gap: 6px;
  margin-left: clamp(12px, 1vw, 20px);
  padding-left: 10px;
  border-left: 1px solid rgba(223, 243, 255, 0.38);
}

.board-org-children.collapsed {
  display: none;
}

.board-org-node {
  position: relative;
  display: grid;
  grid-template-columns: 22px 42px minmax(90px, 1fr) minmax(74px, 88px) minmax(88px, 106px);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 179, 255, 0.32);
  border-radius: 8px;
  background: rgba(3, 28, 65, 0.78);
  padding: clamp(7px, 0.55vw, 10px) clamp(8px, 0.75vw, 12px);
  margin-left: calc(var(--depth, 0) * 6px);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.board-org-node.active,
.board-org-node:hover {
  border-color: rgba(79, 216, 255, 0.85);
  background: rgba(4, 44, 96, 0.86);
  box-shadow: inset 0 0 18px rgba(0, 179, 255, 0.12);
}

.board-org-node::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 18px;
  border-top: 2px solid rgba(223, 243, 255, 0.9);
}

.org-expand-btn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 216, 255, 0.4);
  border-radius: 50%;
  background: rgba(5, 33, 76, 0.8);
  color: #e7f8ff;
  font-size: 13px;
  line-height: 1;
  padding: 0;
}

.org-expand-btn.empty {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

.board-org-node i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(49, 157, 255, 0.22);
  color: #52c6ff;
}

.board-org-node.member i {
  color: #26f6a5;
  background: rgba(38, 246, 165, 0.14);
}

.board-org-node b {
  color: #fff;
}

.org-node-name {
  min-width: 0;
}

.org-node-name b,
.org-node-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-org-node span {
  color: #a8c8ea;
}

.board-org-node em {
  color: #35f69f;
  font-style: normal;
}

.board-org-node p {
  margin: 0;
  display: grid;
  gap: 2px;
  border-left: 1px solid rgba(70, 165, 255, 0.22);
  padding-left: 8px;
}

.board-org-node strong {
  color: #e7f8ff;
}

.board-org-overview {
  display: grid;
  grid-template-columns: 160px repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  min-height: 78px;
  margin-top: 0;
  border: 1px solid rgba(0, 179, 255, 0.25);
  border-radius: 6px;
  background: rgba(3, 28, 65, 0.42);
  padding: 8px;
}

.board-org-map {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.board-org-overview h3 {
  grid-column: auto;
  margin-bottom: 0;
  color: #68d9ff;
}

.board-org-overview p {
  margin: 0;
  display: grid;
  gap: 2px;
  color: #bcdfff;
}

.board-org-overview b {
  color: #fff;
  font-size: clamp(20px, 1.5vw, 28px);
}

.board-flow-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  height: 100%;
}

.board-flow-metrics p {
  margin: 0;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid rgba(0, 179, 255, 0.22);
  border-radius: 8px;
  background: rgba(0, 121, 255, 0.1);
  color: #bcdfff;
  min-height: 0;
}

.board-flow-metrics b {
  color: #fff;
  font-size: clamp(22px, 1.9vw, 34px);
}

.board-flow-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.board-mini-flows {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.board-mini-flows section {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.board-mini-flows > section > b {
  display: block;
  color: #4fd8ff;
  margin-bottom: 4px;
}

.board-flow-card .board-scroll-viewport {
  height: calc(100% - 28px);
}

.board-mini-flows .board-scroll-viewport {
  height: 100%;
  overflow: hidden;
}

.board-flow-list p {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  border-bottom: 1px solid rgba(79, 185, 255, 0.16);
  padding-bottom: 7px;
  color: #d8eeff;
}

.board-flow-list {
  min-height: 0;
}

.board-flow-list b,
.board-flow-list em {
  color: #fff;
  font-style: normal;
  font-weight: 800;
}

.board-flow-list span {
  color: #9fd4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-chart svg {
  width: 100%;
  height: calc(100% - 24px);
}

.board-chart line {
  stroke: rgba(112, 190, 255, 0.16);
}

.board-chart polyline {
  fill: none;
  stroke: #34d5ff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-chart circle {
  fill: #082758;
  stroke: #82eeff;
  stroke-width: 3;
}

.board-chart text {
  fill: #fff;
  font-weight: 800;
  text-anchor: middle;
}

.board-chart .axis {
  fill: #bdd9ff;
  font-weight: 500;
}

.board-donut,
.board-people {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 12px;
}

.board-donut h3,
.board-people h3 {
  grid-column: 1 / -1;
}

.board-donut-ring,
.gender-ring {
  width: 136px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#1b73ff 0 78%, #3fd192 78% 94%, #ff9a38 94% 100%);
  box-shadow: 0 0 22px rgba(50, 168, 255, 0.25);
}

.gender-ring {
  background: conic-gradient(#1b73ff 0 46.5%, #f05f9a 46.5% 100%);
}

.board-donut-ring::after,
.gender-ring::after {
  content: "";
  display: block;
  width: 54%;
  aspect-ratio: 1;
  margin: 23%;
  border-radius: 50%;
  background: #061631;
}

.board-donut p,
.age-bars p {
  display: grid;
  grid-template-columns: 52px 62px 1fr;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
  color: #e3f4ff;
}

.board-donut strong {
  text-align: right;
}

.age-bars i {
  height: 12px;
  width: var(--w);
  border-radius: 8px;
  background: linear-gradient(90deg, #1b73ff, #6fe8cb);
}

.age-bars {
  max-height: 120px;
  overflow: hidden;
}

.age-bars.auto-scroll {
  animation: boardScroll 12s linear infinite;
}

.age-bars b {
  color: #fff;
  text-align: right;
}

.board-ticker {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 260px;
  align-items: center;
  gap: 14px;
  border-top: 1px solid rgba(0, 179, 255, 0.38);
  background: rgba(1, 16, 41, 0.82);
  color: #cdeaff;
  padding: 0 12px;
}

.board-ticker b {
  color: #fff;
  text-align: center;
  border-radius: 16px;
  background: rgba(0, 130, 255, 0.42);
  padding: 5px 12px;
}

.board-ticker em {
  justify-self: end;
  font-style: normal;
  color: #d5e8ff;
}

.board2-screen {
  background: #020b1e;
}

.screen2-shell {
  width: 100vw;
  height: 100vh;
  padding: clamp(6px, 0.55vw, 10px);
  color: #eef9ff;
  background:
    radial-gradient(circle at 50% 44%, rgba(0, 143, 255, 0.24), transparent 28%),
    radial-gradient(circle at 50% 56%, rgba(34, 232, 255, 0.12), transparent 22%),
    linear-gradient(180deg, #051a3f 0%, #030d24 48%, #020817 100%);
  display: grid;
  grid-template-rows: clamp(54px, 6.2vh, 68px) clamp(86px, 10.2vh, 104px) minmax(0, 1fr) clamp(30px, 3.5vh, 38px);
  gap: clamp(6px, 0.55vw, 9px);
  overflow: hidden;
}

.screen2-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(39, 188, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 188, 255, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, #000 18%, transparent 78%);
}

.screen2-top,
.screen2-stats,
.screen2-grid,
.screen2-ticker {
  position: relative;
  z-index: 1;
}

.screen2-top {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(500px, 2fr) minmax(210px, 0.76fr);
  align-items: center;
  gap: 12px;
}

.screen2-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.screen2-brand img {
  width: clamp(48px, 4.2vw, 70px);
  max-height: 46px;
  object-fit: contain;
}

.screen2-brand b,
.screen2-meta b {
  display: block;
  color: #fff;
  font-size: clamp(13px, 1vw, 18px);
}

.screen2-brand span,
.screen2-meta span {
  color: #c4e5ff;
  font-size: clamp(10px, 0.75vw, 13px);
}

.screen2-title {
  text-align: center;
}

.screen2-title h1 {
  margin: 0;
  color: #f7fbff;
  text-shadow: 0 0 18px rgba(89, 206, 255, 0.86);
  font-size: clamp(24px, 2.25vw, 38px);
  letter-spacing: 0;
}

.screen2-title p {
  margin: 2px 0 0;
  color: #12f1ff;
  font-size: clamp(11px, 0.9vw, 16px);
}

.screen2-meta {
  justify-self: end;
  text-align: right;
  display: grid;
  gap: 3px;
}

.screen2-meta button,
.screen2-rank h3 button,
.screen2-live h3 button {
  border-color: rgba(33, 183, 255, 0.5);
  background: rgba(0, 75, 154, 0.28);
  color: #dff7ff;
  padding: 5px 12px;
}

.screen2-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 0.75vw, 12px);
  min-height: 0;
}

.screen2-stat,
.screen2-panel {
  border: 1px solid rgba(0, 180, 255, 0.62);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(5, 40, 86, 0.88), rgba(2, 17, 45, 0.86));
  box-shadow: inset 0 0 28px rgba(0, 169, 255, 0.12), 0 0 18px rgba(0, 127, 255, 0.1);
}

.screen2-stat {
  display: grid;
  grid-template-columns: clamp(44px, 4vw, 60px) 1fr;
  align-items: center;
  gap: 8px;
  padding: clamp(8px, 0.72vw, 12px);
  min-width: 0;
}

.screen2-stat > i {
  width: clamp(44px, 4.2vw, 62px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #31ddff;
  background: radial-gradient(circle, rgba(34, 204, 255, 0.32), rgba(0, 75, 160, 0.2));
  box-shadow: inset 0 0 22px rgba(58, 221, 255, 0.26), 0 0 18px rgba(0, 149, 255, 0.22);
}

.screen2-stat svg {
  width: 56%;
  height: 56%;
}

.screen2-stat span {
  color: #d5e9ff;
  font-size: clamp(12px, 0.9vw, 16px);
}

.screen2-stat strong {
  display: block;
  color: #fff;
  font-size: clamp(24px, 2.15vw, 36px);
  line-height: 1.05;
}

.screen2-stat em,
.screen2-business em {
  margin-left: 5px;
  color: #fff;
  font-size: 0.42em;
  font-style: normal;
}

.screen2-stat small {
  color: #81ff9a;
  font-weight: 800;
}

.screen2-stat small.red {
  color: #ff694f;
}

.screen2-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.02fr 1.34fr 1.06fr;
  grid-template-rows: minmax(0, 1.15fr) minmax(0, 0.74fr);
  gap: clamp(6px, 0.55vw, 9px);
}

.screen2-left,
.screen2-right {
  min-height: 0;
  display: grid;
  gap: clamp(6px, 0.55vw, 9px);
}

.screen2-left {
  grid-template-rows: minmax(0, 1.35fr) minmax(0, 0.75fr);
}

.screen2-center {
  min-height: 0;
}

.screen2-right {
  grid-template-rows: minmax(0, 1fr) minmax(0, 0.48fr);
}

.screen2-bottom {
  grid-column: 1 / span 3;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 1.25fr;
  gap: clamp(6px, 0.55vw, 9px);
}

.screen2-panel {
  min-width: 0;
  min-height: 0;
  padding: clamp(8px, 0.68vw, 12px);
  overflow: hidden;
}

.screen2-panel h3 {
  margin: 0 0 7px;
  color: #f3fbff;
  font-size: clamp(13px, 0.95vw, 18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.screen2-rank-head,
.screen2-rank p {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 70px 70px 70px;
  gap: 8px;
  align-items: center;
}

.screen2-rank-head {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(88, 191, 255, 0.24);
  color: #9ccfff;
  font-size: 12px;
}

.screen2-rank p {
  margin: 6px 0;
  color: #dcedff;
  font-size: clamp(12px, 0.82vw, 15px);
}

.screen2-rank p b {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffb45b, #f06722);
  color: #fff;
}

.screen2-rank p:nth-of-type(3) b { background: linear-gradient(180deg, #55d88c, #22aa67); }
.screen2-rank p:nth-of-type(n+4) b { background: linear-gradient(180deg, #48a9ff, #2369d8); }

.screen2-rank span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.screen2-rank strong {
  color: #fff;
  text-align: right;
}

.screen2-coverage > div {
  height: calc(100% - 30px);
  display: grid;
  grid-template-columns: 1fr 38px 1fr 38px 1fr;
  align-items: center;
  text-align: center;
}

.screen2-coverage section {
  display: grid;
  gap: 4px;
  place-items: center;
}

.screen2-coverage i {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #3cd9ff;
  background: rgba(25, 137, 255, 0.24);
}

.screen2-coverage b {
  font-size: clamp(19px, 1.65vw, 28px);
}

.screen2-coverage span {
  color: #c7e6ff;
}

.screen2-coverage em {
  height: 1px;
  background: linear-gradient(90deg, #42d8ff, transparent);
}

.screen2-core {
  height: 100%;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(14, 200, 255, 0.2), transparent 45%);
}

.screen2-orbit {
  position: relative;
  height: calc(100% - 38px);
  min-height: 0;
  display: grid;
  place-items: center;
}

.screen2-orbit::before,
.screen2-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(74, 181, 255, 0.54);
  box-shadow: 0 0 22px rgba(58, 196, 255, 0.32);
}

.screen2-orbit::before {
  width: min(42vh, 33vw);
  max-width: 390px;
  aspect-ratio: 1;
}

.screen2-orbit::after {
  width: min(30vh, 24vw);
  max-width: 278px;
  aspect-ratio: 1;
  border-color: rgba(45, 223, 255, 0.64);
}

.screen2-orbit section {
  position: absolute;
  width: clamp(74px, 6.5vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid rgba(102, 213, 255, 0.78);
  background: radial-gradient(circle, rgba(8, 65, 130, 0.94), rgba(3, 19, 55, 0.9));
  box-shadow: 0 0 22px rgba(38, 182, 255, 0.42);
}

.screen2-orbit section:nth-child(1) { top: 2%; left: 50%; transform: translateX(-50%); }
.screen2-orbit section:nth-child(2) { top: 28%; right: 11%; }
.screen2-orbit section:nth-child(3) { right: 18%; bottom: 10%; }
.screen2-orbit section:nth-child(4) { left: 18%; bottom: 10%; }
.screen2-orbit section:nth-child(5) { top: 28%; left: 11%; }

.screen2-orbit section i {
  color: #dff7ff;
}

.screen2-orbit section em {
  color: #d7e9ff;
  font-style: normal;
}

.screen2-orbit section b {
  color: #fff;
  font-size: clamp(12px, 0.86vw, 15px);
}

.screen2-orbit section span {
  color: #d3efff;
  font-size: clamp(10px, 0.68vw, 12px);
}

.screen2-core-number {
  z-index: 1;
  width: clamp(150px, 14vw, 215px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(circle, rgba(38, 191, 255, 0.42), rgba(5, 24, 61, 0.92));
  box-shadow: inset 0 0 28px rgba(118, 225, 255, 0.55), 0 0 36px rgba(0, 157, 255, 0.5);
}

.screen2-core-number span {
  align-self: end;
  color: #bdeaff;
  font-size: clamp(12px, 0.92vw, 16px);
}

.screen2-core-number strong {
  color: #fff;
  font-size: clamp(38px, 3.6vw, 64px);
  line-height: 1;
}

.screen2-core-number em {
  align-self: start;
  font-size: clamp(16px, 1.3vw, 24px);
  font-style: normal;
}

.screen2-process {
  margin: 0 auto;
  width: min(78%, 720px);
  height: 30px;
  border: 1px solid rgba(52, 190, 255, 0.64);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 0.9vw, 18px);
  color: #56e3ff;
  font-weight: 900;
}

.screen2-business > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.screen2-business section,
.screen2-status p {
  margin: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(58, 177, 255, 0.35);
  border-radius: 8px;
  background: rgba(1, 27, 66, 0.52);
}

.screen2-business section > i,
.screen2-status i {
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #35d8ff;
  background: rgba(0, 87, 170, 0.28);
}

.screen2-business b,
.screen2-status b {
  display: block;
  color: #fff;
  font-size: clamp(19px, 1.55vw, 28px);
}

.screen2-business small,
.screen2-status em {
  color: #8cff9c;
  font-style: normal;
}

.screen2-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.screen2-status p {
  grid-template-columns: 48px 1fr;
}

.screen2-status span {
  color: #bddfff;
}

.screen2-trend svg {
  width: 100%;
  height: calc(100% - 26px);
}

.screen2-trend line {
  stroke: rgba(114, 197, 255, 0.16);
}

.screen2-trend polyline {
  fill: none;
  stroke: #2bdfff;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(45, 219, 255, 0.8));
}

.screen2-trend circle {
  fill: #0a8fff;
  stroke: #c6f8ff;
  stroke-width: 2;
}

.screen2-trend text {
  fill: #fff;
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
}

.screen2-trend .axis {
  fill: #c6d8ef;
  font-size: 10px;
  font-weight: 500;
}

.screen2-disease {
  display: grid;
  grid-template-columns: minmax(104px, 0.72fr) 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px 10px;
}

.screen2-disease h3 {
  grid-column: 1 / -1;
}

.screen2-donut {
  align-self: center;
  justify-self: center;
  width: min(14vh, 132px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#1d72ff 0 29.5%, #34b8ff 29.5% 52.9%, #8f70ff 52.9% 73.7%, #df63bd 73.7% 90.2%, #d9d863 90.2% 97.1%, #ff9848 97.1% 100%);
  position: relative;
}

.screen2-donut::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: #07162f;
  box-shadow: inset 0 0 20px rgba(64, 198, 255, 0.4);
}

.screen2-disease p {
  margin: 2px 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 46px 42px;
  gap: 6px;
  align-items: center;
  color: #dcefff;
}

.screen2-disease p i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.screen2-disease p span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.screen2-live p {
  margin: 4px 0;
  display: grid;
  grid-template-columns: 54px 24px minmax(0, 1fr) 62px;
  gap: 6px;
  align-items: center;
  color: #d9edff;
  border-bottom: 1px solid rgba(93, 183, 255, 0.16);
  padding-bottom: 4px;
  font-size: clamp(11px, 0.78vw, 14px);
}

.screen2-live i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0079d8;
  color: #fff;
  font-style: normal;
  font-size: 12px;
}

.screen2-live b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.screen2-live em {
  justify-self: end;
  color: #5dff8d;
  font-style: normal;
  border: 1px solid rgba(93, 255, 141, 0.38);
  border-radius: 999px;
  padding: 1px 7px;
}

.screen2-ticker {
  min-height: 0;
  border: 1px solid rgba(0, 160, 255, 0.34);
  border-radius: 5px;
  background: rgba(1, 21, 54, 0.84);
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #bed6ef;
}

.screen2-ticker b {
  color: #59dcff;
}

.screen2-ticker strong {
  color: #fff;
}

/* Screen 2 layout correction: keep all panels inside a 16:9 full-screen frame. */
.screen2-shell {
  padding: 8px 12px;
  grid-template-rows: 58px 98px minmax(0, 1fr) 34px;
  gap: 8px;
}

.screen2-top {
  grid-template-columns: 260px minmax(640px, 1fr) 220px;
}

.screen2-title h1 {
  font-size: clamp(28px, 2.05vw, 40px);
  line-height: 1.05;
}

.screen2-title p {
  font-size: clamp(11px, 0.78vw, 14px);
  line-height: 1.1;
}

.screen2-stats {
  gap: 8px;
}

.screen2-stat {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 12px;
}

.screen2-stat > i {
  width: 54px;
}

.screen2-stat strong {
  font-size: clamp(26px, 2vw, 38px);
}

.screen2-stat small {
  font-size: 13px;
}

.screen2-grid {
  grid-template-columns: 0.98fr 1.18fr 1.04fr;
  grid-template-rows: minmax(0, 1.16fr) minmax(0, 0.78fr);
  gap: 8px;
}

.screen2-left {
  grid-template-rows: minmax(0, 1.22fr) minmax(0, 0.78fr);
}

.screen2-right {
  grid-template-rows: minmax(0, 1fr) minmax(0, 0.52fr);
}

.screen2-panel {
  padding: 8px 11px;
}

.screen2-panel h3 {
  margin-bottom: 6px;
  line-height: 1.1;
}

.screen2-rank-head,
.screen2-rank p {
  grid-template-columns: 42px minmax(0, 1fr) 62px 62px 58px;
}

.screen2-rank p {
  margin: 6px 0;
  line-height: 1.15;
}

.screen2-rank p b {
  width: 24px;
  height: 24px;
}

.screen2-coverage > div {
  height: calc(100% - 28px);
}

.screen2-coverage i {
  width: 40px;
  height: 40px;
}

.screen2-coverage b {
  font-size: 24px;
  line-height: 1;
}

.screen2-coverage span {
  font-size: 13px;
}

.screen2-orbit {
  height: calc(100% - 34px);
}

.screen2-orbit::before {
  width: min(37vh, 30vw);
  max-width: 350px;
}

.screen2-orbit::after {
  width: min(27vh, 22vw);
  max-width: 250px;
}

.screen2-orbit section {
  width: clamp(68px, 5.6vw, 88px);
  padding: 5px;
}

.screen2-orbit section:nth-child(1) {
  top: 1%;
}

.screen2-orbit section:nth-child(2) {
  top: 29%;
  right: 9%;
}

.screen2-orbit section:nth-child(3) {
  right: 15%;
  bottom: 9%;
}

.screen2-orbit section:nth-child(4) {
  left: 15%;
  bottom: 9%;
}

.screen2-orbit section:nth-child(5) {
  top: 29%;
  left: 9%;
}

.screen2-orbit section .svg-icon {
  width: 18px;
  height: 18px;
}

.screen2-orbit section em,
.screen2-orbit section span {
  font-size: 10px;
  line-height: 1.05;
}

.screen2-orbit section b {
  font-size: 13px;
  line-height: 1.05;
}

.screen2-core-number {
  width: clamp(138px, 12vw, 190px);
}

.screen2-core-number span {
  font-size: 13px;
}

.screen2-core-number strong {
  font-size: clamp(38px, 3.2vw, 58px);
}

.screen2-process {
  height: 28px;
  width: min(78%, 620px);
  font-size: 15px;
}

.screen2-business > div {
  gap: 8px;
}

.screen2-business section {
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 10px;
}

.screen2-business section > i,
.screen2-status i {
  width: 40px;
}

.screen2-business b,
.screen2-status b {
  font-size: clamp(22px, 1.65vw, 30px);
  line-height: 1.05;
}

.screen2-business span,
.screen2-status span,
.screen2-business small,
.screen2-status em {
  font-size: 13px;
}

.screen2-status {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.screen2-status p {
  grid-template-columns: 44px minmax(0, 1fr);
  padding: 10px;
}

.screen2-status b {
  white-space: nowrap;
  font-size: clamp(20px, 1.45vw, 26px);
}

.screen2-bottom {
  grid-template-columns: 1.05fr 0.95fr 1.25fr;
}

.screen2-trend svg {
  height: calc(100% - 24px);
}

.screen2-donut {
  width: min(12vh, 118px);
}

.screen2-disease p {
  grid-template-columns: 12px minmax(0, 1fr) 44px 42px;
  font-size: 13px;
  line-height: 1.15;
}

.screen2-live p {
  margin: 3px 0;
  grid-template-columns: 52px 22px minmax(0, 1fr) 60px;
  font-size: 13px;
  line-height: 1.1;
}

.screen2-live em {
  padding: 1px 6px;
  font-size: 12px;
}

.screen2-ticker {
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  font-size: 14px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head > div:first-child {
  flex: 0 0 auto;
  min-width: 128px;
}

.page-head p,
.page-head h2 {
  margin: 0;
}

.page-head h2 {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.page-title-note {
  color: #8a96ab;
  font-size: 16px;
  font-weight: 600;
}

.page-head p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}

.actions {
  display: flex;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.actions input {
  width: 300px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
  min-width: 0;
}

.stat-card {
  min-width: 0;
  min-height: 108px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #edf2fb;
  box-shadow: var(--shadow);
  padding: 14px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover,
.dash-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(25, 68, 135, 0.11);
}

.stat-card i,
.quick-icon {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-size: 0;
  font-weight: 800;
  color: currentColor;
  overflow: hidden;
}

.stat-card i::before,
.stat-card i::after,
.quick-icon::before,
.quick-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.stat-card.blue i,
.quick-icon.blue {
  background: #eaf2ff;
  color: #176bff;
}

.stat-card.green i,
.quick-icon.green {
  background: #e8f8ef;
  color: #16b981;
}

.stat-card.purple i,
.quick-icon.purple {
  background: #f0ebff;
  color: #7b61ff;
}

.stat-card.orange i,
.quick-icon.orange {
  background: #fff1e4;
  color: #ff7a1a;
}

.stat-card.cyan i {
  background: #e7f8fb;
  color: #16b8c7;
}

.quick-icon.cyan {
  background: #e7f8fb;
  color: #16b8c7;
}

.icon-pie::before {
  inset: 11px;
  border: 3px solid currentColor;
  border-radius: 50%;
  opacity: 0.9;
}

.icon-pie::after {
  width: 14px;
  height: 14px;
  right: 10px;
  top: 10px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.icon-users::before {
  width: 12px;
  height: 12px;
  left: 13px;
  top: 13px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 14px 4px 0 -1px currentColor;
}

.icon-users::after {
  width: 24px;
  height: 12px;
  left: 13px;
  top: 26px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  opacity: 0.95;
}

.icon-doctor::before {
  width: 10px;
  height: 10px;
  left: 20px;
  top: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 12px 0 2px currentColor;
}

.icon-doctor::after {
  width: 16px;
  height: 10px;
  left: 17px;
  top: 30px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.icon-clipboard::before {
  width: 20px;
  height: 24px;
  left: 15px;
  top: 14px;
  border: 3px solid currentColor;
  border-radius: 4px;
}

.icon-clipboard::after {
  width: 12px;
  height: 7px;
  left: 19px;
  top: 8px;
  border: 3px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.icon-send::before {
  width: 26px;
  height: 20px;
  left: 13px;
  top: 15px;
  background: currentColor;
  clip-path: polygon(0 46%, 100% 0, 66% 50%, 100% 100%);
}

.icon-send::after {
  width: 10px;
  height: 2px;
  left: 23px;
  top: 24px;
  background: #fff;
  transform: rotate(-18deg);
  transform-origin: left center;
}

.icon-inbox::before {
  width: 24px;
  height: 18px;
  left: 13px;
  top: 16px;
  border: 3px solid currentColor;
  border-radius: 4px;
}

.icon-inbox::after {
  width: 12px;
  height: 6px;
  left: 19px;
  top: 22px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.stat-card span {
  display: block;
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

.stat-card strong {
  display: block;
  color: #001b4d;
  font-size: 32px;
  line-height: 1.1;
  margin: 8px 0;
  white-space: nowrap;
}

.stat-card small {
  display: block;
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.expire-card {
  grid-template-columns: 46px minmax(0, 1fr);
}

.expire-card .expire-lines {
  display: grid;
  gap: 3px;
}

.expire-card span {
  font-size: 13px;
  color: #667085;
}

.expire-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  min-width: 0;
}

.expire-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.panel {
  border-radius: 10px;
  background: #fff;
  border: 1px solid #edf0f4;
  box-shadow: var(--shadow);
  padding: 26px;
  min-height: 400px;
}

.panel.board-screen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #020b1e;
  box-shadow: none;
  overflow: hidden;
}

.detail-page-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  position: relative;
}

.dashboard-panel {
  display: grid;
  grid-template-columns: minmax(620px, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.dash-left,
.dash-right {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.dash-left {
  grid-column: 1;
  grid-row: 1;
}

.dash-right {
  grid-column: 2;
  grid-row: 1;
}

.org-access-section {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.org-access-card {
  min-height: 134px;
}

.org-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.org-pill-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #1d72ff;
  border-radius: 6px;
  color: #0b63ff;
  background: #f7fbff;
  font-weight: 700;
}

.org-pill-list em {
  color: var(--muted);
  font-style: normal;
}

.dash-card {
  border: 1px solid #edf2fb;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 26px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-card h3,
.dash-card p {
  margin: 0;
}

.dash-card h3 {
  font-size: 20px;
}

.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dash-card-head p {
  color: #667085;
  margin-top: 10px;
}

.trend-chart {
  height: 250px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 14px;
  margin-top: 28px;
  padding: 0 10px 28px;
  border-bottom: 1px solid #dfe7f2;
  background: repeating-linear-gradient(to top, transparent 0 48px, #eef2f7 49px 50px);
}

.trend-chart span {
  position: relative;
  height: var(--h);
  min-height: 22px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #1d72ff, #dbeafe);
}

.trend-chart b {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  color: #52647f;
  font-size: 16px;
}

.trend-chart i {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  color: #667085;
  font-style: normal;
  white-space: nowrap;
  word-break: keep-all;
  min-width: 44px;
  text-align: center;
}

.trend-line-chart {
  height: 250px;
  margin-top: 20px;
  position: relative;
}

.trend-line-chart svg {
  width: 100%;
  height: 218px;
  display: block;
}

.trend-line-chart line {
  stroke: #edf2f7;
  stroke-width: 1;
}

.trend-line-chart polygon {
  fill: url(#trendArea);
}

.trend-line-chart polyline {
  fill: none;
  stroke: #1d72ff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line-chart circle {
  fill: #1d72ff;
  stroke: #fff;
  stroke-width: 4;
  filter: drop-shadow(0 6px 10px rgba(29, 114, 255, 0.25));
}

.trend-line-chart text {
  fill: #52647f;
  font-size: 16px;
  font-weight: 800;
  text-anchor: middle;
}

.trend-axis {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid #dfe7f2;
  padding-top: 10px;
  color: #667085;
  text-align: center;
}

.dashboard-panel .quick-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.weekly-report {
  display: grid;
  gap: 16px;
}

.weekly-report h2,
.weekly-report p {
  margin: 0;
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.weekly-grid span {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  color: #52647f;
}

.weekly-grid strong {
  display: block;
  margin-top: 8px;
  color: #071a3d;
  font-size: 28px;
}

.dashboard-panel .quick-grid button {
  position: relative;
  min-height: 94px;
  display: grid;
  grid-template-columns: 58px 1fr 34px;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  padding: 16px 22px;
}

.dashboard-panel .quick-grid i {
  grid-row: 1 / 3;
  grid-column: 1;
}

.dashboard-panel .quick-grid b {
  grid-column: 2;
  grid-row: 1;
  font-size: 17px;
  overflow-wrap: normal;
  word-break: keep-all;
}

.dashboard-panel .quick-grid span {
  grid-column: 2;
  grid-row: 2;
  color: #667085;
  line-height: 1.5;
}

.dashboard-panel .quick-grid em {
  grid-column: 3;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f0f5ff;
  color: #173b7a;
  font-style: normal;
  font-size: 24px;
}

.ratio-card {
  position: relative;
  min-height: 220px;
  padding-left: 30px;
}

.donut {
  float: left;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  margin: 24px 42px 10px 20px;
  background: conic-gradient(#1677ff 0 78%, #36c98e 78% 94%, #ff8a1f 94% 100%);
}

.donut::after {
  content: "";
  display: block;
  width: 72px;
  height: 72px;
  margin: 30px;
  border-radius: 50%;
  background: #fff;
}

.ratio-card p,
.activity-card p {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 36px;
  color: #52647f;
}

.ratio-card p b {
  color: #071a3d;
  min-width: 40px;
}

.ratio-card p strong {
  margin-left: auto;
  color: #071a3d;
}

.activity-card p {
  border-bottom: 1px solid #edf2fb;
  padding: 10px 0;
}

.activity-card p:last-child {
  border-bottom: 0;
}

.activity-card i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef5ff;
  color: #1677ff;
  font-style: normal;
  font-weight: 800;
}

.activity-card span {
  margin-left: auto;
  color: #98a2b3;
}

.todo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.todo-head p {
  margin-top: 8px;
  color: #667085;
  line-height: 1.5;
}

.todo-card .todo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.todo-card .todo-item {
  position: relative;
  min-height: 124px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px 12px;
  justify-content: stretch;
  overflow: hidden;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 62%);
  border-color: #fed7aa;
  color: #071a3d;
  padding: 18px;
  text-align: left;
}

.todo-card .todo-item::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 122, 26, 0.08);
}

.todo-card .todo-item.urgent {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 62%);
  border-color: #fecdd3;
}

.todo-card .todo-item.calm {
  background: linear-gradient(135deg, #ecfdf3 0%, #ffffff 62%);
  border-color: #bbf7d0;
}

.todo-card .todo-item i {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: #f97316;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.16);
}

.todo-card .todo-item.urgent i {
  color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.16);
}

.todo-card .todo-item.calm i {
  color: #16b981;
  box-shadow: inset 0 0 0 1px rgba(22, 185, 129, 0.16);
}

.todo-card .todo-item span {
  color: #182b4d;
  font-size: 16px;
  font-weight: 800;
}

.todo-card .todo-item b {
  grid-column: 3;
  grid-row: 1 / 3;
  color: #ef4444;
  font-size: 34px;
  line-height: 1;
}

.todo-card .todo-item em {
  color: #667085;
  font-style: normal;
  line-height: 1.45;
}

.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 20px;
  position: relative;
  z-index: 3;
}

.patient-card {
  width: min(468px, 100%);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #e7eef9;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 62%, #f7faff 100%);
  box-shadow: 0 14px 30px rgba(25, 68, 135, 0.09);
  padding: 18px 24px;
}

.avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #f4f8ff, #def2ff);
  color: #194487;
  font-size: 28px;
  font-weight: 800;
}

.avatar-figure {
  position: relative;
  overflow: hidden;
  border: 1px solid #dce8fa;
}

.avatar-figure .svg-icon {
  width: 46px;
  height: 46px;
}

.avatar-figure::before,
.avatar-figure::after,
.gender-symbol::before,
.phone-icon::before,
.phone-icon::after,
.info-icon::before,
.info-icon::after {
  display: none !important;
}

.avatar-figure::before,
.avatar-figure::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.avatar-figure::before {
  top: 5px;
  width: 38px;
  height: 36px;
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 62%, #f8d8bd 0 10px, transparent 11px),
    radial-gradient(circle at 50% 15%, #1f2a44 0 16px, #2a3b61 17px 100%);
}

.avatar-figure::after {
  bottom: -4px;
  width: 54px;
  height: 28px;
  border-radius: 28px 28px 12px 12px;
  background: linear-gradient(180deg, #98e3ea, #56c2d6);
}

.patient-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.05;
}

.patient-card p {
  margin: 0;
  color: #64748b;
}

.patient-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  margin-bottom: 4px !important;
}

.gender-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8a96ab;
  font-size: 15px;
}

.gender-tag.male .gender-symbol::before {
  content: "♂";
  color: #2b6ff8;
}

.gender-tag.female .gender-symbol::before {
  content: "♀";
  color: #ff5d8f;
}

.gender-tag.unknown .gender-symbol::before {
  content: "•";
  color: #98a2b3;
}

.gender-symbol::before {
  font-size: 20px;
  line-height: 1;
}

.gender-symbol .svg-icon {
  width: 18px;
  height: 18px;
}

.patient-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #8a96ab !important;
}

.phone-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.phone-icon .svg-icon {
  width: 16px;
  height: 16px;
}

.phone-icon::before,
.phone-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.phone-icon::before {
  left: 3px;
  top: 2px;
  width: 8px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-bottom: 0;
  border-radius: 8px;
  transform: rotate(45deg);
}

.phone-icon::after {
  left: 1px;
  top: 9px;
  width: 4px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.primary-btn {
  background: #1677ff;
  color: #fff;
  border-color: #1677ff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
  font-weight: 700;
}

.primary-btn:hover {
  background: #0958d9;
}

.ghost-btn {
  min-width: 148px;
  border-color: #d7e2f3;
  background: #fff;
  color: #0b57d0;
  font-weight: 700;
}

.detail-info-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.detail-info-row article {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 80px;
  border: 1px solid #e7eef9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(25, 68, 135, 0.08);
  padding: 16px 20px;
}

.detail-info-row article > div {
  min-width: 0;
}

.info-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eef4ff;
  color: #2b6ff8;
  display: grid;
  place-items: center;
}

.info-icon .svg-icon {
  width: 22px;
  height: 22px;
}

.info-icon::before,
.info-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.doctor-icon::before {
  left: 17px;
  top: 9px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.doctor-icon::after {
  left: 13px;
  top: 21px;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.time-icon::before {
  left: 13px;
  top: 13px;
  width: 18px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.time-icon::after {
  left: 17px;
  top: 8px;
  width: 10px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.exam-icon::before {
  left: 13px;
  top: 10px;
  width: 18px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.exam-icon::after {
  left: 17px;
  top: 6px;
  width: 10px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.status-icon::before {
  left: 12px;
  top: 12px;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

.status-icon::after {
  left: 25px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.detail-info-row span {
  display: block;
  color: #64748b;
  font-size: 13px;
  margin-bottom: 6px;
}

.detail-info-row strong {
  display: block;
  font-size: 16px;
}

.status-chip {
  display: inline-flex !important;
  width: fit-content;
  border-radius: 999px;
  background: #e8f8ef;
  color: #087443;
  padding: 4px 12px;
}

.detail-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.detail-main-grid > div,
.report-preview-card,
.insight-row article,
.result-card {
  box-shadow: 0 10px 30px rgba(25, 68, 135, 0.08);
}

.detail-main-grid > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px 18px;
}

.report-preview-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.report-preview-card h4 {
  margin: 0 0 14px;
}

.report-preview-card img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}

.report-side-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.report-side-summary p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.report-side-summary span {
  color: #667085;
}

.report-side-summary b {
  color: #071a3d;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.quick-grid button {
  min-height: 124px;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  min-width: 54px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.grade-good {
  background: #e8f8ef;
  color: #087443;
}

.grade-mid {
  background: #fff7df;
  color: #a15c00;
}

.grade-bad {
  background: #ffeceb;
  color: #b42318;
}

.report-template {
  width: min(920px, 100%);
  margin: 0 auto;
  background: #fff;
  color: #222;
  padding: 24px 34px;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.report-header {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid #1d2939;
  padding-bottom: 12px;
}

.report-header strong {
  display: block;
  color: #008fb3;
  font-size: 20px;
}

.report-header span {
  color: #667085;
  font-size: 11px;
  text-transform: uppercase;
}

.report-template h1 {
  text-align: center;
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.2;
}

.report-template h2 {
  text-align: center;
  margin: 0;
  color: #475467;
  font-size: 14px;
  font-weight: 600;
}

.report-logo {
  justify-self: end;
  max-width: 150px;
  max-height: 58px;
  object-fit: contain;
}

.report-logo-placeholder {
  justify-self: end;
  color: #008fb3;
  font-weight: 800;
  font-size: 22px;
}

.report-full-image {
  display: block;
  width: min(620px, 100%);
  margin: 8px auto 16px;
  border: 1px solid #aaa;
}

.report-template .report-meta,
.report-template .report-summary {
  border-bottom: 1px solid #d0d5dd;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 16px;
  padding: 10px 0;
  margin: 10px 0 14px;
  font-size: 12px;
}

.report-template .report-meta span,
.report-template .report-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-template .report-eyes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0 14px;
}

.report-template .report-eyes.four {
  grid-template-columns: repeat(2, 1fr);
}

.report-eye-card {
  margin: 0;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  overflow: hidden;
  break-inside: avoid;
}

.report-eye-card figcaption {
  padding: 7px 9px;
  background: #f2f4f7;
  font-weight: 800;
  color: #101828;
}

.report-template .report-eyes img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0;
  border: 0;
  display: block;
}

.report-exam-section {
  break-inside: avoid;
  border-top: 1px solid #98a2b3;
  padding-top: 10px;
  margin-top: 14px;
}

.report-exam-section h3,
.report-exam-section h4 {
  margin: 8px 0;
  color: #101828;
}

.report-exam-section .table-wrap {
  margin-top: 8px;
  overflow: visible;
}

.report-advice {
  display: grid;
  gap: 8px;
  border-top: 1px solid #98a2b3;
  margin-top: 18px;
  padding-top: 12px;
}

.report-advice p,
.expert-panel p {
  min-height: 68px;
  margin: 0 0 10px;
  white-space: pre-wrap;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  padding: 12px;
  color: #344054;
}

.report-template table {
  white-space: normal;
  font-size: 11px;
  table-layout: fixed;
}

.report-template th,
.report-template td {
  padding: 6px 8px;
  overflow-wrap: anywhere;
}

.report-footer {
  border-top: 1px solid #d0d5dd;
  color: #667085;
  font-size: 11px;
  margin-top: 12px;
  padding-top: 8px;
}

.print-only-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: #fff !important;
  }

  body * {
    visibility: hidden;
  }

  .modal,
  .modal *,
  .report-template,
  .report-template *,
  .referral-print,
  .referral-print * {
    visibility: visible;
  }

  .modal {
    position: absolute;
    inset: 0 auto auto 0;
    display: block;
    padding: 0;
    background: #fff;
    width: 100%;
    overflow: visible;
  }

  .modal-card {
    width: 100%;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
    border: 0;
  }

  .modal-card header,
  .print-only-actions {
    display: none;
  }

  #modalBody {
    padding: 0;
    overflow: visible;
  }

  .report-template,
  .referral-print {
    border: 0;
    width: 100%;
    padding: 0;
    font-size: 11px;
  }

  .report-header {
    break-inside: avoid;
  }

  .report-template h1 {
    font-size: 20px;
  }

  .report-template .report-meta,
  .report-template .report-summary {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px 10px;
    font-size: 10.5px;
  }

  .report-template .report-eyes {
    gap: 8px;
  }

  .report-template .report-eyes img {
    max-height: 54mm;
    object-fit: contain;
    background: #f8fafc;
  }

  .report-template .report-eyes.four img {
    max-height: 38mm;
  }

  .report-template table {
    font-size: 9.5px;
  }

  .report-advice p {
    min-height: 28mm;
  }
}

.quick-grid button:hover {
  border-color: var(--blue);
  background: #f7faff;
}

.quick-grid b {
  font-size: 20px;
}

.quick-grid span {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2f7;
  color: #174ea6;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.section-note {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #f5f9ff;
  color: #344054;
  line-height: 1.6;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f3f6fa;
  color: #344054;
  font-size: 13px;
}

tbody tr:hover {
  background: #f8fbff;
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}

.empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.empty.small {
  min-height: 56px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 23, 53, 0.52);
  z-index: 20;
}

.modal-card {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.modal-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  padding: 14px 18px;
}

.modal-card h3 {
  margin: 0;
}

#modalBody {
  overflow: auto;
  padding: 18px;
}

.image-preview-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}

.image-preview-button img {
  display: block;
  width: 100%;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 16, 38, 0.78);
}

.image-lightbox-card {
  width: min(1180px, 96vw);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
}

.image-lightbox-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: #002050;
}

.image-lightbox-stage {
  min-height: 0;
  overflow: auto;
  background: #0b1628;
}

.image-lightbox-stage img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 86vh;
  object-fit: contain;
}

.watermark-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(360px, 1fr));
  grid-auto-rows: 220px;
  overflow: hidden;
  opacity: 0.055;
}

.watermark-layer span {
  align-self: center;
  justify-self: center;
  width: 360px;
  color: #002050;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.8;
  text-align: center;
  transform: rotate(-22deg);
  user-select: none;
  overflow-wrap: anywhere;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-grid b {
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
  position: relative;
  z-index: 5;
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-action-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  padding: 0 18px;
  box-shadow: none;
}

.detail-actions .ghost-btn {
  border-color: #d8e4f7;
  color: #1f66df;
}

.detail-actions .ghost-btn:hover {
  border-color: #b8cdf2;
  background: #f5f9ff;
}

.detail-actions .primary-btn {
  box-shadow: 0 10px 20px rgba(22, 119, 255, 0.22);
}

.detail-action-btn .btn-icon,
.detail-back-btn .btn-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.detail-action-btn .btn-icon .svg-icon,
.detail-back-btn .btn-icon .svg-icon {
  width: 18px;
  height: 18px;
}

.detail-back-btn .btn-icon .svg-icon {
  transform: rotate(180deg);
}

.detail-action-btn .btn-icon::before,
.detail-action-btn .btn-icon::after,
.detail-back-btn .btn-icon::before,
.detail-back-btn .btn-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-icon::before {
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.back-icon::after {
  left: 3px;
  top: 7px;
  width: 11px;
  border-top: 2px solid currentColor;
}

.file-icon::before {
  left: 2px;
  top: 1px;
  width: 12px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.file-icon::after {
  right: 2px;
  top: 1px;
  width: 5px;
  height: 5px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.template-icon::before {
  left: 2px;
  top: 3px;
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.template-icon::after {
  left: 6px;
  top: 0;
  width: 8px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: #fff;
}

.reading-icon::before {
  left: 1px;
  top: 4px;
  width: 14px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 8px;
}

.reading-icon::after {
  left: 5px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.referral-icon::before {
  left: 2px;
  top: 9px;
  width: 11px;
  border-top: 2px solid currentColor;
}

.referral-icon::after {
  right: 1px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.detail-actions button,
.detail-actions a {
  pointer-events: auto;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.report-img {
  width: min(560px, 100%);
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 16px;
}

.exam-block {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.detail-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 18px;
}

.detail-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #475467;
  font-weight: 700;
}

.detail-tab.active {
  border-bottom-color: #1677ff;
  color: #1677ff;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  color: #0088a9;
  font-weight: 800;
}

.result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.result-card-body {
  background: #f0f6ff;
  padding: 12px 14px;
}

.result-card-body p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
  color: #475467;
}

.result-card-body b {
  color: #344054;
}

.insight-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.insight-row article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 18px;
}

.insight-row span {
  display: block;
  margin: 8px 0;
  color: #64748b;
}

.insight-row p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.timeline p {
  display: grid;
  gap: 4px;
  border-left: 3px solid #1677ff;
  margin: 0 0 12px;
  padding: 0 0 0 12px;
}

.timeline span,
.timeline em {
  color: #64748b;
  font-style: normal;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

figure img,
figure video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #eef2f6;
}

figcaption {
  min-height: 34px;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 1500px) {
  .bigscreen-mode .content {
    padding: 0;
  }

  .panel.board-screen {
    width: 100vw;
    height: 100vh;
  }

  .board-shell {
    grid-template-rows: 68px 84px minmax(0, 1fr) 34px;
    gap: 6px;
    padding: 8px 12px 0;
  }

  .board-top {
    grid-template-columns: 170px 1fr 210px;
  }

  .board-title h1 {
    font-size: 28px;
    letter-spacing: 4px;
  }

  .board-title p {
    font-size: 11px;
    margin-top: 4px;
  }

  .board-logo img {
    width: 112px;
    height: 40px;
  }

  .board-stats {
    gap: 6px;
  }

  .board-stat {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 7px 8px;
  }

  .board-stat i {
    width: 40px;
    height: 40px;
  }

  .board-stat strong {
    font-size: 24px;
  }

  .board-stat span {
    font-size: 12px;
  }

  .board-stat small {
    font-size: 10px;
  }

  .board-grid {
    grid-template-columns: 26% 37% 35%;
    grid-template-rows: minmax(0, 1fr) minmax(160px, 25%);
    gap: 6px;
  }

  .board-panel {
    padding: 8px 10px;
  }

  .board-panel h3 {
    font-size: 15px;
    margin-bottom: 5px;
  }

  .board-rank p {
    margin: 4px 0;
    font-size: 12px;
  }

  .core-orbit {
    width: min(40vh, 300px);
  }

  .core-orbit strong {
    font-size: 52px;
  }

  .board-core-badges article {
    width: 98px;
    height: 98px;
  }

  .board-core-badges b {
    font-size: 22px;
  }

  .board-org-node {
    grid-template-columns: 18px 34px minmax(86px, 1fr) 62px 78px;
    gap: 6px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .board-org-summary {
    grid-template-columns: 1fr 210px;
  }

  .org-root-node {
    width: 82px;
    height: 82px;
  }

  .board-org-tree {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .org-branch-line {
    left: 86px;
    width: 36px;
  }

  .org-branch-line::before,
  .org-branch-line::after {
    width: 34px;
  }

  .board-org-node::before {
    left: -14px;
    width: 14px;
  }

  .board-org-node i {
    width: 34px;
    height: 34px;
  }

  .board-org-children {
    margin-left: 16px;
    padding-left: 10px;
  }

  .board-flow-list p {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    gap: 6px;
    margin: 4px 0;
    padding-bottom: 4px;
    font-size: 12px;
  }

  .board-flow-metrics {
    gap: 5px;
  }

  .board-flow-metrics b {
    font-size: 22px;
  }

  .board-org-overview {
    grid-template-columns: 116px repeat(4, minmax(0, 1fr));
    gap: 5px;
    min-height: 66px;
    padding: 6px;
  }

  .board-org-overview b {
    font-size: 21px;
  }

  .board-ticker {
    grid-template-columns: 90px 1fr 1fr 210px;
    font-size: 12px;
  }

  .content {
    padding: 28px 32px 36px;
  }

  .nav-item span {
    font-size: 16px;
  }

  .stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .dashboard-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-left,
  .dash-right,
  .org-access-section {
    grid-column: 1;
  }

  .dash-left {
    grid-row: 1;
  }

  .dash-right {
    grid-row: 2;
  }

  .org-access-section {
    grid-row: 3;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    height: 50px;
    padding: 0 12px;
    gap: 8px;
  }

  #today {
    font-size: 12px;
  }

  .topbar select {
    width: 104px;
    min-width: 92px;
    max-width: 110px;
    height: 30px;
    min-height: 30px;
    padding: 0 8px;
  }

  .top-icon {
    width: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  .user-profile {
    height: 30px;
    padding: 0 6px;
    gap: 6px;
  }

  .user-profile span {
    width: 20px;
    height: 20px;
  }

  .user-profile strong {
    font-size: 12px;
    max-width: 56px;
  }

  .stats,
  .detail-info-row,
  .dashboard-panel .quick-grid,
  .todo-card .todo-grid,
  .weekly-grid {
    grid-template-columns: 1fr;
  }

  .user-profile strong,
  #orgTitle {
    display: none;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.tree-block {
  margin-bottom: 22px;
}

.tree-block h3 {
  margin: 0 0 12px;
}

.tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tree-head span {
  color: var(--muted);
}

.org-tree {
  display: grid;
  gap: 8px;
}

.org-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px 12px calc(14px + var(--level) * 32px);
}

.org-node-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.org-node-main::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 6px var(--blue-soft);
}

.org-node span,
.org-node em {
  color: var(--muted);
  font-style: normal;
}

.referral-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.reading-board {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.referral-filter {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.referral-filter label {
  display: grid;
  gap: 6px;
}

.referral-board article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 18px;
}

.referral-board span {
  color: var(--muted);
}

.referral-board strong {
  display: block;
  margin-top: 8px;
  color: #071a3d;
  font-size: 30px;
}

.mini-flow {
  color: #667085;
  font-size: 12px;
  line-height: 1.7;
}

.mini-flow b {
  color: #182b4d;
}

.mini-flow span {
  display: block;
  color: #667085;
  overflow-wrap: anywhere;
}

.direction-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #eef6ff;
  color: #175cd3;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

.direction-chip.down {
  background: #ecfdf3;
  color: #087443;
}

.referral-print {
  display: grid;
  gap: 18px;
  width: min(860px, 100%);
  margin: 0 auto;
  border: 1px solid #d9e2f0;
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  color: #101828;
}

.referral-print h1,
.referral-print h3,
.referral-print p {
  margin: 0;
}

.referral-print h1 {
  text-align: center;
  font-size: 26px;
}

.referral-print .print-code {
  text-align: center;
  color: #667085;
}

.referral-print section {
  display: grid;
  gap: 12px;
}

.print-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #e4eaf4;
  border-bottom: 0;
  border-right: 0;
}

.print-info-grid span {
  display: grid;
  gap: 6px;
  min-height: 64px;
  border-right: 1px solid #e4eaf4;
  border-bottom: 1px solid #e4eaf4;
  padding: 10px 12px;
  color: #667085;
}

.print-info-grid strong {
  color: #101828;
}

.referral-print table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.referral-print th,
.referral-print td {
  border: 1px solid #d9e2f0;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.referral-print footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  color: #475467;
  padding-top: 12px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

select[multiple] {
  min-height: 118px;
  padding: 8px;
}

.field-block {
  display: grid;
  gap: 10px;
}

.bulk-download-panel {
  display: grid;
  gap: 18px;
}

.inline-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 320px;
}

.inline-actions input {
  min-width: 0;
}

.bulk-download-panel code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.secret-box {
  display: grid;
  gap: 14px;
}

.secret-box p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.forced-notice {
  display: grid;
  gap: 14px;
}

.forced-notice h4 {
  margin: 0;
  color: #071a3d;
  font-size: 20px;
}

.forced-notice p {
  margin: 0;
  padding: 14px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #f8fbff;
  color: #1d2b4f;
  line-height: 1.8;
}

.forced-notice small {
  color: var(--muted);
}

.grade-edit-block {
  display: grid;
  gap: 10px;
}

.grade-edit-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.grade-edit-row strong,
.grade-edit-row span {
  display: block;
}

.grade-edit-row span {
  color: var(--muted);
  margin-top: 4px;
}

.reading-grade-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.reading-grade-image-grid .field-head {
  grid-column: 1 / -1;
}

.reading-grade-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(31, 76, 126, 0.08);
}

.reading-grade-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: #002050;
}

.reading-grade-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #eef4fb;
}

.reading-grade-controls {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px 14px;
  background: #f4f8ff;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-head b {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.choice-grid,
.choice-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.choice-grid.compact label,
.choice-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  cursor: pointer;
}

.choice-grid.compact label {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.choice-grid.compact label:nth-child(2n) {
  border-right: 0;
}

.choice-list {
  max-height: 260px;
  overflow: auto;
}

.choice-list label + label {
  border-top: 1px solid #eef2f6;
}

.choice-grid input,
.choice-list input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.upload-field {
  display: grid;
  gap: 8px;
}

.upload-field input[type="file"] {
  padding: 10px;
  border: 1px dashed #b9c9e8;
  border-radius: 8px;
  background: #f8fbff;
}

.upload-field img {
  width: 180px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.report-signatures {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 70px;
  margin-top: 18px;
  color: #1d2b4f;
  font-weight: 700;
}

.report-signatures img,
.referral-print footer img {
  max-width: 150px;
  max-height: 58px;
  object-fit: contain;
  vertical-align: middle;
}

.report-signatures em,
.referral-print footer em {
  color: #98a2b3;
  font-style: normal;
  font-weight: 500;
}

.referral-print footer {
  align-items: flex-end;
}

.referral-print footer span {
  display: grid;
  gap: 8px;
  min-height: 70px;
}

.flow-sections {
  display: grid;
  gap: 18px;
}

.flow-sections h4 {
  margin: 0 0 10px;
  color: #002050;
}

.flow-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 12px;
}

.flow-step {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 130px;
  padding: 12px;
  border: 1px solid #dbe8ff;
  border-radius: 10px;
  background: #f8fbff;
}

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 24px;
  right: -11px;
  width: 12px;
  height: 2px;
  background: #bfd4f5;
}

.flow-step i {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1677ff;
  font-style: normal;
  font-weight: 900;
}

.flow-step b {
  color: #002050;
}

.flow-step span,
.flow-step em {
  color: #667085;
  font-style: normal;
  font-size: 13px;
  line-height: 1.5;
}

.flow-step.done,
.flow-step.current {
  border-color: #1677ff;
  background: #f1f7ff;
}

.flow-step.done i {
  background: #1677ff;
  color: #fff;
}

.flow-step.current {
  box-shadow: 0 8px 24px rgba(22, 119, 255, 0.14);
}

.flow-step.current i {
  background: #16b981;
  color: #fff;
}

.flow-step.todo {
  opacity: 0.62;
}

.flow-step.terminal {
  border-color: #fecaca;
  background: #fff7f7;
}

.flow-step.terminal i {
  background: #d92d20;
  color: #fff;
}

.flow-step.skipped {
  border-style: dashed;
  opacity: 0.72;
}

.ai-disease-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dbe8ff;
  border-radius: 10px;
  background: #f8fbff;
}

.ai-disease-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-disease-actions button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 800;
}

.ai-disease-actions button.ghost {
  background: #fff;
  color: var(--blue);
}

.ai-disease-cards {
  display: grid;
  gap: 10px;
}

.ai-disease-cards article {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #fff;
}

.ai-disease-cards b {
  color: #0088a9;
}

.ai-disease-cards span {
  color: #002050;
  font-weight: 800;
}

.ai-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-model-result {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #dbe8ff;
  border-radius: 8px;
  background: #f8fbff;
}

.ai-model-result strong {
  color: #344054;
  font-size: 13px;
}

.ai-disease-cards p {
  margin: 0;
  color: #667085;
}

.ai-disease-cards h5 {
  margin: 6px 0 0;
  color: #002050;
}

.ai-multi-list {
  display: grid;
  gap: 8px;
}

.ai-multi-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f8ff;
}

.ai-multi-list strong {
  color: #002050;
}

.ai-multi-card {
  display: grid;
  gap: 12px;
}

.ocular-map-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8e7ff;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.ocular-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ocular-map-toolbar button {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #cfe0ff;
  background: #fff;
  color: #31526f;
  font-size: 14px;
  font-weight: 800;
}

.ocular-map-toolbar button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 114, 255, .18);
}

.ocular-map-stage {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #d7e4f7;
  background: #061b3d;
  aspect-ratio: var(--ocular-aspect, 4 / 3);
  max-height: 620px;
}

.ocular-map-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #061b3d;
}

.ocular-heat-layer,
.ocular-detection-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.ocular-heat-layer {
  mix-blend-mode: screen;
  filter: saturate(1.35) blur(.2px);
}

.ocular-detection-layer {
  pointer-events: auto;
}

.ocular-detection {
  position: absolute;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 2px solid #ffb020;
  border-radius: 6px;
  background: rgba(255, 176, 32, .12);
  box-shadow: 0 0 0 9999px rgba(0, 32, 80, .02), 0 0 16px rgba(255, 176, 32, .45);
  cursor: pointer;
}

.ocular-detection.high {
  border-color: #f04438;
  background: rgba(240, 68, 56, .16);
  box-shadow: 0 0 18px rgba(240, 68, 56, .52);
}

.ocular-detection.medium {
  border-color: #ffb020;
}

.ocular-detection.low {
  border-color: #2e90fa;
  background: rgba(46, 144, 250, .14);
}

.ocular-detection span {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  max-width: 180px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 32, 80, .86);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}

.ocular-detection:hover span,
.ocular-detection.active span {
  opacity: 1;
  transform: translateY(0);
}

.ocular-map-card[data-view="heat"] .ocular-heat-layer,
.ocular-map-card[data-view="lesion"] .ocular-detection-layer {
  opacity: 1;
}

.ocular-map-card[data-view="lesion"] .ocular-detection {
  opacity: 1;
}

.choice-grid label:has(input:checked),
.choice-list label:has(input:checked) {
  background: #eef6ff;
  color: var(--blue);
  font-weight: 700;
}

.check-line {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.check-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.svg-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
}

.nav-icon::before,
.nav-icon::after,
.stat-card i::before,
.stat-card i::after,
.quick-icon::before,
.quick-icon::after,
#today::before {
  display: none !important;
}

.nav-icon .svg-icon {
  width: 18px;
  height: 18px;
}

.stat-card i .svg-icon,
.quick-icon .svg-icon {
  width: 24px;
  height: 24px;
}

#today .svg-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .portal-overlay {
    left: 24px;
    right: 24px;
    bottom: 34px;
  }

  .portal-actions {
    width: 100%;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .stats,
  .org-access-section,
  .quick-grid,
  .detail-grid,
  .detail-info-row,
  .insight-row,
  .referral-board,
  .referral-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-main-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .grade-edit-row {
    grid-template-columns: 1fr;
  }

  .reading-grade-image-grid {
    grid-template-columns: 1fr;
  }

  .reading-grade-controls {
    grid-template-columns: 1fr;
  }

  .patient-card {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .portal-image {
    object-position: 56% center;
  }

  .portal-actions {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .portal-actions button {
    min-height: 76px;
    grid-template-columns: 54px 1fr;
    justify-items: start;
    padding: 0 18px;
  }

  .page-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
    height: auto;
  }

  .topbar {
    height: 48px;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
  }

  .top-spacer {
    flex: 1;
  }

  #today {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar select {
    display: none;
  }

  .top-dropdown,
  .top-menu-wrap .top-dropdown {
    left: auto;
    right: 0;
    top: 36px;
    width: min(320px, calc(100vw - 20px));
    margin-top: 0;
  }

  .actions input {
    width: 100%;
  }

  .stats,
  .quick-grid,
  .detail-grid,
  .detail-info-row,
  .result-grid,
  .insight-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .ocular-map-toolbar button {
    flex: 1 1 calc(50% - 8px);
    padding: 0 8px;
  }

  .ocular-map-stage {
    aspect-ratio: var(--ocular-aspect, 1 / 1);
    max-height: 70vh;
  }

  .page-head h2 {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .page-title-note {
    font-size: 13px;
  }

  .detail-actions {
    width: 100%;
  }

  .detail-action-btn {
    width: 100%;
    justify-content: center;
  }
}
