/* ==========================================================================
   Al Borj Pathology — design system
   Palette: royal blue from the Al Borj mark, cool neutrals, calm surfaces.
   The logo is crimson and royal blue; blue carries the interface because a
   red accent cannot be told apart from a destructive action, and crimson
   stays reserved for errors, deletions and the brand mark itself.
   ========================================================================== */

:root {
  --ab-accent: #12508f;
  --ab-accent-strong: #0b3d73;
  --ab-accent-soft: #dbe8fb;
  --ab-accent-tint: #f2f6fd;

  --ab-ink: #14212b;
  --ab-ink-soft: #4b5c68;
  --ab-muted: #7b8b96;
  --ab-line: #e3e9ed;
  --ab-line-strong: #cfd9df;
  --ab-surface: #ffffff;
  --ab-canvas: #f6f8f9;
  --ab-canvas-deep: #eef2f4;

  /* The logo's crimson, for the brand mark and for emphasis that is not an
     error. Errors keep their own --ab-rose below. */
  --ab-brand-red: #b0161a;

  --ab-violet: #6d5ae6;
  --ab-amber: #b45309;
  --ab-rose: #be123c;

  --ab-radius: 14px;
  --ab-radius-sm: 9px;
  --ab-shadow-sm: 0 1px 2px rgba(16, 33, 43, .06), 0 1px 3px rgba(16, 33, 43, .04);
  --ab-shadow: 0 2px 4px rgba(16, 33, 43, .04), 0 8px 24px rgba(16, 33, 43, .06);

  --ab-sidebar-w: 244px;
  --ab-topbar-h: 62px;

  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --bs-body-color: var(--ab-ink);
  --bs-body-bg: var(--ab-canvas);
  --bs-primary: var(--ab-accent);
  --bs-border-color: var(--ab-line);
  --bs-border-radius: var(--ab-radius-sm);
}

* { -webkit-font-smoothing: antialiased; }

body {
  background: var(--ab-canvas);
  color: var(--ab-ink);
  font-size: .9375rem;
  letter-spacing: -.005em;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; color: var(--ab-ink); }

a { color: var(--ab-accent-strong); text-decoration: none; }
a:hover { color: var(--ab-accent); }

/* ---------------------------------------------------------------- layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--ab-sidebar-w);
  flex: 0 0 var(--ab-sidebar-w);
  background: #0f1f33;
  color: #cbdaea;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .18s ease;
}

.sidebar-brand {
  height: var(--ab-topbar-h);
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}
.sidebar-brand:hover { color: #fff; }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, #cf2328, #9c1115);
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; color: #fff;
  flex: 0 0 32px;
}
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong {
  display: block; font-size: .9rem; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text span { font-size: .68rem; color: #8199b4; letter-spacing: .04em; text-transform: uppercase; }
/* An uploaded logo sits inside the same box as the initials, so the row does
   not shift when one is added. object-fit keeps a non-square mark from
   squashing. */
.brand-logo { object-fit: contain; background: #fff; padding: 2px; }

.sidebar-nav { padding: .85rem .7rem; flex: 1; overflow-y: auto; }
.nav-section {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #6d86a3;
  padding: .9rem .55rem .4rem;
  font-weight: 600;
}
.nav-link-ab {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .6rem;
  border-radius: 9px;
  color: #b7c9dc;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.nav-link-ab i { font-size: 1.02rem; width: 1.2rem; text-align: center; opacity: .85; }
.nav-link-ab:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link-ab.active { background: rgba(56, 132, 224, .22); color: #cfe3ff; }
.nav-link-ab.active i { opacity: 1; }
.nav-link-ab .count {
  margin-left: auto;
  font-size: .7rem;
  background: rgba(255, 255, 255, .12);
  padding: .05rem .4rem;
  border-radius: 20px;
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: .75rem .9rem;
}
.user-chip { display: flex; align-items: center; gap: .65rem; color: #cbdaea; }
.user-chip:hover { color: #fff; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(56, 132, 224, .26);
  color: #d3e6ff;
  display: grid; place-items: center;
  font-weight: 650; font-size: .78rem;
  flex: 0 0 34px;
}
.avatar-lg { width: 46px; height: 46px; border-radius: 13px; font-size: .95rem; flex-basis: 46px; }
.user-chip .meta { line-height: 1.2; min-width: 0; }
.user-chip .meta strong { display: block; font-size: .8rem; font-weight: 600; }
.user-chip .meta span { font-size: .7rem; color: #8199b4; }

.main-area {
  margin-left: var(--ab-sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--ab-topbar-h);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ab-line);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar .page-heading { line-height: 1.15; min-width: 0; }
.topbar .page-heading h1 { font-size: 1.02rem; font-weight: 650; margin: 0; }
.topbar .page-heading p { margin: 0; font-size: .76rem; color: var(--ab-muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
/* A button label must not wrap in the topbar: "New role" broke across two
   lines and made the header taller than the page title beside it. */
.topbar-actions .btn { white-space: nowrap; }

.page { padding: 1.5rem; flex: 1; }
.page-narrow { max-width: 900px; margin: 0 auto; }
.page-medium { max-width: 1180px; margin: 0 auto; }

/* ---------------------------------------------------------------- cards */
.card {
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius);
  box-shadow: var(--ab-shadow-sm);
  background: var(--ab-surface);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--ab-line);
  padding: .85rem 1.05rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.card-header h2, .card-header .card-title {
  font-size: .84rem;
  font-weight: 650;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: var(--ab-ink-soft);
}
.card-header .card-actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.card-body { padding: 1.05rem; }
.card-body.tight { padding: .65rem; }

.stat-card {
  background: var(--ab-surface);
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius);
  padding: .9rem 1rem;
  box-shadow: var(--ab-shadow-sm);
  height: 100%;
}
.stat-card .stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ab-muted);
  font-weight: 600;
}
.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 680;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-top: .2rem;
}
.stat-card .stat-foot { font-size: .72rem; color: var(--ab-muted); }
.stat-card.accent { background: linear-gradient(150deg, #12508f, #0b3d73); border-color: transparent; }
.stat-card.accent .stat-label, .stat-card.accent .stat-foot { color: #b7d3f2; }
.stat-card.accent .stat-value { color: #fff; }

/* ---------------------------------------------------------------- tables */
.table-ab { margin: 0; --bs-table-bg: transparent; }
.table-ab > :not(caption) > * > * { padding: .62rem .9rem; border-bottom-color: var(--ab-line); vertical-align: middle; }
.table-ab thead th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .055em;
  color: var(--ab-muted);
  font-weight: 650;
  background: #fafbfb;
  border-bottom: 1px solid var(--ab-line-strong);
  white-space: nowrap;
}
.table-ab tbody tr { transition: background .1s; }
.table-ab tbody tr:hover { background: var(--ab-accent-tint); }
.table-ab td { font-size: .855rem; }
.table-ab .cell-strong { font-weight: 600; color: var(--ab-ink); }
.table-ab .cell-mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; }
/* Accession numbers and MRNs must never break across lines. */
.table-ab .cell-mono, .table-ab .nowrap-ab { white-space: nowrap; }
.table-ab td.cell-patient { min-width: 190px; }
.table-ab td.cell-specimen { max-width: 200px; }
/* A cell holding a wrapped list of chips takes the leftover width, so the short
   numeric columns beside it stay narrow instead of the chips stacking one per
   line in a 230px column. */
.table-ab td.cell-fill { width: 100%; }
.table-ab td.cell-fill .chip { white-space: nowrap; }

.row-link { cursor: pointer; }

/* ---------------------------------------------------------------- badges */
.badge-ab {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .71rem;
  font-weight: 600;
  padding: .22rem .55rem;
  border-radius: 20px;
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-soft-secondary { background: #f1f4f6; color: #55636d; border-color: #e2e8ec; }
.badge-soft-info { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.badge-soft-primary { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.badge-soft-success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-soft-warning { background: #fef3c7; color: #a16207; border-color: #fde68a; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge-soft-purple { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }

.priority-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------------------------------------------------------------- buttons */
.btn { font-size: .845rem; font-weight: 550; border-radius: var(--ab-radius-sm); padding: .45rem .8rem; }
.btn-sm { font-size: .78rem; padding: .32rem .6rem; border-radius: 7px; }
.btn-lg { font-size: .95rem; padding: .6rem 1.1rem; }
.btn-primary { background: var(--ab-accent); border-color: var(--ab-accent); }
.btn-primary:hover, .btn-primary:focus { background: var(--ab-accent-strong); border-color: var(--ab-accent-strong); }
.btn-outline-primary { color: var(--ab-accent-strong); border-color: #b3cbe8; }
.btn-outline-primary:hover { background: var(--ab-accent-soft); border-color: var(--ab-accent); color: var(--ab-accent-strong); }
.btn-light-ab { background: #fff; border: 1px solid var(--ab-line-strong); color: var(--ab-ink-soft); }
.btn-light-ab:hover { background: var(--ab-canvas); border-color: var(--ab-muted); color: var(--ab-ink); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ab-ink-soft); }
.btn-ghost:hover { background: var(--ab-canvas-deep); color: var(--ab-ink); }

.btn-group-seg { display: inline-flex; background: var(--ab-canvas-deep); padding: 3px; border-radius: 10px; gap: 2px; }
.btn-group-seg .btn { border: none; background: transparent; color: var(--ab-ink-soft); box-shadow: none; }
.btn-group-seg .btn.active { background: #fff; color: var(--ab-ink); box-shadow: var(--ab-shadow-sm); font-weight: 600; }

/* ---------------------------------------------------------------- forms */
.form-label {
  font-size: .775rem;
  font-weight: 600;
  color: var(--ab-ink-soft);
  margin-bottom: .3rem;
  letter-spacing: -.005em;
}
.form-label .req { color: var(--ab-rose); margin-left: 2px; }
.form-text { font-size: .74rem; color: var(--ab-muted); }
.form-control, .form-select {
  font-size: .865rem;
  border-color: var(--ab-line-strong);
  border-radius: var(--ab-radius-sm);
  padding: .48rem .7rem;
  color: var(--ab-ink);
}
.form-control:focus, .form-select:focus {
  border-color: #7fb0e8;
  box-shadow: 0 0 0 3px rgba(18, 80, 143, .12);
}
.form-control::placeholder { color: #a9b6bf; }
.form-control-sm, .form-select-sm { font-size: .8rem; padding: .34rem .55rem; }
.invalid-feedback { font-size: .74rem; }

.search-field { position: relative; }
.search-field i {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  color: var(--ab-muted); font-size: .92rem;
}
.search-field .form-control { padding-left: 2.1rem; }

/* ---------------------------------------------------------------- patient picker */
.patient-picker-selected {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem;
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius-sm);
  background: var(--ab-accent-tint);
}
.patient-picker-results {
  max-height: 232px;
  overflow-y: auto;
  margin-top: .4rem;
  border-radius: var(--ab-radius-sm);
}
.patient-picker-results:not(:empty) {
  border: 1px solid var(--ab-line);
  background: #fff;
  box-shadow: var(--ab-shadow-sm);
}
.picker-option {
  display: flex; align-items: center; gap: .55rem;
  width: 100%;
  padding: .45rem .6rem;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ab-line);
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.picker-option:last-child { border-bottom: 0; }
.picker-option:hover, .picker-option:focus-visible, .picker-option.is-active {
  background: var(--ab-accent-tint);
  outline: none;
}
.picker-option-name { display: block; font-size: .82rem; font-weight: 600; color: var(--ab-ink); }
.picker-option-meta { display: block; font-size: .73rem; color: var(--ab-muted); }
.picker-empty {
  padding: .6rem .15rem;
  font-size: .78rem;
  color: var(--ab-muted);
}

/* ---------------------------------------------------------------- tabs */
.tabs-ab { display: flex; gap: .15rem; border-bottom: 1px solid var(--ab-line); margin-bottom: 1.25rem; }
.tab-ab {
  padding: .55rem .85rem;
  font-size: .855rem;
  font-weight: 550;
  color: var(--ab-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  border-top: none; border-left: none; border-right: none;
  transition: color .12s, border-color .12s;
}
.tab-ab:hover { color: var(--ab-ink); }
.tab-ab.active { color: var(--ab-accent-strong); border-bottom-color: var(--ab-accent); font-weight: 650; }

/* ---------------------------------------------------------------- workflow stepper */
.workflow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: .25rem 0 .5rem;
}
.workflow-step { flex: 1; text-align: center; position: relative; min-width: 0; }
.workflow-step::before {
  content: "";
  position: absolute;
  top: 16px; left: calc(-50% + 18px); right: calc(50% + 18px);
  height: 2px; background: var(--ab-line-strong);
}
.workflow-step:first-child::before { display: none; }
.workflow-step.done::before, .workflow-step.current::before { background: #93bfec; }
.step-dot {
  width: 34px; height: 34px; border-radius: 50%;
  margin: 0 auto .4rem;
  display: grid; place-items: center;
  background: #fff;
  border: 2px solid var(--ab-line-strong);
  color: var(--ab-muted);
  font-size: .8rem; font-weight: 650;
  position: relative; z-index: 1;
}
.workflow-step.done .step-dot { background: var(--ab-accent); border-color: var(--ab-accent); color: #fff; }
.workflow-step.current .step-dot {
  background: #fff; border-color: var(--ab-accent); color: var(--ab-accent-strong);
  box-shadow: 0 0 0 4px rgba(18, 80, 143, .12);
}
.step-label { font-size: .72rem; color: var(--ab-muted); font-weight: 550; line-height: 1.25; }
.workflow-step.current .step-label { color: var(--ab-accent-strong); font-weight: 650; }
.workflow-step.done .step-label { color: var(--ab-ink-soft); }

/* ---------------------------------------------------------------- slide cards */
.slide-card {
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
}
.slide-card:hover { box-shadow: var(--ab-shadow); border-color: var(--ab-line-strong); }
.slide-thumb {
  aspect-ratio: 16 / 10;
  background: var(--ab-canvas-deep) center/cover no-repeat;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slide-thumb .placeholder-icon { font-size: 1.6rem; color: #b9c7ce; }
.slide-thumb .status-veil {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(246, 248, 249, .82);
  backdrop-filter: blur(2px);
  font-size: .78rem;
  font-weight: 600;
  color: var(--ab-ink-soft);
  gap: .4rem;
}
.slide-meta { padding: .7rem .8rem; }
.slide-meta .title { font-size: .82rem; font-weight: 650; display: flex; align-items: center; gap: .4rem; }
.slide-meta .sub { font-size: .72rem; color: var(--ab-muted); }

.dropzone {
  border: 1.5px dashed var(--ab-line-strong);
  border-radius: var(--ab-radius);
  background: #fbfcfc;
  padding: 1.6rem 1rem;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--ab-accent); background: var(--ab-accent-tint); }
.dropzone i { font-size: 1.7rem; color: var(--ab-accent); }
.dropzone .dz-title { font-size: .88rem; font-weight: 600; margin-top: .5rem; }
.dropzone .dz-hint { font-size: .76rem; color: var(--ab-muted); }

/* ---------------------------------------------------------------- detail lists */
.detail-list { display: grid; gap: .55rem; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 132px 1fr; gap: .75rem; align-items: baseline; }
.detail-list dt { font-size: .74rem; color: var(--ab-muted); font-weight: 550; margin: 0; }
.detail-list dd { font-size: .855rem; margin: 0; color: var(--ab-ink); }

/* ---------------------------------------------------------------- timeline */
.timeline { position: relative; padding-left: 1.35rem; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: .35rem; bottom: .35rem;
  width: 1.5px; background: var(--ab-line);
}
.timeline-item { position: relative; padding-bottom: .9rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.35rem; top: .32rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ab-line-strong);
}
.timeline-item.accent::before { border-color: var(--ab-accent); background: var(--ab-accent-soft); }
.timeline-item .t-title { font-size: .8rem; font-weight: 600; }
.timeline-item .t-meta { font-size: .72rem; color: var(--ab-muted); }

/* ---------------------------------------------------------------- empty states */
.empty-state { text-align: center; padding: 2.2rem 1rem; }
.empty-state .icon-wrap {
  width: 52px; height: 52px; border-radius: 15px;
  background: var(--ab-canvas-deep);
  display: grid; place-items: center; margin: 0 auto .8rem;
  font-size: 1.3rem; color: #9aabb4;
}
.empty-state h3 { font-size: .92rem; font-weight: 650; margin-bottom: .25rem; }
.empty-state p { font-size: .8rem; color: var(--ab-muted); margin-bottom: 1rem; }

/* ---------------------------------------------------------------- misc */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 550;
  background: var(--ab-canvas-deep); color: var(--ab-ink-soft);
  padding: .2rem .55rem; border-radius: 7px;
}
/* A permission that changes who governs the platform rather than what someone
   does in the lab. Marked so it is not ticked by reflex. */
.chip-warn {
  background: rgba(217, 119, 6, .1);
  color: #92400e;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .22);
}
.metric-row { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.metric-row .m-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ab-muted); font-weight: 600; }
.metric-row .m-value { font-size: .9rem; font-weight: 600; }

.text-muted-ab { color: var(--ab-muted) !important; }
.text-ink { color: var(--ab-ink) !important; }
.divider { height: 1px; background: var(--ab-line); margin: 1rem 0; }

.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-swapping { opacity: .4; transition: opacity .15s; }

.skeleton {
  background: linear-gradient(90deg, #eef2f4 25%, #f7f9fa 50%, #eef2f4 75%);
  background-size: 200% 100%;
  animation: skeleton 1.3s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.progress-thin { height: 5px; border-radius: 4px; background: var(--ab-canvas-deep); overflow: hidden; }
.progress-thin .bar { height: 100%; background: var(--ab-accent); border-radius: 4px; transition: width .3s; }

/* toasts */
.toast-stack { position: fixed; top: 1rem; right: 1rem; z-index: 1090; display: grid; gap: .5rem; width: min(360px, calc(100vw - 2rem)); }
.toast-ab {
  background: #fff;
  border: 1px solid var(--ab-line);
  border-left: 3px solid var(--ab-accent);
  border-radius: 10px;
  box-shadow: var(--ab-shadow);
  padding: .6rem .8rem;
  display: flex; gap: .6rem; align-items: flex-start;
  font-size: .82rem;
  animation: toast-in .2s ease;
}
.toast-ab.error { border-left-color: var(--ab-rose); }
.toast-ab.warning { border-left-color: #d97706; }
.toast-ab.info { border-left-color: #0284c7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* one-time code entry */
.otp-input {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  letter-spacing: .38em;
  text-align: center;
  text-indent: .38em;
  padding-left: .6rem;
}
.otp-input::placeholder { letter-spacing: .38em; color: var(--ab-line-strong, #cbd5e1); }

/* ---------------------------------------------------------------- notifications */
.notif-bell .notif-dot {
  position: absolute; top: 1px; right: 1px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: #dc2626; color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 16px;
  text-align: center;
  border: 2px solid var(--ab-surface, #fff);
}
.notif-menu {
  width: 360px; max-width: calc(100vw - 2rem);
  padding: 0; border-color: var(--ab-line);
  overflow: hidden;
}
.notif-panel { display: flex; flex-direction: column; max-height: 26rem; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .6rem .75rem;
  border-bottom: 1px solid var(--ab-line);
  font-size: .85rem;
}
.notif-head .chip { margin-left: .35rem; }
.notif-list { overflow-y: auto; }
.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 2rem 1rem; color: var(--ab-muted); font-size: .82rem;
}
.notif-empty i { font-size: 1.3rem; }

.notif-row { border-bottom: 1px solid var(--ab-line); }
.notif-row:last-child { border-bottom: 0; }
.notif-row.unread { background: rgba(18, 80, 143, .06); }
.notif-row form { margin: 0; }
.notif-hit {
  display: flex; align-items: flex-start; gap: .6rem;
  width: 100%; padding: .6rem .75rem;
  background: none; border: 0; text-align: left;
  cursor: pointer; font: inherit; color: inherit;
}
.notif-hit:hover { background: var(--ab-canvas-deep); }
.notif-icon { font-size: .95rem; line-height: 1.2; flex: 0 0 auto; }
.notif-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.notif-title {
  font-size: .82rem; font-weight: 600; line-height: 1.3;
  overflow-wrap: anywhere;
}
.notif-body {
  font-size: .76rem; color: var(--ab-ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-meta { font-size: .7rem; color: var(--ab-muted); }
.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
  background: #12508f; margin-left: auto; margin-top: .35rem;
}

/* print */
@media print {
  .sidebar, .topbar, .no-print, .toast-stack { display: none !important; }
  .main-area { margin-left: 0; }
  .page { padding: 0; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* responsive */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .main-area { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .page { padding: 1rem; }
}
@media (min-width: 992px) { .sidebar-toggle { display: none !important; } }
