:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e2e7ee;
  --line-2: #cfd6e0;
  --text: #16212e;
  --muted: #637083;
  --accent: #1f5f9e;
  --accent-2: #174b7e;
  --accent-soft: #e6eff8;
  --side: #0f1d2e;
  --side-2: #182a40;
  --side-text: #c9d4e2;
  --side-muted: #7f8fa5;
  --ok: #1d7a4c; --ok-bg: #e3f4ea;
  --warn: #9a5b00; --warn-bg: #fdf0d8;
  --bad: #b3261e; --bad-bg: #fbe4e2;
  --info: #2b5d9b; --info-bg: #e5eefa;
  --neutral: #55606e; --neutral-bg: #eceff3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15,29,46,.06), 0 2px 8px rgba(15,29,46,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111821; --panel: #18212c; --panel-2: #1d2733; --line: #2a3542; --line-2: #384556;
    --text: #e6ebf1; --muted: #93a0b1; --accent: #5b9be0; --accent-2: #79aee8; --accent-soft: #1c2d42;
    --side: #0b131d; --side-2: #16222f;
    --ok: #5fcf92; --ok-bg: #173226; --warn: #f0b458; --warn-bg: #3a2b12; --bad: #f28b82; --bad-bg: #3b1d1b;
    --info: #8ab6ef; --info-bg: #1b2c43; --neutral: #aab4c0; --neutral-bg: #26303b;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
#app { display: flex; height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }
.loading { padding: 40px; color: var(--muted); }

/* ---------- Sidebar ---------- */
#sidebar { width: 248px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; overflow-y: auto; padding: 44px 10px 14px; -webkit-app-region: drag; }
#sidebar > * { -webkit-app-region: no-drag; }
.brand { padding: 0 10px 14px; }
.brand .logo { display: block; width: 92px; margin: 0 0 12px; filter: brightness(1.15); }
.brand .co { font-weight: 650; color: #fff; font-size: 14px; line-height: 1.25; }
.brand .sub { color: var(--side-muted); font-size: 11.5px; margin-top: 2px; letter-spacing: .02em; }
.side-search { margin: 0 4px 12px; }
.side-search input { width: 100%; background: var(--side-2); border: 1px solid #253850; border-radius: 7px; padding: 7px 10px; color: #fff; outline: none; }
.side-search input::placeholder { color: var(--side-muted); }
.side-search input:focus { border-color: var(--accent); }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--side-muted); padding: 14px 10px 5px; display: flex; justify-content: space-between; align-items: center; }
.nav-label button { background: none; border: 0; color: var(--side-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.nav-label button:hover { color: #fff; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; cursor: pointer; color: var(--side-text); user-select: none; }
.nav-item:hover { background: var(--side-2); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .ico { width: 16px; text-align: center; opacity: .85; }
.nav-item .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .pill { font-size: 10.5px; padding: 0 6px; border-radius: 9px; background: #b3261e; color: #fff; font-weight: 600; }
.nav-item .pill.w { background: #b8750b; }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 11px; color: var(--side-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.dot.overdue { background: #e5534b; } .dot.due { background: #e0a43a; } .dot.ok { background: #3fb97a; }

/* ---------- Main ---------- */
#main { flex: 1; overflow-y: auto; min-width: 0; }
.topbar { height: 38px; -webkit-app-region: drag; }
.page { padding: 0 32px 48px; max-width: 1500px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; font-weight: 680; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .grow { flex: 1; }
.crumbs { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.vessel-hero { display: flex; gap: 18px; align-items: center; }
.hero-img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--accent); flex: none; overflow: hidden; border: 1px solid var(--line); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img.round { border-radius: 50%; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; user-select: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count { font-size: 11px; background: var(--neutral-bg); color: var(--muted); border-radius: 8px; padding: 0 6px; margin-left: 4px; }
.tab .count.bad { background: var(--bad-bg); color: var(--bad); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 14px; font-weight: 650; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-b { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mb { margin-bottom: 16px; } .mt { margin-top: 16px; }

.stat { padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12px; }
.stat.bad .v { color: var(--bad); } .stat.warn .v { color: var(--warn); } .stat.ok .v { color: var(--ok); }

.vcard { cursor: pointer; transition: border-color .12s; overflow: hidden; }
.vcard:hover { border-color: var(--accent); }
.vcard .vimg { height: 120px; background: linear-gradient(135deg, #1f5f9e, #0f1d2e); display: flex; align-items: flex-end; padding: 12px 14px; color: #fff; position: relative; }
.vcard .vimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vcard .vimg .t { position: relative; font-weight: 700; font-size: 17px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.vcard .vimg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.55)); }
.vcard .vimg .t { z-index: 1; }
.vcard .vb { padding: 12px 14px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.vcard .vb b { color: var(--text); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--accent-soft); }
table.t td.nowrap { white-space: nowrap; }
table.t td.r, table.t th.r { text-align: right; }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 28px; margin-bottom: 6px; opacity: .6; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.due, .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.overdue, .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.none, .badge.neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge.info { background: var(--info-bg); color: var(--info); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 550; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-bg); }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 11px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-size: 12.5px; user-select: none; white-space: nowrap; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .7; margin-left: 3px; }
input.inp, select.inp, textarea.inp { width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); outline: none; }
input.inp:focus, select.inp:focus, textarea.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.inp { resize: vertical; min-height: 70px; }
input.inp.search-inline { width: 220px; flex: none; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; user-select: none; color: var(--muted); }

/* ---------- Forms / modal ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.field.full { grid-column: 1 / -1; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.form-section { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

#modal-root .overlay { position: fixed; inset: 0; background: rgba(8,15,25,.45); display: flex; align-items: flex-start; justify-content: center; padding: 50px 20px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 12px; width: 640px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); border: 1px solid var(--line); }
.modal.wide { width: 860px; }
.modal.narrow { width: 440px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h h2 { margin: 0; font-size: 16px; flex: 1; }
.modal-b { padding: 18px 20px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.modal-f .left { margin-right: auto; display: flex; gap: 8px; }
.x { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }

/* ---------- Files ---------- */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 9px; padding: 10px; transition: background .1s, border-color .1s; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; }
.file-row:hover { background: var(--panel-2); }
.file-row .fi { width: 30px; height: 34px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 9.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-transform: uppercase; flex: none; }
.file-row .fi.pdf { background: var(--bad-bg); color: var(--bad); }
.file-row .fi.img { background: var(--ok-bg); color: var(--ok); }
.file-row .fn { flex: 1; min-width: 0; }
.file-row .fn .n { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.file-row .fn .n:hover { color: var(--accent); }
.file-row .fn .m { font-size: 11.5px; color: var(--muted); }
.file-row .acts { display: flex; gap: 2px; opacity: 0; }
.file-row:hover .acts { opacity: 1; }
.drop-hint { display: flex; gap: 10px; align-items: center; padding: 4px 4px 2px; color: var(--muted); font-size: 12px; }

.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.folder { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; user-select: none; }
.folder:hover { background: var(--panel-2); }
.folder.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.folder .n { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.folder.drop-target { outline: 2px dashed var(--accent); }

/* ---------- Crew ---------- */
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.crew-card { padding: 14px; display: flex; gap: 12px; cursor: pointer; align-items: center; }
.crew-card:hover { border-color: var(--accent); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; overflow: hidden; font-size: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.crew-card .nm { font-weight: 650; }
.crew-card .ps { color: var(--muted); font-size: 12.5px; }
.crew-card .meta { margin-top: 5px; display: flex; gap: 5px; flex-wrap: wrap; }
.dept-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.dept-h:first-child { margin-top: 0; }

.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 7px 14px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-word; }

.timeline { position: relative; }
.update { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.update:last-child { border-bottom: 0; }
.update .bar { width: 4px; border-radius: 3px; flex: none; background: var(--neutral); }
.update .bar.ok { background: var(--ok); } .update .bar.bad { background: var(--bad); } .update .bar.warn { background: var(--warn); } .update .bar.info { background: var(--info); }
.update .ub { flex: 1; min-width: 0; }
.update .uh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.update .who { font-weight: 600; }
.update .when { color: var(--muted); font-size: 12px; }
.update .txt { white-space: pre-wrap; }
.update .uacts { opacity: 0; display: flex; gap: 2px; margin-left: auto; }
.update:hover .uacts { opacity: 1; }
.stars { color: #d29b13; letter-spacing: 1px; }

.muted { color: var(--muted); } .small { font-size: 12px; }
.hours-meters { display: flex; gap: 10px; flex-wrap: wrap; }
.meter { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 150px; cursor: pointer; background: var(--panel); }
.meter:hover { border-color: var(--accent); }
.meter .mv { font-size: 18px; font-weight: 700; }
.meter .ml { font-size: 12px; color: var(--muted); }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #16212e; color: #fff; padding: 9px 16px; border-radius: 8px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 100; font-weight: 550; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hist { font-size: 12.5px; }
.hist div { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.hist div:last-child { border-bottom: 0; }

/* ---------- Print ---------- */
@media print {
  body { overflow: visible; background: #fff; }
  #sidebar, .topbar, .btn, .toolbar .chips, .no-print, .file-row .acts, .uacts { display: none !important; }
  #app { display: block; height: auto; }
  #main { overflow: visible; }
  .card { box-shadow: none; break-inside: avoid; }
  .page { padding: 0; }
}

/* ================= Maintenance workspace (Wrike-style) ================= */
.mws { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.mtree { padding: 8px 6px; position: sticky; top: 8px; max-height: calc(100vh - 60px); overflow-y: auto; }
.mnode { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; user-select: none; position: relative; }
.mnode:hover { background: var(--panel-2); }
.mnode.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mnode.drop-target, .mtree-h.drop-target { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.mnode .caret { width: 12px; font-size: 10px; color: var(--muted); flex: none; text-align: center; }
.mnode .fico { width: 14px; text-align: center; flex: none; font-size: 11px; }
.mnode .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mnode .n { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.mnode .n.bad { color: #fff; background: var(--bad); border-radius: 9px; padding: 0 6px; }
.mnode-acts { display: none; gap: 2px; }
.mnode:hover .mnode-acts { display: flex; }
.mnode:hover .n { display: none; }
.mnode-acts button { border: 0; background: var(--panel); border-radius: 4px; cursor: pointer; color: var(--muted); padding: 0 5px; font-size: 12px; line-height: 18px; }
.mnode-acts button:hover { color: var(--accent); }
.mtree-h { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 8px 5px; font-weight: 600; border-radius: 6px; }
.mtree-h button { border: 0; background: none; font-size: 16px; color: var(--muted); cursor: pointer; line-height: 1; }
.mtree-h button:hover { color: var(--accent); }
.mtree-foot { padding: 12px 8px 4px; }

.mhead { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.mhead h2 { margin: 0; font-size: 19px; font-weight: 680; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg span { padding: 5px 12px; cursor: pointer; font-weight: 550; font-size: 12.5px; color: var(--muted); border-right: 1px solid var(--line); user-select: none; }
.seg span:last-child { border-right: 0; }
.seg span:hover { color: var(--text); }
.seg span.on { background: var(--accent); color: #fff; }
.seg.small span { padding: 4px 10px; font-size: 12px; }
.mmeters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mchip { border: 1px solid var(--line-2); background: var(--panel); border-radius: 20px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.mchip:hover { border-color: var(--accent); }
.pbar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px; font-size: 12.5px; }
.pbar .pdesc { flex-basis: 100%; color: var(--muted); }
.prog { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.prog-bar { width: 120px; height: 7px; background: var(--neutral-bg); border-radius: 4px; overflow: hidden; display: inline-block; }
.prog-bar span { display: block; height: 100%; background: var(--ok); }

/* status pills */
.spill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 4px; white-space: nowrap; cursor: pointer; user-select: none; }
.spill.dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.st-new { background: #e8ecf2; color: #52627a; } .spill.dot.st-new { background: #9aa6b8; }
.st-prog { background: #dcebfd; color: #1a62c9; } .spill.dot.st-prog { background: #2f7de1; }
.st-hold { background: #fdf0d8; color: #9a5b00; } .spill.dot.st-hold { background: #e0a43a; }
.st-done { background: #dff3e7; color: #1d7a4c; } .spill.dot.st-done { background: #34a86a; }
.st-canc { background: #eceef1; color: #8a8f98; text-decoration: line-through; } .spill.dot.st-canc { background: #b3b8bf; }
.st-late { background: var(--bad-bg); color: var(--bad); }
@media (prefers-color-scheme: dark) {
  .st-new { background: #2a3442; color: #aab6c6; } .st-prog { background: #1b3150; color: #8cbcf5; } .st-hold { background: #3a2b12; color: #f0b458; } .st-done { background: #173226; color: #5fcf92; } .st-canc { background: #26303b; color: #7d8794; }
}
#popmenu { position: fixed; z-index: 70; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; min-width: 150px; }
.pm-i { padding: 5px 8px; border-radius: 5px; cursor: pointer; }
.pm-i:hover, .pm-i.on { background: var(--panel-2); }

/* list */
.mlist { overflow: hidden; }
table.tt td { padding: 7px 10px; }
table.tt th { padding: 8px 10px; }
.trow.sel td { background: var(--accent-soft) !important; }
.trow.closed .ttl { color: var(--muted); text-decoration: line-through; }
.trow.dragging, .bcard.dragging { opacity: .45; }
.ttl-wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ttl { font-weight: 550; }
.subcaret { width: 14px; font-size: 10px; color: var(--muted); cursor: pointer; flex: none; }
.tag { font-size: 11px; color: var(--muted); background: var(--neutral-bg); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.tag.rec { color: var(--info); background: var(--info-bg); }
.ftag { font-size: 11px; border: 1px solid; border-radius: 4px; padding: 0 5px; white-space: nowrap; font-weight: 550; }
.tcheck { width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; cursor: pointer; flex: none; }
.tcheck:hover { border-color: var(--ok); color: var(--ok); }
.tcheck.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.asg { display: inline-flex; align-items: center; gap: 6px; }
.imp { font-weight: 800; text-align: center; }
.imp-low { color: var(--muted); } .imp-high { color: #d9822b; } .imp-crit { color: var(--bad); }
.due-overdue { color: var(--bad); font-weight: 600; } .due-due { color: var(--warn); font-weight: 600; }
.qadd td { background: var(--panel-2); }
.qadd-inp { width: 100%; border: 0; background: transparent; padding: 4px 2px; outline: none; font-size: 13.5px; }
.qadd-inp::placeholder { color: var(--accent); opacity: .8; }

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.bcol { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-height: 160px; }
.bcol.drop-target { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.bcol-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.bcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); }
.bcard:hover, .bcard.sel { border-color: var(--accent); }
.bfolder { font-size: 11px; font-weight: 600; margin-bottom: 2px; }
.btitle { font-weight: 550; margin-bottom: 6px; }
.bmeta { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.bmeta .grow { flex: 1; }
.bq { background: var(--panel); border: 1px dashed var(--line-2); border-radius: 8px; padding: 7px 9px; }

/* timeline */
.tl { display: grid; grid-template-columns: 250px minmax(0, 1fr); overflow: hidden; }
.tl-names { border-right: 1px solid var(--line); }
.tl-hcell { height: 46px; border-bottom: 1px solid var(--line); padding: 14px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--panel-2); }
.tl-name { height: 34px; padding: 0 12px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.tl-name:hover, .tl-name.sel { background: var(--accent-soft); }
.tl-scroll { overflow-x: auto; }
.tl-inner { position: relative; }
.tl-head { position: relative; height: 46px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.tl-month { position: absolute; top: 0; height: 22px; padding: 4px 6px; font-size: 11.5px; font-weight: 650; border-left: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; }
.tl-week { position: absolute; top: 24px; height: 22px; border-left: 1px solid var(--line); font-size: 10.5px; color: var(--muted); padding: 3px 4px; }
.tl-rows { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0 33px, var(--line) 33px 34px); }
.tl-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--line); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .7; z-index: 1; }
.tl-bar { position: absolute; height: 20px; border-radius: 5px; font-size: 11px; color: #fff; padding: 2px 7px; white-space: nowrap; overflow: hidden; cursor: pointer; z-index: 2; font-weight: 550; }
.tl-bar:hover { filter: brightness(1.1); }
.b-new { background: #7f8ea3; } .b-prog { background: #2f7de1; } .b-hold { background: #d39a33; } .b-done { background: #34a86a; opacity: .7; } .b-late { background: #d14b43; }

/* task side panel */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 500px; max-width: 92vw; background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -12px 0 40px rgba(10,20,35,.18); z-index: 40; display: flex; flex-direction: column; animation: drIn .16s ease-out; }
@keyframes drIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.dr-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); padding-top: 34px; -webkit-app-region: drag; }
.dr-h > * { -webkit-app-region: no-drag; }
.dr-h .crumbs { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.dr-b { flex: 1; overflow-y: auto; padding: 14px 18px 30px; }
.dr-title { width: 100%; font-size: 19px; font-weight: 680; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; margin: 0 0 8px -6px; resize: none; background: transparent; outline: none; line-height: 1.3; overflow: hidden; }
.dr-title:hover { border-color: var(--line); } .dr-title:focus { border-color: var(--accent); }
.dr-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.dr-row select { width: auto; }
.dr-due { padding: 7px 10px; border-radius: 7px; background: var(--panel-2); margin-bottom: 12px; font-size: 12.5px; }
.due-box-overdue { background: var(--bad-bg); color: var(--bad); } .due-box-due { background: var(--warn-bg); color: var(--warn); }
.dr-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 7px 10px; align-items: center; }
.dr-grid > label { color: var(--muted); font-size: 12.5px; }
.dr-grid .inp { padding: 5px 8px; }
.dr-pair { display: flex; gap: 6px; }
.dr-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 18px 0 7px; }
.subs .sub { display: flex; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid var(--line); }
.subs .sub.closed .sub-t { color: var(--muted); text-decoration: line-through; }
.sub-t { flex: 1; color: var(--text); }
.subs .qadd-inp { margin-top: 4px; }
.acts-list { display: flex; flex-direction: column; gap: 8px; }
.act-sys { font-size: 12px; color: var(--muted); padding-left: 4px; }
.act-sys span:first-child { font-weight: 600; }
.act-c { display: flex; gap: 9px; }
.act-body { flex: 1; background: var(--panel-2); border-radius: 8px; padding: 7px 10px; }
.act-body .txt { white-space: pre-wrap; margin-top: 2px; }
.act-del { float: right; opacity: 0; padding: 0 6px; }
.act-c:hover .act-del { opacity: 1; }
.comment-box { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }

/* ================= Leave planner & payroll ================= */
.lv-nav { display: inline-flex; align-items: center; gap: 8px; }
.lv-nav b { min-width: 130px; text-align: center; }
.lvp { overflow: hidden; }
.lv-scroll { overflow-x: auto; }
table.lvgrid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 11.5px; }
.lvgrid th, .lvgrid td { border-bottom: 1px solid var(--line); }
.lvgrid th.lvd { font-weight: 600; color: var(--muted); padding: 6px 0 4px; text-align: center; min-width: 26px; background: var(--panel-2); }
.lvgrid th.lvd span { display: block; font-size: 9.5px; font-weight: 500; }
.lvgrid th.lvd.wk { color: var(--text); background: var(--neutral-bg); }
.lvgrid th.lvd.today { background: var(--accent); color: #fff; }
.lvgrid th.lvd.today span { color: #fff; }
.lvgrid .lv-name { position: sticky; left: 0; background: var(--panel); z-index: 1; text-align: left; padding: 6px 12px; min-width: 190px; border-right: 1px solid var(--line); white-space: nowrap; }
.lvgrid thead .lv-name { background: var(--panel-2); }
.lvgrid.year .lv-name { min-width: 60px; }
.lvgrid .lv-sum { text-align: center; padding: 0 8px; font-weight: 600; background: var(--panel-2); min-width: 38px; }
td.lvc { height: 38px; min-width: 26px; padding: 0; text-align: center; color: #fff; font-weight: 700; font-size: 10.5px; border-right: 1px solid rgba(255,255,255,.35); cursor: pointer; user-select: none; }
.lvgrid.year td.lvc { height: 24px; }
td.lvc.ob { background: #e3f4ea; border-right-color: var(--panel); }
td.lvc.ob.wk { background: #d4ecdd; }
td.lvc.none { background: repeating-linear-gradient(45deg, var(--panel-2) 0 4px, var(--neutral-bg) 4px 8px); cursor: default; }
td.lvc.x { background: transparent; cursor: default; }
td.lvc.today { box-shadow: inset 0 0 0 2px var(--accent); }
td.lvc:hover:not(.none):not(.x) { filter: brightness(.93); }
td.lvc.lvsel { background: var(--accent) !important; opacity: .75; }
@media (prefers-color-scheme: dark) { td.lvc.ob { background: #183327; } td.lvc.ob.wk { background: #1d3b2e; } }
.lv-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 12px; }
.lv-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lv-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.lv-legend i.ob { background: #e3f4ea; border: 1px solid #bfe3cc; }
.lv-legend em { color: var(--muted); font-style: normal; }
.lvdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.pos { color: var(--ok); font-weight: 600; }
tr.tot td { background: var(--panel-2); font-size: 13.5px; }
.pay-total { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: 9px; background: var(--accent-soft); font-size: 15px; }
.pay-total b { font-size: 20px; }
.stat .alw { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat .l b { color: var(--text); }
.dchip { display: inline-block; font-size: 11px; font-weight: 650; border: 1.5px solid; border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.mlist { overflow-x: auto; }
.asg .avatar.sm { flex: none; }
table.tt th:nth-child(2), table.tt td:nth-child(2) { min-width: 210px; }
table.tt .asg { white-space: nowrap; }
.mnode .n.warn { color: #fff; background: #d08a14; border-radius: 9px; padding: 0 6px; }
.file-row .fdesc { font-size: 12.5px; color: var(--text); opacity: .8; margin: 1px 0 2px; white-space: pre-wrap; }
.folder { position: relative; }
.folder .fcaret { width: 12px; font-size: 10px; color: var(--muted); text-align: center; flex: none; }
.folder .fnm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .facts { display: none; }
.folder:hover .facts { display: inline-flex; }
.folder:hover .n { display: none; }
.folder .facts button { border: 0; background: var(--panel); border-radius: 4px; cursor: pointer; color: var(--muted); padding: 0 6px; font-size: 13px; line-height: 18px; }
.folder .facts button:hover { color: var(--accent); }
/* type-or-choose dropdown */
input[list], input[data-combo] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a94a6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 26px; }
#combo { position: fixed; z-index: 90; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.combo-i { padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.combo-i:hover, .combo-i.on { background: var(--accent-soft); color: var(--accent); }
.combo-i b { color: var(--accent); }
/* reports */
.rep-people { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; max-height: 150px; overflow-y: auto; }
.rep-people .check { color: var(--text); }
.rep-hist { font-size: 12.5px; display: grid; gap: 4px; max-height: 140px; overflow-y: auto; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; }
/* history / logs */
.hist2 { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.hist2 .hrow { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: var(--panel); display: grid; gap: 3px; }
.hist2 .hrow.undone { opacity: .6; }
.hist2 .hrow.undone .small:not(.muted) { text-decoration: line-through; }
.hist2 .hhead { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hist2 .hhead .grow { flex: 1; }
.hist2 .hbtns { display: flex; gap: 6px; margin-top: 4px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.fchip { font-size: 12px; padding: 3px 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.fchip:hover { text-decoration: underline; }
/* back button */
.topbar { display: flex; align-items: flex-end; }
.backbtn { -webkit-app-region: no-drag; border: 1px solid var(--line-2); background: var(--panel); color: var(--accent); border-radius: 16px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; margin: 0 0 0 32px; }
.backbtn:hover { border-color: var(--accent); background: var(--accent-soft); }
/* ================= Forms & checklists ================= */
.fprog { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--panel-2); padding: 5px 10px; border-radius: 14px; }
.fsec { overflow: hidden; }
.fitem { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 12px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); }
.fsec .card-h + .fitem, .fsec > .fitem:first-child { border-top: 0; }
.fitem .ftext { font-size: 13.5px; }
.fitem .fval { display: flex; align-items: center; gap: 6px; }
.fitem .fval .inp { width: 110px; }
.fitem .fr-n { grid-column: 1 / -1; }
.fitem.ans-ok { background: color-mix(in srgb, var(--ok-bg) 45%, transparent); }
.fitem.ans-defect { background: color-mix(in srgb, var(--bad-bg) 60%, transparent); }
.fitem.ans-na { background: color-mix(in srgb, var(--neutral-bg) 50%, transparent); }
.fbtns { display: flex; gap: 4px; }
.fb { border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.fb:hover { border-color: var(--accent); }
.fb-ok.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.fb-defect.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.fb-na.on { background: var(--neutral); border-color: var(--neutral); color: #fff; }
.fb-note { padding: 5px 8px; }
.lib-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lib-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.lib-item:hover { border-color: var(--accent); }
.lib-item input { margin-top: 3px; }
@media print { .fb:not(.on), .fb-note { display: none; } }
/* forms v2: folder cards, builder, field types */
.fcard { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.card-h + .fcard { border-top: 0; }
.fc-acts { display: flex; gap: 6px; justify-content: flex-end; }
.fblist { display: grid; }
.fbrow { display: flex; gap: 8px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line); }
.fbrow:first-child { border-top: 0; }
.fbrow .fb-type { width: 190px; flex: none; }
.fbrow .fb-label { flex: 1; min-width: 0; }
.fbrow.fb-heading { background: var(--panel-2); }
.fbrow.fb-heading .fb-label { font-weight: 700; }
.fbrow.fb-info .fb-label { font-style: italic; }
.fb-move { display: flex; flex-direction: column; gap: 1px; }
.fb-move button, .fb-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 10px; padding: 1px 4px; line-height: 1; }
.fb-move button:disabled { opacity: .25; cursor: default; }
.fb-del { font-size: 14px; padding: 4px 6px; }
.fb-del:hover { color: var(--bad); }
.fb-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }
.fpreview { pointer-events: none; opacity: .92; }
.fitem.fwide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.fitem.fwide .fval { justify-content: flex-end; }
.fitem.fwide .fval .inp { width: 100%; max-width: 360px; }
.fitem.fwide .fval.full .inp { max-width: none; }
.fitem.finfo { display: block; color: var(--muted); font-size: 13px; background: var(--panel-2); }
.fitem.ftick { grid-template-columns: auto minmax(0, 1fr); }
.tickbox { width: 26px; height: 26px; border: 2px solid var(--line-2); border-radius: 6px; background: var(--panel); font-size: 16px; font-weight: 700; color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tickbox.on { background: var(--ok); border-color: var(--ok); }
.fb-yn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fsign { grid-template-columns: minmax(0, 1fr) auto; }
.fsig { display: flex; gap: 8px; align-items: center; }
.fsig .inp { width: 200px; }
.signame { font-family: 'Snell Roundhand', 'Segoe Script', cursive; font-size: 17px; color: var(--accent); }
.req { color: var(--bad); }
.fitem.flash { animation: fflash 1.4s; }
@keyframes fflash { 0%, 60% { box-shadow: inset 0 0 0 2px var(--bad); } 100% { box-shadow: none; } }
.click-card { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.click-card:hover { box-shadow: 0 0 0 2px var(--accent); }
.notice { background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.fcard[draggable="true"] { cursor: grab; }
.fcard.dragging { opacity: .45; }
.fcard .grip { color: var(--muted); margin-right: 6px; font-size: 12px; }
.form-dragging .folder[data-form-drop] { outline: 1px dashed var(--line-2); outline-offset: -2px; }
.form-dragging .folder.drop-target { outline: 2px solid var(--accent); background: var(--accent-soft); }
/* editable entry title */
.h1edit { display: flex; align-items: center; gap: 8px; }
.h1-input { font: inherit; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 2px 8px; margin-left: -9px; width: 100%; max-width: 820px; }
.h1-input:hover { border-color: var(--line-2); }
.h1-input:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.h1pen { color: var(--muted); font-size: 15px; }
.crewlink { color: var(--accent); font-weight: 600; }
/* signature pad */
.sigpad-wrap { position: relative; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; height: 190px; }
#sigpad { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border-radius: 10px; }
.sigpad-line { position: absolute; left: 24px; right: 24px; bottom: 44px; border-bottom: 1.5px solid #c8cfd9; pointer-events: none; }
.sigpad-line::before { content: '✕'; position: absolute; left: -2px; bottom: 2px; color: #9aa5b4; font-size: 13px; }
.sigpad-hint { position: absolute; left: 0; right: 0; top: 42%; text-align: center; color: #9aa5b4; font-size: 13px; pointer-events: none; transition: opacity .2s; }
.sigpad-hint.gone { opacity: 0; }
.sigimg { display: block; max-height: 56px; max-width: 220px; background: #fff; border-radius: 6px; padding: 2px 6px; }
.fsig .sigimg { margin-right: 6px; }
/* drag to reorder in the form designer */
.fb-grip { cursor: grab; color: var(--muted); font-size: 18px; padding: 4px 4px; user-select: none; touch-action: none; line-height: 1; }
.fb-grip:hover { color: var(--accent); }
body.fb-sorting, body.fb-sorting * { cursor: grabbing !important; user-select: none; }
.fbrow.fb-dragging { position: relative; z-index: 5; background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.18); border-radius: 8px; opacity: .95; }
.fb-drop-line { height: 0; border-top: 3px solid var(--accent); margin: -1.5px 16px; border-radius: 2px; position: relative; z-index: 4; }
.card.flash-card { animation: fcard 1.6s; }
@keyframes fcard { 0%, 50% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }
/* report read-only view */
.rv-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.rv-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.chg { margin-top: 2px; }
.chg-from { text-decoration: line-through; color: var(--muted); }
.chg-to { color: var(--text); font-weight: 600; }
details.chg summary { cursor: pointer; }
.chg-old, .chg-new { white-space: pre-wrap; padding: 6px 8px; border-radius: 6px; margin-top: 4px; }
.chg-old { background: var(--bad-bg); }
.chg-new { background: var(--ok-bg); }
@media print {
  body.print-modal #app { display: none !important; }
  body.print-modal .overlay { position: static; background: none; display: block; padding: 0; }
  body.print-modal .modal { box-shadow: none; border: 0; width: 100%; }
  body.print-modal .modal-b { max-height: none; overflow: visible; }
  body.print-modal .modal-f, body.print-modal .modal-h .x { display: none !important; }
  body.print-modal details.chg > div { display: block; }
}
.formlink-box { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.formlink-box.small-box { margin: 8px 0; padding: 8px 12px; font-size: 13px; }
/* ================= Drills matrix ================= */
.drillcard { padding: 12px; overflow-x: auto; }
.drillgrid { width: 100%; border-collapse: collapse; margin-bottom: 18px; table-layout: fixed; min-width: 980px; }
.drillgrid:last-child { margin-bottom: 0; }
.drillgrid th { background: #2f6fb3; color: #fff; font-size: 13px; font-weight: 700; padding: 8px 6px; text-align: left; border: 1px solid #2a5f99; }
.drillgrid th.dg-name { width: 290px; font-size: 14px; letter-spacing: .01em; }
.drillgrid th.dg-tot, .drillgrid td.dg-tot { width: 62px; text-align: center; }
.drillgrid th.dg-cur { background: #1f4f86; }
.drillgrid td { border: 1px solid var(--line-2); padding: 6px; height: 46px; vertical-align: top; font-size: 13px; }
.drillgrid td.dg-name a { color: var(--text); font-weight: 600; cursor: pointer; }
.drillgrid td.dg-name a:hover { color: var(--accent); }
.dg-tag { color: var(--accent); font-size: 9.5px; font-weight: 700; }
.dcell { cursor: pointer; }
.dcell:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.dcell.due-plan, .dcell.due-pre { background: #dcdfe4; }
.dcell.due-now { background: #fbe7b8; }
.dcell.due-done { background: #cfeedd; }
.dcell.due-missed { background: #f6c9c5; }
.dcell.dg-cur:not([class*="due-"]) { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.dday { display: inline-block; min-width: 22px; padding: 1px 5px; margin: 0 3px 3px 0; border-radius: 5px; font-weight: 700; font-size: 12.5px; text-align: center; color: #fff; background: var(--ok); cursor: pointer; }
.dday.res-due { background: var(--warn); } .dday.res-bad { background: var(--bad); }
.dday:hover { filter: brightness(1.1); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--accent); }
.drillgrid td.dg-tot { font-weight: 700; vertical-align: middle; }
.drillgrid td.dg-tot.ok { color: var(--ok); } .drillgrid td.dg-tot.bad { color: var(--bad); }
.legend { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); margin-left: 14px; }
.legend .lg { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--line-2); margin-left: 8px; }
.lg.due-plan { background: #dcdfe4; } .lg.due-now { background: #fbe7b8; } .lg.due-done { background: #cfeedd; } .lg.due-missed { background: #f6c9c5; }
.mchecks { display: grid; grid-template-columns: repeat(6, auto); gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; }
.mchecks .check { color: var(--text); }
@media print { .drillgrid th, .dcell, .dday { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* draggable tabs */
.tabs .tab { white-space: nowrap; }
.tab.dragging { opacity: .4; }
.tab.drop-l { box-shadow: inset 3px 0 0 var(--accent); }
.tab.drop-r { box-shadow: inset -3px 0 0 var(--accent); }
.tabs { flex-wrap: wrap; row-gap: 0; }
/* drill row / section editing */
.dg-sech { display: flex; align-items: center; gap: 8px; }
.dg-sech > span:first-child { flex: 1; }
.dg-acts { display: inline-flex; gap: 2px; opacity: .75; }
.dg-acts button { background: rgba(255,255,255,.18); border: 0; color: #fff; border-radius: 5px; width: 22px; height: 22px; cursor: pointer; font-size: 12px; line-height: 1; }
.dg-acts button:hover { background: rgba(255,255,255,.35); }
.drillgrid th:hover .dg-acts { opacity: 1; }
.drillgrid td.dg-name { position: relative; }
.dg-rowacts { float: right; display: inline-flex; gap: 1px; margin-left: 6px; opacity: .35; transition: opacity .15s; }
tr[data-drill-row]:hover .dg-rowacts { opacity: 1; }
.dg-rowacts button, .dg-grip { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 1px 4px; border-radius: 4px; line-height: 1.2; }
.dg-rowacts button:hover { background: var(--panel-2); color: var(--accent); }
.dg-rowacts button[data-act="drill-del-type"]:hover { color: var(--bad); }
.dg-grip { cursor: grab; touch-action: none; font-size: 15px; }
tr.dg-dragging { position: relative; z-index: 5; background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: .95; }
tr.dg-drop-above td { box-shadow: inset 0 3px 0 var(--accent); }
tr.dg-drop-below td { box-shadow: inset 0 -3px 0 var(--accent); }
@media print { .dg-acts, .dg-rowacts { display: none !important; } }
.dcell.due-late { background: repeating-linear-gradient(135deg, #f6c9c5 0 6px, #fbe7b8 6px 12px); }
.lg.due-late { background: repeating-linear-gradient(135deg, #f6c9c5 0 4px, #fbe7b8 4px 8px); }
.legend .lgi { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 14px; cursor: pointer; color: var(--muted); }
.legend .lgi:hover { background: var(--panel-2); color: var(--text); }
.legend .lgi.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.legend .lgi .lg { margin-left: 0; }
.legend .lgi.clear { color: var(--accent); }
.drillcard[class*="hi-"] .dcell { opacity: .22; }
.drillcard.hi-plan .dcell.due-plan, .drillcard.hi-plan .dcell.due-pre, .drillcard.hi-now .dcell.due-now, .drillcard.hi-done .dcell.due-done, .drillcard.hi-late .dcell.due-late, .drillcard.hi-missed .dcell.due-missed { opacity: 1; box-shadow: inset 0 0 0 2px var(--accent); }
.warn-notice { background: var(--warn-bg); color: var(--text); }

/* ---------- compliance calendar ---------- */
.cal-title { font-size: 17px; min-width: 150px; text-align: center; }
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.cal th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
td.cal-d { vertical-align: top; height: 104px; padding: 4px 5px 6px; border: 1px solid var(--line); cursor: pointer; }
td.cal-d:hover { background: var(--panel-2); }
td.cal-out { background: var(--panel-2); cursor: default; }
td.cal-past .cal-n { opacity: .55; }
.cal-n { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
td.cal-today { box-shadow: inset 0 0 0 2px var(--accent); }
td.cal-today .cal-n { color: #fff; background: var(--accent); border-radius: 10px; display: inline-block; padding: 0 7px; }
.cal-it { font-size: 11.5px; line-height: 1.3; padding: 3px 6px; margin: 2px 0; border-radius: 5px; border-left: 3px solid; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.cal-it:hover { filter: brightness(.95); }
.cal-it .cal-sub { font-weight: 400; opacity: .8; }
.cal-it.st-overdue { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.cal-it.st-due { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.cal-it.st-ok, .cal-it.st-none { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.cal-lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; border-left: 3px solid; }
.cal-lg.st-overdue { background: var(--bad-bg); border-color: var(--bad); } .cal-lg.st-due { background: var(--warn-bg); border-color: var(--warn); } .cal-lg.st-ok { background: var(--ok-bg); border-color: var(--ok); }
.cal-over { padding: 10px 14px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cal-over .cal-it { display: inline-block; margin: 0; max-width: 320px; }
.cal-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
@media (max-width: 1100px) { .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cal-mo { display: flex; flex-direction: column; min-height: 150px; }
.cal-mo-h { padding: 9px 12px; font-weight: 650; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.cal-mo-h:hover { color: var(--accent); }
.cal-mo-h .n { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 9px; padding: 0 7px; font-weight: 600; }
.cal-mo-now { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-mo-b { padding: 8px 10px; }
.cal-mo-b .cal-it { white-space: normal; }
@media print { td.cal-d { height: 80px; } .cal-year { grid-template-columns: repeat(3, 1fr); } }

/* ---------- clickable column headings (filter / sort) ---------- */
th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; position: relative; }
th.th-sort:hover { color: var(--text); background: var(--panel-2); }
th.th-sort.sorted { color: var(--accent); }
th.th-sort .sarr { font-size: 9px; margin-left: 5px; vertical-align: 1px; }
th.th-sort .th-caret { margin-left: 5px; font-size: 11px; opacity: .7; }
th.th-sort .th-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 5px; vertical-align: 1px; }
.th-pop { position: fixed; z-index: 500; min-width: 250px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 5px; font-size: 13px; }
.th-pop-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px 4px; font-weight: 600; }
.th-opt { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.th-opt:hover { background: var(--accent-soft); }
.th-opt.on { font-weight: 650; color: var(--accent); }
.th-opt.empty { opacity: .5; }
.th-opt .th-tick { width: 16px; text-align: center; color: var(--accent); }
.th-opt .n { margin-left: auto; font-size: 11.5px; color: var(--muted); background: var(--panel-2); border-radius: 9px; padding: 0 7px; }
.th-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.msortbar { margin: 0 0 8px; padding: 7px 12px; background: var(--accent-soft); color: var(--text); border-radius: 8px; }

/* ---------- task cover photos ---------- */
.dr-cover { position: relative; margin: -4px 0 14px; border-radius: 10px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.dr-cover img { display: block; width: 100%; max-height: 260px; object-fit: cover; cursor: zoom-in; }
.dr-cover .cov-acts { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.dr-cover:hover .cov-acts { opacity: 1; }
.dr-cover .cov-acts .btn { background: rgba(15,22,32,.78); color: #fff; border-color: transparent; backdrop-filter: blur(4px); }
.dr-cover-empty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 12px; }
.bcard.has-cover { padding-top: 0; overflow: hidden; }
.bcover { margin: 0 -10px 8px; height: 120px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.bcover img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.dr-desc-top { margin: 4px 0 12px; }
.drawer .file-row { flex-wrap: wrap; }
.drawer .file-row .fn { min-width: 0; flex: 1 1 200px; }
.drawer .file-row .acts { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }

/* ---------- board: drag cards to reorder ---------- */
.bcard { position: relative; }
.bcard.ins-before { box-shadow: 0 -5px 0 -1px var(--accent); }
.bcard.ins-after { box-shadow: 0 5px 0 -1px var(--accent); }
.bcard.dragging { opacity: .45; }
.bempty { border: 1px dashed var(--line-2); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }

/* ================= Navy header bars (look C) ================= */
:root { --hdr: #1f3a5c; --hdr-text: #ffffff; --hdr-link: #bcd6f5; --hdr-mark: #e2b45a; }
@media (prefers-color-scheme: dark) { :root { --hdr: #24405f; --hdr-link: #a9cdf5; } }
:root { --bg: #eef1f5; }
@media (prefers-color-scheme: dark) { :root { --bg: #111821; } }
.card > .card-h:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card-h { background: var(--hdr); color: var(--hdr-text); border-bottom: 0; }
.card-h h3 { color: var(--hdr-text); }
.card-h h3::before { content: ''; display: inline-block; width: 4px; height: 14px; border-radius: 2px; background: var(--hdr-mark); margin-right: 9px; vertical-align: -2px; }
.card-h a, .card-h .small a, .card-h a.small { color: var(--hdr-link); }
.card-h a:hover { color: #fff; }
.card-h .muted, .card-h .small.muted { color: rgba(255,255,255,.72); }
.card-h .btn:not(.primary) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.card-h .btn:not(.primary):hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.5); color: #fff; }
.card-h .btn.danger { color: #ffc4be; }
.card-h .btn.primary { background: #fff; color: var(--hdr); border-color: #fff; }
.card-h .inp, .card-h select, .card-h input { background: var(--panel); color: var(--text); }
.card-h .chip { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.card-h .chip.active { background: #fff; color: var(--hdr); }
/* 12-month look-ahead month headings and modal titles in the same style */
.cal-mo-h { background: var(--hdr); color: #fff; border-bottom: 0; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.cal-mo-h:hover { color: var(--hdr-link); }
.cal-mo-h .n { background: rgba(255,255,255,.18); color: #fff; }
.cal-mo-now { box-shadow: 0 0 0 2px var(--hdr-mark); }
.modal-h { background: var(--hdr); color: #fff; border-bottom: 0; border-radius: 11px 11px 0 0; }
.modal-h h2 { color: #fff; }
.modal-h h2::before { content: ''; display: inline-block; width: 4px; height: 16px; border-radius: 2px; background: var(--hdr-mark); margin-right: 10px; vertical-align: -2px; }
.modal-h .x, .modal-h button { color: #fff; }
/* tables that are the whole panel (no heading bar): the column-heading row becomes the navy bar */
.card:not(:has(> .card-h)) table.t > thead th, table.cal > thead th { background: var(--hdr); color: rgba(255,255,255,.9); border-bottom: 0; }
.card:not(:has(> .card-h)) > .table-wrap:first-child, .card:not(:has(> .card-h)) > table:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; overflow: hidden; }
.card:not(:has(> .card-h)) table.t > thead th:first-child { box-shadow: inset 3px 0 0 var(--hdr-mark); }
.card:not(:has(> .card-h)) th.th-sort:hover { background: #2a4a72; color: #fff; }
.card:not(:has(> .card-h)) th.th-sort.sorted { color: var(--hdr-mark); }
.card:not(:has(> .card-h)) th .th-dot { background: var(--hdr-mark); }
/* drill matrix headings in the same navy */
.drillgrid th { background: var(--hdr); border-color: #2a4a72; }
.drillgrid th.dg-cur { background: #2f5687; box-shadow: inset 0 -3px 0 var(--hdr-mark); }
/* maintenance task panel header */
.dr-h { background: var(--hdr); color: #fff; border-bottom: 0; }
.dr-h .crumbs, .dr-h .crumbs a { color: rgba(255,255,255,.85); }
.dr-h .x { color: #fff; }
.dr-h .btn.ghost.danger { color: #ffc4be; }
.dr-h .btn.ghost.danger:hover { background: rgba(255,255,255,.12); }
/* leave planner: date row in navy, today in gold */
.lvgrid thead th, .lvgrid thead .lv-name { background: var(--hdr); color: #fff; border-bottom: 0; }
.lvgrid th.lvd { background: var(--hdr); color: rgba(255,255,255,.9); }
.lvgrid th.lvd span { color: rgba(255,255,255,.7); }
.lvgrid th.lvd.wk { background: #2a4a72; color: #fff; }
.lvgrid th.lvd.today { background: var(--hdr-mark); color: #1f3a5c; }
.lvgrid th.lvd.today span { color: #1f3a5c; }
.lvgrid thead th.lv-sum { background: var(--hdr) !important; color: #fff; }

/* ---------- overview crew panel ---------- */
.crew-ov { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.co-stat { padding: 14px 16px; border-right: 1px solid var(--line); }
.co-stat:last-child { border-right: 0; }
.co-stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.co-stat .l { font-weight: 600; font-size: 12.5px; }
.co-stat .s { font-size: 11.5px; color: var(--muted); }
.co-stat.ok .v { color: var(--ok); } .co-stat.warn .v { color: var(--warn); }
table.co-t th { position: static; }
.co-away { padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.co-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 4px 0 6px; }
.co-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.co-row a { font-weight: 600; }

/* confidential reports: names blurred until clicked */
.blurname { filter: blur(5px); cursor: pointer; user-select: none; transition: filter .15s; border-radius: 4px; padding: 0 2px; background: var(--neutral-bg); }
.blurname.shown { filter: none; user-select: auto; background: transparent; }
@media print { .blurname:not(.shown) { filter: none; color: transparent; text-shadow: 0 0 6px #000; } }

/* ================= read-only document views ================= */
.doc { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; background: var(--panel); margin-bottom: 14px; }
.doc-top { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.doc-top > div:first-child { flex: 1; min-width: 0; }
.doc-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.doc-title { font-size: 21px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0; }
.doc-sub { color: var(--muted); }
.doc-status { text-align: right; }
.doc-status .badge { font-size: 13px; padding: 4px 10px; }
.doc-dates { display: flex; align-items: center; gap: 18px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 12px 16px; margin-bottom: 14px; }
.doc-dates .l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.doc-dates .d { font-size: 17px; font-weight: 650; }
.doc-dates .arrow { color: var(--muted); font-size: 18px; }
.doc-days { margin-left: auto; text-align: center; }
.doc-days .d { font-size: 22px; }
.doc-kv { display: grid; grid-template-columns: 200px 1fr; gap: 7px 16px; }
.doc-kv .k { color: var(--muted); }
.doc-kv .v { font-weight: 550; }
.doc-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 16px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.doc-text { white-space: pre-wrap; line-height: 1.5; }
.doc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.doc-thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); cursor: zoom-in; }
.doc-file { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.doc-file:hover { border-color: var(--accent); }
.doc-file .n { font-weight: 600; } .doc-file .m { font-size: 11.5px; color: var(--muted); }
.lv-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: 1px; }
.fc-main[data-act="form-view"] { cursor: pointer; }
.fc-main[data-act="form-view"]:hover .cell-title { color: var(--accent); }
.doc > .doc-top:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
#modal-root .fpreview { pointer-events: none; }

/* ---------- file quick preview ---------- */
.pv-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(8,14,22,.72); display: flex; align-items: center; justify-content: center; padding: 28px; }
.pv { background: var(--panel); border-radius: 12px; width: min(1100px, 100%); height: min(92vh, 1100px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.pv-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--hdr); color: #fff; }
.pv-h .pv-t { flex: 1; min-width: 0; }
.pv-h .n { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-h .m { font-size: 11.5px; color: rgba(255,255,255,.7); }
.pv-h .btn:not(.primary) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.pv-h .btn.primary { background: #fff; color: var(--hdr); border-color: #fff; }
.pv-h .x { color: #fff; margin-left: 4px; }
.pv-note { padding: 8px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.pv-b { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--panel-2); overflow: auto; }
.pv-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pv-text { align-self: stretch; width: 100%; margin: 0; padding: 16px 20px; white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, Menlo, monospace; overflow: auto; background: var(--panel); }
.pv-none { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px; max-width: 420px; }
.pv-none .fi { width: 56px; height: 64px; font-size: 14px; }
.pv-none .n { font-weight: 650; font-size: 15px; }
.pv-strip { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); overflow-x: auto; background: var(--panel); }
.pv-s { flex: none; width: 110px; cursor: pointer; border: 2px solid transparent; border-radius: 8px; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pv-s.on { border-color: var(--accent); background: var(--accent-soft); }
.pv-s:hover { background: var(--panel-2); }
.pv-s img { width: 100%; height: 56px; object-fit: cover; border-radius: 5px; }
.pv-s .fi { width: 40px; height: 48px; }
.pv-s span { font-size: 11px; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv .fi, .doc-file .fi { border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; text-transform: uppercase; font-size: 10px; width: 30px; height: 34px; flex: none; }
.pv .fi.pdf, .doc-file .fi.pdf { background: var(--bad-bg); color: var(--bad); } .pv .fi.img { background: var(--ok-bg); color: var(--ok); }
