/* Global laboratory shell */
.app-shell, .lab-shell { min-height: 100vh; }
.lab-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid var(--line-1);
  background: rgba(7, 8, 10, .94);
  backdrop-filter: blur(18px);
}
.lab-header-main {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 28px;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 10px 26px;
}
.lab-brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-button { border: 0; background: transparent; color: inherit; padding: 0; text-align: left; cursor: pointer; }
.histo-brand-mark {
  width: 62px;
  height: 38px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.22));
}
.brand-button:hover .histo-brand-mark { filter: drop-shadow(0 8px 18px rgba(0,0,0,.22)) drop-shadow(0 0 10px rgba(155,122,213,.12)); }
.lab-brand-name { display: block; font-weight: 800; font-size: .96rem; letter-spacing: .01em; }
.lab-brand-sub { display: block; font-size: .64rem; color: var(--text-3); letter-spacing: .13em; text-transform: uppercase; }
.course-accession { display: grid; gap: 1px; padding-left: 22px; border-left: 1px solid var(--line-1); }
.course-accession-label { color: var(--text-3); font-size: .59rem; letter-spacing: .16em; }
.course-accession strong { font-size: .88rem; font-weight: 720; }
.course-accession > span:last-child { color: var(--text-3); font-size: .67rem; }
.lab-header-actions { display: flex; align-items: center; gap: 16px; }
.neutron-status { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .72rem; white-space: nowrap; }
.neutron-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.neutron-status.online i { background: var(--neutron); box-shadow: 0 0 14px rgba(99,199,192,.72); }
.neutron-status.offline i { background: var(--warning); }
.neutron-status.compact { font-size: .66rem; }
.account-ticket { min-height: 44px; border: 1px solid var(--line-1); border-radius: 5px; background: var(--surface-1); display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; cursor: pointer; }
.account-ticket:hover { border-color: var(--line-2); background: var(--surface-2); }
.account-copy { display: grid; text-align: left; }
.account-copy strong { font-size: .74rem; }
.account-copy small { font-size: .61rem; color: var(--text-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #252a31; border: 1px solid var(--line-2); font-size: .72rem; font-weight: 800; }
.avatar.large { width: 54px; height: 54px; font-size: 1rem; }
.lab-navigation {
  height: 52px;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 0 26px;
  border-top: 1px solid rgba(255,255,255,.035);
}
.lab-nav-item {
  position: relative;
  min-width: 104px;
  border: 0;
  border-right: 1px solid rgba(255,255,255,.035);
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-size: .72rem;
  letter-spacing: .015em;
}
.lab-nav-item:first-child { border-left: 1px solid rgba(255,255,255,.035); }
.lab-nav-item svg { width: 18px; height: 18px; stroke-width: 1.7; }
.lab-nav-item:hover { color: var(--text-1); background: rgba(255,255,255,.025); }
.lab-nav-item.active { color: var(--text-1); background: linear-gradient(180deg, rgba(155,122,213,.08), transparent); }
.lab-nav-item.active::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; background: var(--hematoxylin); }
.lab-nav-item.neutron-nav.active::after { background: var(--neutron); }
.main-area { min-width: 0; }
.lab-content, .content { width: min(100%, var(--content-max)); margin: 0 auto; padding: 26px; }
.mobile-bottom { display: none; }
.loading-bench { min-height: 52vh; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--text-3); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.loading-slide { width: 150px; height: 58px; border: 1px solid var(--line-2); border-radius: 3px; background: linear-gradient(90deg, var(--surface-paper) 0 24%, rgba(223,130,165,.25) 24% 76%, var(--surface-paper) 76%); position: relative; overflow: hidden; }
.loading-slide::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent); animation: slide-scan 1.2s infinite; }
@keyframes slide-scan { from { left: -45%; } to { left: 105%; } }

/* Page headings */
.module-heading, .page-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line-1); }
.module-heading h1, .page-head h1 { margin: 0 0 7px; font-size: clamp(1.75rem, 3vw, 3.05rem); line-height: 1; font-weight: 780; }
.module-heading p, .page-head p { margin: 0; max-width: 880px; color: var(--text-2); font-size: .9rem; }
.module-code, .eyebrow { margin-bottom: 8px; color: var(--hematoxylin-soft); font-size: .63rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.module-code.neutron, .eyebrow.aura { color: var(--neutron-soft); }

/* General controls */
.btn { min-height: var(--tap); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-1); border-radius: 5px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; transition: .16s var(--ease); font-weight: 650; font-size: .82rem; }
.btn:hover { background: var(--surface-3); border-color: #565f69; }
.btn:active { transform: translateY(1px); }
.btn.primary { border-color: rgba(155,122,213,.55); background: #302642; color: #f4edff; box-shadow: inset 0 0 0 1px rgba(197,177,232,.06); }
.btn.primary:hover { background: #3a2d51; }
.btn.aura { border-color: rgba(99,199,192,.45); background: #183533; color: #ddfbf8; }
.btn.aura:hover { background: #20413e; }
.btn.danger { border-color: rgba(223,114,128,.45); color: #ffd6dc; background: rgba(223,114,128,.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.icon-only { width: 44px; padding: 0; }
.btn svg { width: 18px; height: 18px; }
.text-action { border: 0; background: transparent; color: var(--neutron-soft); cursor: pointer; font-size: .72rem; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 2px 8px; border: 1px solid var(--line-1); border-radius: 999px; font-size: .68rem; color: var(--text-2); background: rgba(9,11,14,.72); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.badge.success::before { background: var(--success); }
.badge.warning::before { background: var(--warning); }
.badge.danger::before { background: var(--danger); }
.badge.aura::before { background: var(--neutron); box-shadow: 0 0 10px rgba(99,199,192,.6); }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 3px; background: rgba(155,122,213,.08); border: 1px solid rgba(155,122,213,.2); color: var(--hematoxylin-soft); padding: 4px 8px; font-size: .68rem; }
.tag.eosin { background: rgba(223,130,165,.07); border-color: rgba(223,130,165,.22); color: var(--eosin-soft); }
.card { border: 1px solid var(--line-1); border-radius: var(--radius-3); background: var(--surface-1); box-shadow: var(--shadow-low); }
.card.pad { padding: 18px; }
.card.soft { box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Forms */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 13px; }
.field label, .field-label { font-size: .74rem; color: var(--text-2); font-weight: 650; letter-spacing: .02em; }
.field-hint { font-size: .68rem; color: var(--text-3); }
input, textarea, select { width: 100%; border: 1px solid var(--line-1); border-radius: 5px; background: #0d1014; color: var(--text-1); padding: 11px 12px; outline: 0; min-height: 44px; transition: .15s var(--ease); }
textarea { min-height: 112px; resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: var(--line-2); }
input:focus, textarea:focus, select:focus { border-color: var(--neutron); box-shadow: 0 0 0 3px rgba(99,199,192,.08); }
.search-input { padding-left: 40px; }
.search-wrap { position: relative; }
.search-wrap > svg { position: absolute; width: 18px; height: 18px; left: 13px; top: 13px; color: var(--text-3); z-index: 1; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.check-row input { width: 18px; height: 18px; min-height: auto; accent-color: var(--hematoxylin); }
.segmented { display: inline-flex; border: 1px solid var(--line-1); border-radius: 5px; padding: 3px; background: #0c0f13; }
.segmented button { min-height: 36px; border: 0; border-radius: 3px; padding: 0 11px; background: transparent; color: var(--text-3); cursor: pointer; }
.segmented button.active { background: var(--surface-3); color: var(--text-1); }

/* Tables and general content */
.table-wrap { overflow: auto; border: 1px solid var(--line-1); border-radius: 5px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line-1); text-align: left; vertical-align: top; font-size: .82rem; }
th { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); background: #0e1115; }
tr:last-child td { border-bottom: 0; }
.empty-state { min-height: 190px; display: grid; place-items: center; text-align: center; padding: 28px; color: var(--text-2); }
.notice { border-left: 3px solid var(--warning); background: rgba(216,183,106,.055); color: #ead8ae; padding: 12px 14px; font-size: .8rem; }
.notice.info { border-color: var(--info); background: rgba(123,168,206,.055); color: #cfe0ee; }
.notice.success { border-color: var(--success); background: rgba(112,199,149,.055); color: #ceefd9; }
.notice.danger { border-color: var(--danger); background: rgba(223,114,128,.055); color: #ffd3d9; }
.divider { height: 1px; background: var(--line-1); margin: 16px 0; }
.progress { height: 7px; border-radius: 999px; background: #20252c; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--hematoxylin), var(--eosin)); }
.switch-card { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 14px; border: 1px solid var(--line-1); border-radius: 5px; background: #0d1014; }
.switch-card input { width: 20px; height: 20px; min-height: auto; accent-color: var(--neutron); }

/* Dialogs and notifications */
.toast-region { position: fixed; z-index: 500; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { width: min(420px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 5px; background: rgba(20,23,28,.98); box-shadow: var(--shadow-high); color: var(--text-1); transform: translateY(10px); opacity: 0; transition: .18s var(--ease); }
.toast.show { transform: none; opacity: 1; }
.toast.error { border-left: 3px solid var(--danger); }
.toast.success { border-left: 3px solid var(--success); }
.dialog-backdrop { position: fixed; inset: 0; z-index: 450; background: rgba(0,0,0,.76); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.dialog { width: min(720px, 100%); max-height: min(88vh, 920px); overflow: auto; border: 1px solid var(--line-2); border-radius: 7px; background: #12161b; box-shadow: var(--shadow-high); }
.dialog.wide { width: min(1060px, 100%); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 18px 20px 13px; border-bottom: 1px solid var(--line-1); background: #0d1014; }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog-body { padding: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px 18px; border-top: 1px solid rgba(255,255,255,.035); }
.profile-dialog { display: flex; align-items: center; gap: 14px; }
.specimen-label-card { background: var(--surface-label); color: var(--ink); padding: 14px; border-radius: 3px; }
.specimen-label-card .muted, .specimen-label-card .dim { color: var(--ink-soft); }

/* Shared review and rubric records */
.rubric-list { display: grid; gap: 8px; }
.rubric-item, .review-answer { padding: 12px; border: 1px solid var(--line-1); border-radius: 3px; background: #0d1014; }
.rubric-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 12px; }
.rubric-item .tiny { grid-column: 1 / -1; }
.rubric-item > span { color: var(--hematoxylin-soft); font: 800 .65rem ui-monospace, monospace; }
.review-answer { margin-bottom: 10px; }
.mobile-more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mobile-more-item { min-height: 72px; flex-direction: column; align-items: flex-start; }
.skeleton { min-height: 20px; background: var(--surface-2); }
.skeleton-row { height: 52px; margin-top: 12px; }
