/* IVF lab dashboard — builds on tokens.css + journey.css; colours only through their variables (ruby = alarm / overdue). */
.ld-tiles { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 14px; }
@media (max-width: 1280px) { .ld-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ld-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ld-tile { background: var(--white); border: 1px solid var(--border-soft); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ld-tile .label { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.ld-tile .num { font-size: 32px; font-weight: 700; color: var(--dept-deep); line-height: 1.1; }
.ld-tile .num a { color: inherit; }
.ld-tile .num small { font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.ld-tile .flags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.ld-tile .flags a { border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; background: var(--pill-danger-bg); color: var(--pill-danger-ink); }
.ld-tile.ruby { background: var(--ruby-muted); border-color: var(--ruby); border-left: 6px solid var(--ruby); }
.ld-tile.ruby .num, .ld-tile.ruby .num a { color: var(--ruby-dark); }
.ld-tile.complete:not(.ruby) { border-left: 6px solid var(--emerald); }

.ld-alarms { border: 1.5px solid var(--ruby); background: var(--ruby-muted); border-radius: 6px; padding: 12px 16px; margin-bottom: 14px; }
.ld-alarms.clear { border-color: var(--emerald); background: var(--emerald-muted); }
.ld-alarms h2 { margin: 0 0 8px; font-size: 17px; color: var(--ruby-dark); display: flex; align-items: center; gap: 10px; }
.ld-alarms.clear h2 { color: var(--emerald-dark); }
.ld-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ld-chip { border: 0; cursor: pointer; border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 700; background: var(--pill-danger-bg); color: var(--pill-danger-ink); display: inline-flex; gap: 8px; align-items: center; }
.ld-chip b { background: var(--white); color: var(--ruby-dark); border-radius: 999px; min-width: 24px; padding: 0 7px; text-align: center; }
.ld-chip.on { box-shadow: 0 0 0 3px var(--ruby-line); }
.ld-alarm-rows { margin-top: 10px; background: var(--white); border: 1px solid var(--ruby-line); border-radius: 6px; }
.ld-alarm-rows .r { display: flex; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border-soft); align-items: baseline; }
.ld-alarm-rows .r:first-child { border-top: 0; }
.ld-alarm-rows .r .sub { color: var(--ink-soft); font-size: 13.5px; }

.ld-tl { position: relative; overflow-x: auto; }
.ld-tl-inner { min-width: 780px; }
.ld-tl-head, .ld-tl-row { display: grid; grid-template-columns: 170px 1fr; align-items: stretch; }
.ld-tl-head .track { position: relative; height: 26px; }
.ld-tl-head .hour { position: absolute; top: 4px; transform: translateX(-50%); font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.ld-tl-row { border-top: 1px solid var(--border-soft); }
.ld-tl-row .rowname { padding: 10px 8px; font-weight: 700; color: var(--ink); font-size: 14.5px; }
.ld-tl-row .rowname small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 12.5px; }
.ld-tl-row .track { position: relative; background: var(--cream-deep); }
.ld-tl .gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-soft); }
.ld-tl .nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ruby); z-index: 3; }
.ld-block { position: absolute; height: 34px; border-radius: 6px; padding: 3px 7px; overflow: hidden; font-size: 12.5px; line-height: 1.25; z-index: 2; min-width: 18px;
  border-left: 4px solid var(--sapphire-deep); background: var(--pill-info-bg); color: var(--pill-info-ink); display: block; }
.ld-block b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.ld-block span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-block.done { background: var(--pill-ok-bg); color: var(--pill-ok-ink); border-left-color: var(--emerald-dark); }
.ld-block.failed { background: var(--pill-danger-bg); color: var(--pill-danger-ink); border-left-color: var(--ruby-dark); }
.ld-block.blocked { background: var(--pill-warn-bg); color: var(--pill-warn-ink); border-left-color: var(--ruby); box-shadow: inset 0 0 0 1.5px var(--ruby); }
.ld-block.overdue { box-shadow: inset 0 0 0 2px var(--ruby); border-left-color: var(--ruby); }
.ld-untimed { padding: 4px 8px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.ld-untimed a { border-radius: 6px; padding: 3px 8px; font-size: 12.5px; font-weight: 700; background: var(--pill-info-bg); color: var(--pill-info-ink); }
.ld-untimed a.done { background: var(--pill-ok-bg); color: var(--pill-ok-ink); }
.ld-untimed a.failed { background: var(--pill-danger-bg); color: var(--pill-danger-ink); }
.ld-untimed a.blocked { background: var(--pill-warn-bg); color: var(--pill-warn-ink); box-shadow: inset 0 0 0 1.5px var(--ruby); }
.ld-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.ld-two { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; align-items: start; }
@media (max-width: 1100px) { .ld-two { grid-template-columns: 1fr; } }
.ld-two .card + .card { margin-top: 0; }
.ld-tanks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ld-tank { border: 1px solid var(--border-soft); border-radius: 6px; padding: 12px 14px; background: var(--white); }
.ld-tank h3 { margin: 0 0 6px; font-size: 15.5px; color: var(--ink); }
.ld-tank .bar { height: 8px; border-radius: 999px; background: var(--sand-deep); overflow: hidden; margin: 6px 0; }
.ld-tank .bar i { display: block; height: 100%; background: var(--sapphire); }
.ld-tank .reading { font-size: 14px; font-weight: 700; }
.ld-tank .reading.open { color: var(--ruby-dark); }
.ld-tank .reading.in_range, .ld-tank .reading.corrected { color: var(--emerald-dark); }
.ld-month { display: grid; gap: 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 14px; }
@media (max-width: 1100px) { .ld-month { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ld-cell { border: 1px solid var(--border-soft); border-radius: 6px; padding: 10px 12px; background: var(--white); display: block; color: var(--ink); }
.ld-cell .label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.ld-cell .v { font-size: 24px; font-weight: 700; color: var(--dept-deep); }
.ld-cell .nd { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.ld-sub { margin: 12px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
