/* ============================================================
   LIMS Watson — design system
   ============================================================ */
:root {
  --bg: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --surface-3: #eef4f2;
  --ink: #081b18;
  --text: #172a26;
  --muted: #647a76;
  --muted-2: #8ba09c;
  --line: #e2e9e7;
  --line-strong: #cfdad7;
  --brand: #0f766e;
  --brand-2: #0d9488;
  --brand-3: #14b8a6;
  --brand-soft: #e3f2ef;
  --brand-ink: #0b4f49;
  --ok: #15803d;
  --ok-soft: #e7f5eb;
  --warn: #b45309;
  --warn-soft: #fdf2e2;
  --danger: #b91c1c;
  --danger-soft: #fdeceb;
  --info: #1d4ed8;
  --info-soft: #eaeffd;
  --sidebar: #071f1c;
  --sidebar-2: #0b2b26;
  --sidebar-text: #9fb8b3;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(8, 27, 24, .05);
  --shadow: 0 1px 3px rgba(8, 27, 24, .06), 0 8px 24px -12px rgba(8, 27, 24, .18);
  --shadow-lg: 0 24px 60px -20px rgba(8, 27, 24, .35);
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #b9e6df; color: #062a26; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--sidebar); color: #cfe6e1; }
.boot__mark { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(145deg, #14b8a6, #0f766e); color: #fff; box-shadow: 0 12px 30px -10px rgba(20, 184, 166, .6); }
.boot__mark .icon { width: 26px; height: 26px; }
.boot__text { font-size: 13px; letter-spacing: .02em; opacity: .8; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40;
  background:
    radial-gradient(700px 300px at 10% -10%, rgba(20, 184, 166, .18), transparent 60%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar) 55%);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(150deg, #14b8a6, #0b6b62); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -8px rgba(20, 184, 166, .8);
}
.brand__mark .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.brand__name { color: #f2fbf9; font-weight: 650; font-size: 16px; letter-spacing: -.01em; line-height: 1.1; }
.brand__sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6f918b; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; padding-bottom: 8px; }
.nav__group { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #55736d; padding: 16px 10px 6px; font-weight: 600; }
.nav__item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: #a9c2bd; font-size: 13.5px; font-weight: 450; position: relative; border: 0; background: none; text-align: left; width: 100%;
  transition: background .15s, color .15s;
}
.nav__item .icon { width: 17px; height: 17px; opacity: .9; }
.nav__item:hover { background: rgba(255, 255, 255, .055); color: #e6f4f1; }
.nav__item.is-active { background: rgba(20, 184, 166, .14); color: #ecfffb; font-weight: 600; }
.nav__item.is-active::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: #2dd4bf; }
.nav__count { margin-left: auto; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .08); color: #cfe6e1; padding: 1px 7px; border-radius: 20px; }
.nav__item.is-active .nav__count { background: rgba(45, 212, 191, .22); color: #d8fff8; }

.sidebar__footer { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar__hint { font-size: 10.5px; color: #5f7f79; padding: 8px 10px 10px; line-height: 1.5; }
.user-card {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; width: 100%;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); color: #dff2ee; text-align: left;
}
.user-card:hover { background: rgba(255, 255, 255, .09); }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; flex: none; letter-spacing: .02em; }
.avatar--lg { width: 44px; height: 44px; border-radius: 12px; font-size: 14px; }
.user-card__meta { min-width: 0; }
.user-card__name { font-size: 12.5px; font-weight: 600; color: #f0fbf8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card__role { font-size: 10.5px; color: #7fa39c; }

.main { margin-left: 250px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px;
  padding: 14px 28px; background: rgba(242, 245, 244, .85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__titles { min-width: 0; }
.topbar__title { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.topbar__crumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted-2); }
.topbar__crumb strong { color: var(--text); font-weight: 600; }
.topbar__spacer { flex: 1; }
.global-search { position: relative; width: min(420px, 34vw); }
.global-search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 12px 0 36px; font-size: 13px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.global-search input::placeholder { color: var(--muted-2); }
.global-search input:focus { outline: none; border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(13, 148, 136, .12); }
.global-search > .icon { position: absolute; left: 12px; top: 10px; color: var(--muted-2); width: 17px; height: 17px; }
.search-pop {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: 60vh; overflow-y: auto; z-index: 60;
}
.search-pop__group { padding: 8px 6px 4px; }
.search-pop__label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); padding: 4px 10px 6px; font-weight: 600; }
.search-pop__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.search-pop__item:hover { background: var(--surface-3); }
.search-pop__item small { color: var(--muted); margin-left: auto; }
.topbar__iconbtn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; position: relative; color: var(--muted); box-shadow: var(--shadow-sm);
}
.topbar__iconbtn:hover { color: var(--text); border-color: var(--line-strong); }
.topbar__dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }

.content { padding: 26px 28px 70px; max-width: 1560px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head__title { font-size: 23px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.page-head__sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 550; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: #bccbc7; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand-3); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn--primary { background: linear-gradient(180deg, #12a294, #0f766e); border-color: #0c6a63; color: #fff; box-shadow: 0 6px 16px -8px rgba(15, 118, 110, .8), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn--primary:hover { background: linear-gradient(180deg, #14b8a6, #0d857b); border-color: #0b7a71; }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn--danger { color: var(--danger); border-color: #f0c9c6; background: #fff8f7; }
.btn--danger:hover { background: var(--danger-soft); border-color: #e5aaa5; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn--sm .icon { width: 14px; height: 14px; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }
.btn--link { border: 0; background: none; box-shadow: none; color: var(--brand); padding: 0 4px; height: auto; }
.btn--link:hover { background: none; text-decoration: underline; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: #3d534f; }
.field__hint { font-size: 11.5px; color: var(--muted-2); }
.input, .select, .textarea {
  height: 36px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 0 11px; font-size: 13px; color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(13, 148, 136, .13); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23647a76' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin-top: 4px; padding-top: 16px; border-top: 1px dashed var(--line); }
.form-section__title { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); font-weight: 650; margin-bottom: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); }
.query-box { display: flex; gap: 8px; align-items: center; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  background: #eef2f1; color: #4c615d; border: 1px solid transparent;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip--plain::before { display: none; }
.chip--ok { background: var(--ok-soft); color: #146c33; }
.chip--warn { background: var(--warn-soft); color: #92400e; }
.chip--danger { background: var(--danger-soft); color: #a51b1b; }
.chip--info { background: var(--info-soft); color: #1e40af; }
.chip--active { background: var(--brand-soft); color: var(--brand-ink); }
.chip--neutral { background: #eef2f1; color: #4c615d; }
.chip--muted { background: #f1f4f3; color: #7c908c; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.tag--amber { background: var(--warn-soft); border-color: #f3dcb9; color: #92400e; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card__title { font-size: 14px; font-weight: 650; color: var(--ink); }
.card__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card__actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px 13px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.kpi__label { font-size: 11.5px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi__label .icon { width: 14px; height: 14px; opacity: .8; }
.kpi__value { font-size: 26px; font-weight: 680; letter-spacing: -.03em; color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi__value small { font-size: 13px; font-weight: 500; color: var(--muted-2); letter-spacing: 0; margin-left: 4px; }
.kpi__foot { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.kpi__foot .up { color: var(--warn); font-weight: 600; }
.kpi__foot .ok { color: var(--ok); font-weight: 600; }
.kpi__spark { position: absolute; right: 12px; bottom: 10px; opacity: .55; }
.kpi--accent { background: linear-gradient(160deg, #0f766e, #0b5d57); border-color: #0b5d57; color: #d8f5ef; }
.kpi--accent .kpi__value { color: #fff; }
.kpi--accent .kpi__label, .kpi--accent .kpi__foot { color: #a7d8d0; }
.kpi--accent .kpi__foot .up { color: #fde68a; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid #eef3f1; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fbfa; }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-selected { background: var(--brand-soft); }
.table .cell-id { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.table .cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table td input[type="checkbox"], .table th input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); }
.table--compact td { padding: 8px 12px; }
.table--compact thead th { padding: 8px 12px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; height: 34px; }
.toolbar__search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.toolbar__search input { width: 100%; padding-left: 34px; }
.toolbar__search .icon { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted-2); }
.toolbar__spacer { flex: 1; }

/* ---------- drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(6, 22, 19, .38); backdrop-filter: blur(1.5px); z-index: 80; opacity: 0; animation: fade .18s ease forwards; }
@keyframes fade { to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(700px, 96vw); background: var(--surface);
  z-index: 90; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  transform: translateX(24px); opacity: 0; animation: slidein .22s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes slidein { to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer__title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.drawer__sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer__close { margin-left: auto; }
.drawer__body { padding: 18px 20px 26px; overflow-y: auto; flex: 1; }
.drawer__foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: var(--surface-2); }
.drawer__foot .spacer { flex: 1; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal {
  width: min(640px, 96vw); max-height: 90vh; background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(10px) scale(.99); opacity: 0; animation: pop .2s cubic-bezier(.2, .8, .3, 1) forwards;
}
.modal--wide { width: min(860px, 96vw); }
.modal--narrow { width: min(460px, 96vw); }
@keyframes pop { to { transform: none; opacity: 1; } }
.modal__head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 10px; }
.modal__title { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.modal__sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.modal__foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
.modal__foot .spacer { flex: 1; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 9px 12px; font-size: 13px; font-weight: 550; color: var(--muted); border: 0; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand-ink); border-bottom-color: var(--brand-2); }
.tab .count { background: var(--surface-3); }
.tab.is-active .count { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: linear-gradient(180deg, var(--brand-3), var(--line)); opacity: .5; border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-2); }
.tl-item--muted::before { border-color: var(--line-strong); }
.tl-item--danger::before { border-color: var(--danger); }
.tl-item--warn::before { border-color: var(--warn); }
.tl-item__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-item__title { font-size: 13px; font-weight: 600; }
.tl-item__time { font-size: 11.5px; color: var(--muted-2); margin-left: auto; }
.tl-item__note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl-item__meta { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; display: flex; align-items: center; gap: 6px; }

/* ---------- misc ---------- */
.meter { height: 7px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #14b8a6, #0f766e); transition: width .4s; }
.meter__fill--warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.meter__fill--danger { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.empty { display: grid; place-items: center; text-align: center; padding: 44px 20px; color: var(--muted); }
.empty__icon { width: 46px; height: 46px; border-radius: 13px; background: var(--surface-3); display: grid; place-items: center; margin-bottom: 12px; color: var(--muted-2); }
.empty__title { font-weight: 600; color: var(--text); font-size: 13.5px; }
.empty__text { font-size: 12.5px; margin-top: 3px; max-width: 360px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; font-weight: 500; }
.callout { display: flex; gap: 10px; padding: 11px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.callout .icon { color: var(--brand); margin-top: 1px; }
.callout--warn { background: var(--warn-soft); border-color: #f3dcb9; color: #7c3f08; }
.callout--warn .icon { color: var(--warn); }
.callout--danger { background: var(--danger-soft); border-color: #f0c9c6; color: #8f1a1a; }
.callout--danger .icon { color: var(--danger); }
.callout--ok { background: var(--ok-soft); border-color: #cbe9d4; color: #146c33; }
.code-block { background: #0d211e; color: #d5ece7; border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row .input { font-family: var(--mono); font-size: 12px; background: var(--surface-2); }

/* alerts */
.alert-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.alert-icon--danger { background: var(--danger-soft); color: var(--danger); }
.alert-icon--warn { background: var(--warn-soft); color: var(--warn); }
.alert-icon--info { background: var(--info-soft); color: var(--info); }
.alert-icon .icon { width: 15px; height: 15px; }
.alert-item__title { font-size: 12.5px; font-weight: 600; }
.alert-item__text { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* activity */
.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.feed__item:last-child { border-bottom: 0; }
.feed__body { min-width: 0; flex: 1; }
.feed__text { font-size: 12.5px; }
.feed__meta { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

/* charts */
.chart svg { display: block; width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.donut { display: flex; gap: 18px; align-items: center; }
.donut__legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; min-width: 0; }
.donut__row { display: flex; align-items: center; gap: 7px; }
.donut__row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.donut__row b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* instrument card */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.device { padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; }
.device:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.device__top { display: flex; gap: 11px; align-items: flex-start; }
.device__icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--brand-ink); flex: none; }
.device__name { font-size: 13px; font-weight: 650; line-height: 1.25; }
.device__model { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.device__state { margin-left: auto; display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; white-space: nowrap; flex: none; padding-left: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.dot--online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.dot--offline { background: #94a3b8; }
.dot--maintenance { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.dot--error { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .16); }
.device__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 13px; font-size: 11.5px; }
.device__meta div span { display: block; color: var(--muted-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.device__meta div b { font-weight: 600; font-size: 12px; }
.device__foot { display: flex; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); align-items: center; }
.device__foot .spacer { flex: 1; }

/* label print */
.label-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.label-card { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 12px; background: #fff; }
.label-card__top { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.label-card__id { font-family: var(--mono); font-size: 13px; font-weight: 700; margin-top: 6px; }
.label-card__meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.label-card svg { width: 100%; height: 44px; margin-top: 8px; display: block; }

.barcode { width: 100%; height: 48px; display: block; }
.barcode rect { fill: currentColor; }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: 11px; background: #0d211e;
  color: #e7f6f2; box-shadow: var(--shadow-lg); font-size: 13px; animation: toastin .22s ease;
}
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast .icon { color: #5eead4; margin-top: 1px; }
.toast--danger .icon { color: #fca5a5; }
.toast--warn .icon { color: #fcd34d; }
.toast__text { min-width: 0; }

/* pick lists (wizard) */
.pick-list { border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; background: var(--surface); }
.pick-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid #eef3f1;
  font-size: 12.5px; cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%;
}
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover { background: var(--surface-2); }
.pick-item__main { flex: 1; min-width: 0; }
.pick-item__sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.pick-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); flex: none; }
.padding-0 { padding: 0 !important; }

/* segmented */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 9px; gap: 2px; }
.segmented button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 550; color: var(--muted); }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* pipeline */
.stage-pipeline { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stage { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted-2); }
.stage b { color: var(--text); }
.stage.is-done { color: var(--brand); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .table { min-width: 680px; }
  .sidebar { width: 68px; padding: 16px 10px 12px; }
  .brand > div:not(.brand__mark), .nav__item span, .nav__count, .sidebar__hint, .user-card__meta { display: none; }
  .nav__item { justify-content: center; padding: 10px; }
  .nav__item.is-active::before { display: none; }
  .nav__group { text-align: center; font-size: 8px; padding: 12px 0 4px; }
  .main { margin-left: 68px; }
  .global-search { width: 240px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
@media (max-width: 720px) {
  .content { padding: 18px 14px 60px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .global-search { width: 100%; order: 4; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .label-sheet { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  #app, .sidebar, .topbar, .toasts, .no-print, .drawer, .drawer__foot, .overlay { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .modal-wrap { position: static; display: block; padding: 0; }
  .modal {
    width: 100% !important; max-width: none; max-height: none; box-shadow: none; border-radius: 0;
    animation: none; opacity: 1; transform: none;
  }
  .modal__head, .modal__foot { display: none !important; }
  .modal__body { padding: 0; overflow: visible; }
  .label-sheet { grid-template-columns: repeat(2, 1fr); gap: 8mm; }
  .label-card { break-inside: avoid; border-style: solid; border-color: #999; }
}

/* ============================================================
   Diagenta: sign-in and study registry
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); background: var(--bg); }
.auth__side {
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(20, 184, 166, .22), transparent 60%),
    linear-gradient(160deg, #0b2b26, #071f1c 70%);
  color: #cfe6e1; padding: 42px 48px; display: flex; flex-direction: column; justify-content: center; gap: 20px;
}
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__name { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.auth__sub { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #6f918b; }
.auth__side h1 { font-size: 30px; line-height: 1.18; letter-spacing: -.03em; color: #f2fbf9; max-width: 22ch; font-weight: 650; }
.auth__side > p { font-size: 13.5px; line-height: 1.65; color: #9fb8b3; max-width: 52ch; }
.auth__features { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.auth__features > div { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: #b7cfca; }
.auth__features .icon { color: #2dd4bf; margin-top: 1px; }
.auth__features b { color: #e8faf6; font-weight: 600; }
.auth__demo { margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; }
.auth__demo-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #6f918b; margin-bottom: 9px; }
.auth__demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.auth__demo-grid button {
  text-align: left; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px; padding: 7px 9px; color: #cfe6e1; font-size: 11px; line-height: 1.3;
}
.auth__demo-grid button:hover { background: rgba(255, 255, 255, .1); }
.auth__demo-grid b { display: block; font-size: 11.5px; color: #f0fbf8; font-weight: 600; }
.auth__demo-grid span { color: #7fa39c; font-family: var(--mono); font-size: 10.5px; }
.auth__main { display: grid; place-items: center; padding: 32px; }
.auth__form { width: min(380px, 100%); }
.auth__form-brand { display: flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.auth__form-brand .icon { width: 16px; height: 16px; }
.auth__form h2 { font-size: 24px; letter-spacing: -.03em; margin-top: 12px; color: var(--ink); }
.auth__submit { width: 100%; height: 42px; margin-top: 18px; }
.auth__error { margin-top: 12px; font-size: 12.5px; color: var(--danger); background: var(--danger-soft); border: 1px solid #f0c9c6; padding: 8px 10px; border-radius: 8px; }
.auth__hint { margin-top: 14px; font-size: 11.5px; color: var(--muted-2); }

/* tracking grid */
.trk-grid { border-collapse: separate; border-spacing: 5px; width: auto; min-width: 560px; table-layout: fixed; }
.trk-grid th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding: 4px 6px; white-space: nowrap; }
.trk-grid thead th:not(:first-child) { width: 118px; }
.trk-grid .trk-rowhead { text-align: left; font-family: var(--mono); font-size: 11.5px; color: #3d534f; background: var(--surface-2); border-radius: 6px; padding: 6px 9px; }
.trk-grid .trk-corner { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }
.trk-cell { padding: 0; text-align: center; }
.trk-btn {
  width: 100%; min-width: 46px; max-width: 112px; margin: 0 auto; height: 30px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.trk-btn:hover { border-color: var(--brand-3); }
.trk-btn.st-ok { background: var(--ok-soft); color: var(--ok); border-color: #cbe9d4; }
.trk-btn.st-info { background: var(--info-soft); color: var(--info); border-color: #cfdbfa; }
.trk-btn.st-active { background: var(--brand-soft); color: var(--brand-ink); border-color: #b9e6df; }
.trk-btn.st-warn { background: var(--warn-soft); color: var(--warn); border-color: #f3dcb9; }
.trk-btn.st-neutral { background: #eef2f1; color: #4c615d; }
.trk-btn.st-muted { background: #f6f8f7; color: #9aaba7; }
.trk-empty { background: repeating-linear-gradient(45deg, #f7faf9, #f7faf9 5px, #eef4f2 5px, #eef4f2 10px); border-radius: 7px; height: 38px; }
.trk-btn { display: flex; flex-direction: column; justify-content: center; gap: 1px; height: 38px; line-height: 1.05; }
.trk-btn b { font-size: 12px; font-weight: 700; }
.trk-btn span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; opacity: .85; }
.trk-add { width: 100%; height: 38px; border: 1px dashed var(--line); border-radius: 7px; background: transparent; color: var(--muted-2); font-size: 16px; cursor: pointer; }
.trk-add:hover { border-color: var(--brand-3); color: var(--brand); }
.trk-del { border: 0; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; margin-left: 4px; }
.trk-del:hover { color: var(--danger); }
.trk-grid thead th, .trk-grid .trk-rowhead { position: relative; }

/* run sheet print */
.run-sheet { color: #111; }
.run-sheet .table th, .run-sheet .table td { border-color: #ccc; }
@media print {
  .auth { display: none !important; }
  .run-sheet { font-size: 11px; }
}

/* tracking: lab-journal freeze/thaw states
   Received — teal, Thawed — amber, Frozen — blue, Final — green */
.trk-btn { height: auto; min-height: 52px; padding: 4px 3px; gap: 2px; }
.trk-btn b { font-size: 10.5px; font-weight: 650; line-height: 1.1; white-space: normal; }
.trk-btn.st-none { background: #f6f8f7; color: #9aaba7; }
.trk-btn.st-receive { background: #cdeee7; color: #0b5f56; border-color: #9ed8cc; }
.trk-btn.st-thaw { background: #fce3b8; color: #8a4f05; border-color: #f0c98a; }
.trk-btn.st-freeze { background: #d5e2fd; color: #23408f; border-color: #b0c8f8; }
.trk-btn.st-final { background: #cdeed9; color: #186a3f; border-color: #a5ddb9; }
.trk-btn.st-partial, .trk-btn.st-mixed { background: #fff0d8; color: #9a5b06; border-color: #f5d5a3; }
.trk-alqs { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.trk-alq { font-style: normal; font-size: 8.5px; font-weight: 700; line-height: 1; padding: 2px 3px; border-radius: 3px; background: #e6ecea; color: #3d534f; box-shadow: inset 0 0 0 1px rgba(15, 60, 52, .1); }
.trk-alq.st-receive { background: #9fe0d4; color: #06463f; }
.trk-alq.st-thaw { background: #f7c877; color: #6f3c00; }
.trk-alq.st-freeze { background: #adc6fb; color: #16306f; }
.trk-alq.st-final { background: #a6e0bb; color: #0f5b34; }
.trk-when { font-size: 8.5px; color: #6b807c; white-space: nowrap; }
.trk-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11.5px; color: var(--muted); padding: 10px 0 2px; }
.trk-setup .field label { font-size: 10.5px; }

.pick-item.is-short { border-color: var(--danger) !important; background: #fef2f2; }


.trk-name { width:100%; min-width:70px; border:1px solid transparent; background:transparent; text-align:center; font-size:11px; font-weight:600; color:#3d534f; padding:3px 4px; border-radius:5px; }
.trk-name:hover { border-color: var(--line); }
.trk-name:focus { border-color: var(--brand-3); background: var(--surface); outline:none; }
.trk-rowhead .trk-name { text-align:left; font-family: var(--mono); }


/* equipment date alerts */
tr.row-overdue { background: #fef2f2 !important; }
tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
tr.row-missing { background: #fff7ed !important; }
tr.row-missing td:first-child { box-shadow: inset 3px 0 0 #d97706; }

