/* Logs - same layout as Vessel Maintenance, darker blue theme. System fonts only (works offline). */
:root {
  --hull: #061630;        /* sidebar, headings */
  --hull-2: #0F2F5E;
  --spray: #6FAEF5;       /* highlights on dark */
  --bg: #D7E0EC;
  --surface: #FFFFFF;
  --surface-2: #ECF1F8;
  --line: #B6C6DC;
  --line-2: #D6E0EE;
  --ink: #0B1829;
  --muted: #475A7C;
  --accent: #154A99;
  --accent-ink: #FFFFFF;
  --over: #BE3328;
  --over-bg: #FBEAE8;
  --soon: #A86D00;
  --soon-bg: #FDF3DD;
  --ok: #2B7550;
  --ok-bg: #E5F2EA;
  --unk: #6E7C81;
  --display: "Bahnschrift", "DIN Alternate", "DIN 2014", "Barlow", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: .005em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.num, .mono { font-family: var(--display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--hull); color: #D6E4F7; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 30px; height: 30px; color: var(--spray); flex: none; }
.brand-vessel { font-family: var(--display); font-size: 17px; font-weight: 600; color: #fff; line-height: 1.2; word-break: break-word; }
.brand-sub { font-size: 12px; color: #8EA9D1; }
.nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 1px; flex: 1; overflow: auto; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 5px; color: #C3D5F0; text-decoration: none; font-size: 14.5px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: var(--hull-2); color: #fff; box-shadow: inset 3px 0 0 var(--spray); }
.side { background: linear-gradient(180deg, #050F22 0%, #0A1F42 100%); }
.nav-low { margin-top: auto; }
.pill { font: 600 12px/1 var(--display); padding: 4px 7px; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; }
.pill:empty { display: none; }
.pill.over { background: var(--over); }
.pill.soon { background: #C98A12; }
.side-foot { padding: 12px 18px 16px; font-size: 12px; color: #7C97C2; border-top: 1px solid rgba(255,255,255,.08); }
.menu-btn { display: none; }
.main { padding: 26px 34px 60px; min-width: 0; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #A9BDDB; background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #0F3A7A; }
.btn.danger { color: var(--over); }
.btn.danger:hover { border-color: var(--over); background: var(--over-bg); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sign { background: var(--hull); border-color: var(--hull); color: #fff; }
.btn.sign:hover { background: var(--hull-2); }
.btn:disabled { opacity: .55; cursor: default; }
input[type=text], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 14.5px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21,74,153,.22); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: #1D3154; margin-bottom: 4px; }
label.f > em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
.check input { margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 300px; }
.toolbar select { width: auto; }
fieldset.seg { border: 0; padding: 0; margin: 0 0 12px; display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
fieldset.seg label { padding: 6px 13px; cursor: pointer; font-size: 14px; border-right: 1px solid var(--line); }
fieldset.seg label:last-child { border-right: 0; }
fieldset.seg input { position: absolute; opacity: 0; pointer-events: none; }
fieldset.seg label:has(input:checked) { background: var(--hull); color: #fff; }
fieldset.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- panels & tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.panel-body { padding: 16px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #E4ECF8; }
table.t .r { text-align: right; }
.tablewrap { overflow-x: auto; }
.kv { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--line-2); color: #1D3154; white-space: nowrap; }
.tag.over { background: var(--over-bg); color: var(--over); }
.tag.soon { background: var(--soon-bg); color: var(--soon); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.crit { background: var(--hull); color: #fff; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: transparent; flex: none; }
.dot.overdue { background: var(--over); }
.dot.soon { background: #D4950F; }
.dot.ok { background: var(--ok); }

/* ---------- due board (the signature element) ---------- */
.due-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { text-decoration: none; color: var(--ink); display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 22px; cursor: pointer; font-size: 14px; }
.chip b { font: 600 18px/1 var(--display); }
.chip.on { border-color: var(--hull); box-shadow: inset 0 0 0 1px var(--hull); }
.chip.over b { color: var(--over); }
.chip.soon b { color: var(--soon); }
.chip.ok b { color: var(--ok); }
.due-group { margin-bottom: 22px; }
.due-group > h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 0 8px 2px; }
.due-list { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.due-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 16px; align-items: center; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line-2); }
.due-row:last-child { border-bottom: 0; }
.due-row:hover { background: #F5F8FD; }
.gauge { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding-left: 16px; border-left: 5px solid var(--unk); }
.gauge .big { font: 600 25px/1.05 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.gauge .u { font-size: 12px; color: var(--muted); }
.gauge .alt { font: 500 13px/1.3 var(--display); color: var(--muted); margin-top: 2px; }
.due-row.overdue .gauge { border-left-color: var(--over); }
.due-row.overdue .gauge .big { color: var(--over); }
.due-row.soon .gauge { border-left-color: #D4950F; }
.due-row.soon .gauge .big { color: var(--soon); }
.due-row.ok .gauge { border-left-color: #8DBFA4; }
.due-row.ok .gauge .big { color: var(--ok); }
.due-main { min-width: 0; }
.due-title { font-weight: 600; font-size: 15.5px; }
.due-title a { color: var(--ink); text-decoration: none; }
.due-title a:hover { color: var(--accent); text-decoration: underline; }
.due-comp { font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.due-comp a { color: inherit; text-decoration: none; }
.due-comp a:hover { color: var(--accent); text-decoration: underline; }
.due-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.due-meta b { font-weight: 600; color: #33496E; }

.meter-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.meter { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.meter .num { font-size: 20px; font-weight: 600; }
.meter .lbl { font-size: 13px; line-height: 1.25; }
.meter .lbl .muted { font-size: 12px; }

/* ---------- component tree ---------- */
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 26px; }
.node { display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border-bottom: 1px solid var(--line-2); }
.node:hover { background: #F2F7FD; }
.node .tw { width: 22px; height: 22px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 4px; flex: none; font-size: 11px; }
.node .tw:hover { background: var(--line-2); }
.node .tw.leaf { visibility: hidden; }
.node .code { font: 600 14px var(--display); font-variant-numeric: tabular-nums; min-width: 76px; color: var(--hull-2); }
.node .nm { flex: 1; min-width: 0; }
.node .nm a { color: var(--ink); text-decoration: none; font-weight: 500; }
.node .nm a:hover { color: var(--accent); text-decoration: underline; }
.node .info { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.node.archived .nm a, .node.archived .code { color: #9AA9C2; text-decoration: line-through; }
.tree > li > .node { background: var(--surface-2); }
.tree > li > .node .code { font-size: 15px; }

/* ---------- component page ---------- */
.comp-head h1 .num { color: var(--hull-2); margin-right: 10px; }
.comp-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 11px 13px 10px; cursor: pointer; font-size: 14.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs button .c { font: 600 12px var(--display); color: var(--muted); margin-left: 4px; }

/* history timeline */
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.hist li:last-child { border-bottom: 0; }
.hist .when { font: 600 14px/1.3 var(--display); font-variant-numeric: tabular-nums; }
.hist .when .muted { font-weight: 500; font-size: 12.5px; display: block; }
.hist .what { font-weight: 600; }
.hist .rem { white-space: pre-wrap; margin-top: 3px; font-size: 14px; }
.hist .by { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.hist .row-acts { float: right; display: flex; gap: 4px; }
.kind { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 9px; margin-left: 6px; vertical-align: 1px; }
.kind.planned { background: #DCE9FB; color: #174F9E; }
.kind.unplanned { background: #EEE8F6; color: #5C3F86; }
.kind.defect { background: var(--over-bg); color: var(--over); }
.kind.note { background: var(--line-2); color: var(--muted); }

/* attachments */
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { width: 84px; height: 64px; border-radius: 5px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; background: var(--surface-2); }
.filechip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 13px; background: var(--surface-2); color: var(--ink); text-decoration: none; max-width: 280px; }
.filechip:hover { border-color: var(--accent); }
.filechip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext { font: 700 10.5px var(--display); background: var(--hull-2); color: #fff; padding: 2px 5px; border-radius: 3px; text-transform: uppercase; flex: none; }
.ext.pdf { background: #A8322A; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.doc { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.doc .pv { height: 120px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line-2); }
.doc .pv img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.doc .pv .ext { font-size: 15px; padding: 6px 10px; }
.doc .meta { padding: 9px 11px; font-size: 13px; flex: 1; }
.doc .meta a.fn { font-weight: 600; color: var(--ink); text-decoration: none; word-break: break-word; }
.doc .meta a.fn:hover { color: var(--accent); text-decoration: underline; }
.doc .acts { display: flex; gap: 4px; padding: 0 8px 8px; }
.drop { border: 2px dashed #B3C6E2; border-radius: 8px; padding: 18px; text-align: center; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.drop.over { border-color: var(--accent); background: #E3EEFC; color: var(--accent); }
.drop input { display: none; }
.pending-files { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13.5px; }
.pending-files li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dotted var(--line); }

/* ---------- modal / toast / lightbox ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8,22,46,.5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; z-index: 50; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 620px; box-shadow: 0 18px 50px rgba(0,0,0,.25); animation: rise .16s ease-out; }
.modal.wide { max-width: 820px; }
.modal-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 18px 20px 6px; }
.modal-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-2); margin-top: 8px; }
.modal-foot .left { margin-right: auto; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 4px; }
.x:hover { background: var(--line-2); }
.err { background: var(--over-bg); color: var(--over); padding: 8px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 12px; }
.procedure { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; margin-bottom: 14px; max-height: 220px; overflow: auto; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--hull); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--over); }
.lightbox { position: fixed; inset: 0; background: rgba(4,12,28,.9); z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); border-radius: 4px; }
.lightbox .cap { color: #DCE6F5; margin-top: 10px; font-size: 14px; }
.picklist { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.picklist label { display: flex; gap: 9px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 14px; }
.picklist label:hover { background: var(--surface-2); }
.picklist .code { font: 600 13.5px var(--display); min-width: 70px; color: var(--hull-2); }
.spare-use { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.low { color: var(--over); font-weight: 600; }
.welcome ol { padding-left: 20px; margin: 10px 0 0; }
.welcome li { margin-bottom: 6px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .comp-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .menu-btn { display: block; position: fixed; top: 12px; left: 12px; z-index: 30; background: var(--hull); color: #fff; border: 0; border-radius: 6px; width: 38px; height: 38px; font-size: 18px; }
  .main { padding: 62px 16px 40px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .due-row { grid-template-columns: 90px 1fr; }
  .due-row .due-act { grid-column: 2; }
  .hist li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- print (work list) ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .side, .menu-btn, .actions, .due-filters, .no-print, .toast, .btn { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .due-list, .panel { border: 1px solid #999; }
  .due-row { break-inside: avoid; padding: 8px 10px 8px 0; grid-template-columns: 90px 1fr 140px; }
  .print-sign { display: block !important; border-bottom: 1px solid #555; height: 26px; font-size: 10px; color: #555; }
  a { color: inherit; text-decoration: none; }
}
.print-sign { display: none; }
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ---------- v1.1: back button, linked hours, quick hours ---------- */
.nav-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.nav-row .crumbs { margin: 0; }
.btn.back { background: #DCE8FA; border-color: #BCD1F0; color: var(--hull-2); font-weight: 600; }
.btn.back:hover { background: #CCDDF7; border-color: #9DBCE8; }
.hours-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 4px; margin-bottom: 14px; background: var(--surface-2); }
.hb-title { display: block; font-size: 13px; font-weight: 600; color: #1D3154; margin-bottom: 8px; }
.hm-opt { display: flex; gap: 9px; align-items: flex-start; padding: 7px 8px; border-radius: 6px; cursor: pointer; margin-bottom: 4px; border: 1px solid transparent; }
.hm-opt:hover { background: #fff; }
.hm-opt:has(input:checked) { background: #fff; border-color: #9DBCE8; }
.hm-opt input { margin-top: 4px; }
.hm-fields { margin-top: 8px; }
.link-note { font-size: 13px; color: var(--muted); background: #EAF2FD; border-left: 3px solid #5C97E0; padding: 7px 10px; border-radius: 0 5px 5px 0; margin: 10px 0 0; }
.follower { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.follower .num { color: var(--ink); font-weight: 600; }
.meter.quick-hours { gap: 14px; padding: 10px 12px 10px 14px; }
.quick-hours .lbl { display: flex; flex-direction: column; min-width: 130px; }
.quick-hours .lbl a { color: var(--ink); text-decoration: none; }
.quick-hours .lbl a:hover { color: var(--accent); text-decoration: underline; }
.quick-hours .now { font-size: 17px; font-weight: 600; color: var(--hull-2); }
.qh-in { display: flex; gap: 6px; }
.qh-in input { width: 116px; }
tr.linked-row td:first-child { padding-left: 30px; position: relative; }
tr.linked-row td:first-child::before { content: ""; position: absolute; left: 16px; top: 0; height: 22px; width: 9px; border-left: 2px solid #9DBCE8; border-bottom: 2px solid #9DBCE8; border-bottom-left-radius: 4px; }

/* ---------- v1.3: due page filters ---------- */
.due-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.due-opts .lbl { font-size: 13px; font-weight: 600; color: #1D3154; }
.due-opts fieldset.seg { margin: 0; }
.due-opts .win { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.due-opts .win input { width: 84px; }
.due-opts select { width: auto; max-width: 240px; }
.print-filter { margin: 0 0 10px; font-size: 12px; }

/* ---------- logbook ---------- */
.lb-sec { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 2px; margin-bottom: 14px; background: var(--surface-2); }
.lb-sec > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--hull-2); margin: 0 0 10px; }
.lb-filters input[type=date] { width: auto; }
.lb-filters .lbl { font-size: 13px; font-weight: 600; color: #1D3154; }
table.lb td.d { white-space: nowrap; font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 600; }
table.lb td.act { white-space: pre-wrap; }
table.lb td.pob { font-family: var(--display); font-weight: 600; font-size: 15px; }
table.lb tr.month td { background: var(--hull); color: #DDE8F8; font: 600 13px var(--display); letter-spacing: .03em; padding: 6px 12px; }
@media print { table.lb tr.month td { print-color-adjust: exact; -webkit-print-color-adjust: exact; } .lb-filters { display: none !important; } }
.lb-sec > h3 .unit { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 6px; }
.rob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.rob-col { background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px 2px; margin-bottom: 10px; }
.rob-col h4 { margin: 0 0 8px; font: 600 15px var(--display); color: var(--hull); }
.rob-col label.f { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; margin-bottom: 8px; }
.rob-col label.f > span { margin: 0; }
.rob-col input { text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; }
.rob-end { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; border-top: 2px solid var(--hull); margin: 4px 0 10px; padding-top: 8px; }
.rob-end span { font-size: 13px; font-weight: 700; color: var(--hull); }
.rob-end b { text-align: right; font: 600 19px var(--display); font-variant-numeric: tabular-nums; color: var(--hull-2); padding-right: 11px; }
.rob-end b.neg { color: var(--over); }
table.lb td.rob { font-family: var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 820px) { .rob-grid { grid-template-columns: 1fr; } }
.modal.xwide { max-width: 1180px; }
.tl-n { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-wrap { background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; }
table.tl { width: 100%; border-collapse: collapse; min-width: 900px; }
table.tl th { text-align: left; font-size: 12px; font-weight: 600; color: #1D3154; padding: 7px 6px; background: var(--surface-2); border-bottom: 2px solid var(--hull); vertical-align: bottom; line-height: 1.25; }
table.tl th i { display: block; font-style: normal; font-weight: 500; color: var(--muted); }
table.tl td { padding: 4px 3px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.tl tr:last-child td { border-bottom: 0; }
table.tl input, table.tl select, table.tl textarea { padding: 6px 7px; font-size: 14px; }
table.tl .c-time { width: 74px; }
table.tl .c-time input { font-family: var(--display); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
table.tl .c-num { width: 84px; }
table.tl .c-num input { text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; }
table.tl .c-dir { width: 92px; }
table.tl .c-x { width: 34px; text-align: center; }
table.tl textarea { min-height: 34px; resize: none; overflow: hidden; line-height: 1.4; }
table.tl input.bad { border-color: var(--over); background: var(--over-bg); }
.rob-col h4 .unit { font: 500 12.5px var(--body); color: var(--muted); margin-left: 4px; }

/* ---------- v1.4: open day, history, summary ---------- */
.day-card { margin-bottom: 24px; }
.day-card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--hull); }
.day-card-head h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-card-head .sub { color: var(--muted); margin-top: 2px; }
.page-head h1 .tag { font-family: var(--body); vertical-align: 4px; margin-left: 6px; }
.day-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.day-grid .panel + .panel { margin-top: 0; }
.panel.day-tl { margin-bottom: 14px; }
table.day-rob th:first-child { width: 100px; }
table.day-rob td { text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; }
table.day-rob thead th:not(:first-child) { text-align: right; }
table.day-rob tbody th { text-align: left; font-weight: 600; color: var(--muted); background: transparent; border-bottom: 1px solid var(--line-2); }
table.day-rob tr.end th, table.day-rob tr.end td { border-top: 2px solid var(--hull); font-weight: 700; color: var(--hull); }
table.tl-view th span { font-weight: 500; }
table.tl-view td.tm { font: 600 14px var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tl-view td.narr { white-space: pre-wrap; min-width: 260px; }
.hist-tabs { margin-bottom: 14px; padding: 0; }
table.sum th span { display: block; font-weight: 500; }
table.sum th, table.sum td { white-space: nowrap; padding-left: 9px; padding-right: 9px; }
table.sum td:nth-child(2) { white-space: normal; min-width: 140px; }
table.sum th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
table.sum .grp { border-left: 1px solid var(--line-2); }
table.sum td.tot { color: var(--hull-2); font-weight: 700; background: #F1F5FB; }
table.sum tfoot th { background: var(--hull); color: #fff; padding: 9px 12px; font-family: var(--display); font-size: 14px; }
@media (max-width: 1100px) { .day-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .day-grid { grid-template-columns: 1fr; } }
@media print {
  .day-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .day-card-head .actions { display: none; }
  table.sum tfoot th, table.sum td.tot { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .tag { border: 1px solid #999; }
}

/* ---------- v1.5: procedures & manuals, defect link ---------- */
.btn.defect { color: var(--over); border-color: #E3B4AF; background: #FFF7F6; font-weight: 600; }
.btn.defect:hover { background: var(--over-bg); border-color: var(--over); }
.doc-drop { margin-bottom: 16px; padding: 14px; }
.doc-group { margin-bottom: 16px; }
.doc-group + .doc-group { margin-top: 0; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list li:hover { background: #F2F6FC; }
.doc-list .ext { font-size: 11px; padding: 4px 6px; min-width: 38px; text-align: center; }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; }
.doc-title:hover { color: var(--accent); text-decoration: underline; }
.doc-notes { margin-top: 3px; white-space: pre-wrap; color: #1D3154; }
.doc-acts { display: flex; gap: 4px; flex: none; }
.up-list { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px 0; max-height: 50vh; overflow: auto; margin-bottom: 8px; }
.up-row { display: grid; grid-template-columns: 44px 1fr 80px; gap: 10px; align-items: center; }
.up-row .ext { text-align: center; }
.up-prog { font-size: 13px; color: var(--muted); text-align: right; }
.up-prog.ok { color: var(--ok); font-weight: 600; }
@media (max-width: 820px) { .doc-list li { flex-wrap: wrap; } .doc-acts { width: 100%; justify-content: flex-end; } }

/* ---------- v1.6: % remaining ---------- */
.rob-pct { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; margin: -2px 0 2px; }
.rob-pct span:first-child { font-size: 13px; font-weight: 600; color: #1D3154; }
.rob-pct > b { text-align: right; padding-right: 11px; font-weight: 600; }
.rob-cap { text-align: right; padding-right: 11px; margin-bottom: 10px; }
.pct { display: inline-flex; align-items: center; gap: 8px; font: 600 16px var(--display); font-variant-numeric: tabular-nums; color: var(--ok); }
.pct .bar { width: 70px; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; display: inline-block; }
.pct .bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.pct.mid { color: var(--soon); } .pct.mid .bar i { background: #D4950F; }
.pct.low, .pct.over { color: var(--over); } .pct.low .bar i, .pct.over .bar i { background: var(--over); }
.warn { display: block; font: 500 12px var(--body); color: var(--over); margin-top: 2px; }
table.day-rob tr.pct-row th, table.day-rob tr.pct-row td { border-bottom: 0; }
table.day-rob tr.pct-row .pct { font-size: 14px; }
table.day-rob tr.pct-row .pct .bar { width: 46px; }
@media print { .pct .bar, .pct .bar i { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* ---------- v1.8: fuel performance ---------- */
.perf-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-bottom: 10px; }
.perf-strip > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; background: var(--hull); color: #DDE8F8; border-radius: 6px; padding: 10px 14px; }
.perf-strip span { font-size: 13px; font-weight: 600; }
.perf-strip b { font: 600 20px var(--display); font-variant-numeric: tabular-nums; color: #fff; text-align: right; }
.perf-strip em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: #9DB5D8; }
.kv .perf-dt, .kv .perf-dd { border-top: 1px solid var(--line-2); padding-top: 6px; margin-top: 2px; }
.perf-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.perf-card { background: var(--hull); color: #DDE8F8; border-radius: 8px; padding: 14px 18px; }
.perf-card .k { font-size: 13.5px; font-weight: 600; }
.perf-card .v { font: 600 32px/1.15 var(--display); color: #fff; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.perf-card .v span { font-size: 15px; font-weight: 500; color: #9DB5D8; }
.perf-card .n { font-size: 12.5px; color: #9DB5D8; }
table.sum td.perf { color: var(--hull-2); font-weight: 600; }
@media (max-width: 820px) { .perf-strip, .perf-cards { grid-template-columns: 1fr; } .perf-strip > div + div { margin-top: 8px; } }
@media print { .perf-card, .perf-strip > div { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* ---------- v1.9: actual vs estimated ROB ---------- */
.rtag { display: inline-block; font: 700 10px/1 var(--body); padding: 3px 4px; border-radius: 3px; vertical-align: 2px; margin-left: 2px; }
.rtag.act { background: var(--ok); color: #fff; }
.rtag.est { background: var(--line-2); color: var(--muted); }
.act-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 2px 0 8px; cursor: pointer; color: #1D3154; }
.act-chk input { margin-top: 2px; }
.act-box { background: #EEF6F1; border: 1px solid #BFDCCB; border-radius: 6px; padding: 8px 10px 2px; margin-bottom: 8px; }
.act-box label.f { margin-bottom: 6px; }
.act-box .adj { font-size: 12.5px; color: var(--ok); margin: 0 0 6px; }
.rob-end b.struck { color: var(--muted); text-decoration: line-through; font-size: 16px; }
.last-act { text-align: right; padding-right: 11px; margin: -6px 0 10px; }
table.day-rob tr.est-row td { color: var(--muted); }
table.day-rob .adj { font: 500 11.5px var(--body); color: var(--ok); }
.perf-cards { grid-template-columns: repeat(4, 1fr); }
.perf-card.light { background: var(--surface); color: #1D3154; border: 1px solid var(--line); }
.perf-card.light .v { color: var(--hull-2); }
.perf-card.light .v span, .perf-card.light .n { color: var(--muted); }
.panel.verified { margin: 18px 0 12px; border-top: 3px solid var(--ok); }
table.sum td.diff { color: var(--over); font-weight: 600; }
table.sum td a { color: var(--ink); }
@media (max-width: 1200px) { .perf-cards { grid-template-columns: 1fr 1fr; } }
.rob-col label.f, .rob-end, .rob-pct { grid-template-columns: 106px 1fr; }
