/* ISM PORTAL FMS. Design notes (kept so later passes stay consistent):
   - The user asked (12 Nov 2026) for the portal to look like the company website, fadakmarine.com. Tokens below are
     taken from that site: paper background, ink navy text, Geist typeface at weight 500 with tight tracking,
     6px surfaces, ink pill buttons, one blue accent, black-and-white ship photography, a "/ LABEL" eyebrow and
     two-tone headlines (ink, then a second tone). The sign-in page mirrors the site's contact section.
   - Colour is reserved for document status: red = late, orange = sent back, green = accepted, blue = with the
     office, amber = due soon. On Home the second tone of the headline carries the status.
   - Photo: public/ships/fleet.webp, shown in black and white on Home and behind the sign-in panel only.
   - Tried and dropped earlier: sidebar layout, cream chart paper with brass, navy panel with signal lamp,
     ship-paint colours with yellow buttons, full-page dark photo background. */
:root {
  --paper: #f2f3f5; --paper-2: #e9ebef; --surface: #fbfbfc; --ink: #0b1530; --ink-2: #4b5670; --ink-3: #8a93a6;
  --line: rgba(11, 21, 48, .12); --line-strong: rgba(11, 21, 48, .22); --edge: #7d8698;
  --accent: #1a6dff; --accent-ink: #0f55d6; --navy: #134a7c;
  --red: #c3261d; --red-bg: #fbe7e5; --orange: #b4510d; --orange-bg: #fdebdc; --green: #17794a; --green-bg: #e1f3e9;
  --amber: #8a5a00; --amber-bg: #fdefc9; --blue-bg: #e4eeff;
  --face: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-s: 14px; --t-m: 16px; --t-l: 20px; --t-xl: 24px; --t-xxl: 40px; --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--t-m)/1.55 var(--face); color: var(--ink); background: var(--paper); min-height: 100vh; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font: 500 var(--t-xxl)/1.08 var(--face); letter-spacing: -.035em; margin: 0; }
h2 { font: 500 var(--t-l)/1.25 var(--face); letter-spacing: -.015em; margin: 0 0 12px; }
b, strong { font-weight: 600; }
.ar { direction: rtl; unicode-bidi: isolate; color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: var(--t-s); font-weight: 400; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 16px; }
.eyebrow::before { content: "/ "; color: var(--accent); }

/* header, as on the website: logo and wordmark, links, one pill button */
.top { background: rgba(242, 243, 245, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.top .wrap { max-width: 1320px; }
.topin { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); flex: none; } .brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; flex: none; }
.brand b { display: block; font-weight: 600; letter-spacing: .08em; line-height: 1.15; color: var(--navy); }
.brand small { display: block; font-size: 11px; letter-spacing: .3em; color: var(--accent); }
.tabs { display: flex; gap: 8px; flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: var(--ink-2); padding: 0 12px; white-space: nowrap; display: flex; align-items: center; gap: 8px; position: relative; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); }
.tabs a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 20px; height: 2px; background: var(--accent); }
.tabs .sh { display: none; }
.pill { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; line-height: 20px; padding: 0 7px; font-weight: 600; }
.me { display: flex; align-items: center; gap: 16px; flex: none; color: var(--ink-2); font-size: var(--t-s); }

/* page heading */
.mast .wrap { padding-top: 56px; }
.mast h1 { max-width: 22ch; } .mast.slim h1 { max-width: 28ch; }
.mast p.lede { margin: 16px 0 0; color: var(--ink-2); max-width: 62ch; }
.mast.home h1 { font-size: clamp(40px, 6.6vw, 84px); letter-spacing: -.045em; line-height: 1; max-width: none; }
.tone { color: var(--ink-3); display: block; } .tone.red { color: var(--red); } .tone.orange { color: var(--orange); }
.photo { height: clamp(160px, 24vw, 340px); margin-top: 40px; background: var(--paper-2) url(/ships/fleet.webp) center 64% / cover no-repeat; filter: grayscale(1) contrast(1.05); border-radius: var(--r); }
main.wrap { padding-top: 32px; padding-bottom: 96px; }
.flag { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--r); padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.flag.red { border-left-color: var(--red); } .flag.orange { border-left-color: var(--orange); }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; margin-bottom: 20px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 48px 0 16px; }
.sec:first-child { margin-top: 8px; }
.sec h2 { margin: 0; font-size: var(--t-xl); letter-spacing: -.025em; }
.sec.red h2 { color: var(--red); } .sec.orange h2 { color: var(--orange); }

/* vessels (office home) */
.fleet { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ship { display: block; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.ship:hover { text-decoration: none; border-color: var(--ink); }
.ship h2 { font-size: 28px; letter-spacing: -.03em; margin: 0; padding: 24px 28px 0; }
.ship .body { padding: 8px 28px 24px; }
.ship .state { font-weight: 500; color: var(--green); } .ship.red .state { color: var(--red); }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.tally div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.tally b { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; } .tally span { font-size: var(--t-s); color: var(--ink-2); }
.tally .red b { color: var(--red); } .tally .blue b { color: var(--accent-ink); } .tally .orange b { color: var(--orange); }

/* document rows */
.docs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.doc { --c: var(--paper-2); --t: var(--ink); display: grid; grid-template-columns: 76px 60px 1fr 184px auto; gap: 16px; align-items: center; padding: 12px 20px 12px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.doc:last-child { border-bottom: 0; } .doc:hover { background: #fff; }
.doc.s-overdue { --c: var(--red); --t: #fff; } .doc.s-returned { --c: var(--orange); --t: #fff; } .doc.s-due_soon { --c: var(--amber-bg); --t: var(--amber); }
.doc.s-submitted { --c: var(--blue-bg); --t: var(--accent-ink); } .doc.s-accepted { --c: var(--green-bg); --t: var(--green); }
.cd { background: var(--c); color: var(--t); border-radius: var(--r); text-align: center; padding: 8px 4px; line-height: 1.15; }
.cd b { display: block; font-size: var(--t-xl); font-weight: 500; letter-spacing: -.02em; line-height: 1; } .cd small { font-size: 13px; }
.chip { font-weight: 600; font-size: var(--t-s); color: var(--navy); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 8px; text-align: center; white-space: nowrap; }
.dm b { display: block; font-weight: 500; line-height: 1.3; } .dm small, .dw small { color: var(--ink-2); font-size: var(--t-s); display: block; }
.dw span { display: block; line-height: 1.3; }
.s-overdue .dw span { color: var(--red); font-weight: 500; } .s-returned .dw span { color: var(--orange); font-weight: 500; }
.da { min-width: 84px; text-align: right; }
.empty { color: var(--ink-2); padding: 24px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.group { font-weight: 500; margin: 28px 0 10px; display: flex; gap: 12px; align-items: baseline; }
.group span { color: var(--ink-2); font-weight: 400; }

/* reports: three large choices, then a searchable list of forms */
.choices { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.choice { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: var(--r); padding: 28px; min-height: 248px; }
.choice:hover { text-decoration: none; border-color: var(--ink); }
.choice .no { font-size: var(--t-s); letter-spacing: .16em; color: var(--ink-2); }
.choice .no::before { content: "/ 0"; color: var(--accent); }
.choice h2 { font-size: 32px; letter-spacing: -.035em; margin: 8px 0 0; }
.choice p { margin: 0; color: var(--ink-2); flex: 1; }
.choice .count { font-weight: 500; color: var(--accent-ink); }
/* the fourth way in: a dark panel like the website's contact block, so it cannot be missed */
.choice.wide { flex-direction: row; align-items: center; gap: 24px; min-height: 0; margin-top: 20px; background: var(--ink); border-color: var(--ink); color: #fff; }
.choice.wide > div { flex: 1; } .choice.wide h2 { font-size: var(--t-xl); margin: 0 0 4px; }
.choice.wide p { color: #c3cadb; } .choice.wide .count { color: #fff; white-space: nowrap; }
.choice.wide .btn { background: #fff; border-color: #fff; color: var(--ink); }
.frow { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.frow:last-child { border-bottom: 0; } .frow:hover { background: #fff; }
.frow .files a { margin: 0; padding: 4px 14px; font-size: var(--t-s); }
.frow[hidden], .fgroup[hidden], .empty[hidden] { display: none; }
input[type=search] { padding: 12px 16px; }

/* buttons & inputs, as on the website's contact form */
button, .btn { font: 500 var(--t-s)/1.4 var(--face); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 10px 20px; border-radius: 999px; cursor: pointer; display: inline-block; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--ink); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.p, .btn.p { background: var(--ink); border-color: var(--ink); color: #fff; } button.p:hover, .btn.p:hover { background: #1c2a4f; border-color: #1c2a4f; }
button.big { padding: 13px 26px; font-size: var(--t-m); }
button.danger { color: var(--red); border-color: var(--red); }
button.ok { background: var(--green); border-color: var(--green); color: #fff; } button.ok:hover { background: #11603a; border-color: #11603a; }
button.sm, .btn.sm { padding: 5px 14px; } button:disabled { opacity: .55; cursor: default; }
input, select, textarea { font: 400 var(--t-m) var(--face); padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 88px; resize: vertical; }
input[type=file] { width: 100%; padding: 24px 20px; border: 1px dashed var(--edge); background: var(--paper); cursor: pointer; }
input[type=file]:hover { border-color: var(--ink); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; padding: 0; accent-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .doc:focus-visible, .frow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: 14.4px; font-weight: 400; margin: 18px 0 6px; }
.radios label { margin: 8px 0; display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: var(--t-m); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.seg a { padding: 5px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-size: var(--t-s); font-weight: 500; }
.seg a:hover { text-decoration: none; border-color: var(--ink); } .seg a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg.ships a.on { background: var(--navy); border-color: var(--navy); }
.err { color: var(--red); margin-top: 12px; font-weight: 500; } .err:empty { display: none; }

/* small status words in tables */
.b { font-weight: 500; white-space: nowrap; }
.b.red { color: var(--red); } .b.amber { color: var(--amber); } .b.grey { color: var(--ink-2); } .b.green { color: var(--green); }

/* single document */
.status { --c: var(--ink-3); border-radius: var(--r); padding: 16px 20px; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); color: var(--ink-2); }
.status b { display: block; font-size: var(--t-l); font-weight: 500; letter-spacing: -.015em; line-height: 1.3; color: var(--ink); }
.status.overdue { --c: var(--red); } .status.overdue b { color: var(--red); }
.status.returned { --c: var(--orange); } .status.returned b { color: var(--orange); }
.status.due_soon { --c: #e0a100; } .status.submitted { --c: var(--accent); } .status.accepted { --c: var(--green); } .status.accepted b { color: var(--green); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 20px; }
.facts span { display: block; font-size: var(--t-s); color: var(--ink-2); }
.facts b { font-weight: 500; } .facts b.red { color: var(--red); } .facts b.green { color: var(--green); }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 28px 52px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -4px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 500; display: grid; place-items: center; }
.steps > li:last-child { padding-bottom: 0; }
.steps h3 { margin: 0 0 8px; font-size: var(--t-m); font-weight: 500; }
.files a { display: inline-block; margin: 4px 8px 4px 0; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink); font-size: var(--t-s); font-weight: 500; }
.files a:hover { border-color: var(--ink); text-decoration: none; }
.tl { list-style: none; margin: 0 0 8px; padding: 0; }
.tl li { border-left: 2px solid var(--line-strong); padding: 0 0 20px 20px; margin-left: 4px; }
.tl li.sub-ev { border-left-color: var(--accent); } .tl li.return { border-left-color: var(--orange); } .tl li.accept { border-left-color: var(--green); }
.tl .t { font-size: var(--t-s); color: var(--ink-2); } .tl .x { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 75ch; }
details { margin-top: 16px; } summary { cursor: pointer; color: var(--ink-2); }

/* tables (forms, year view, settings) */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: var(--t-s); font-weight: 400; color: var(--ink-2); padding: 8px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .code { font-weight: 600; color: var(--navy); margin-right: 8px; }
.cat td { background: var(--paper-2); font-weight: 500; }
.mx td, .mx th { text-align: center; padding: 8px 4px; } .mx td:first-child, .mx th:first-child { text-align: left; min-width: 240px; padding-left: 12px; }
.c { display: inline-block; min-width: 28px; padding: 0 4px; border-radius: 4px; font-size: var(--t-s); line-height: 24px; font-weight: 600; margin: 2px; font-style: normal; }
a.c:hover { text-decoration: none; outline: 2px solid var(--ink); }
.c.accepted { background: var(--green-bg); color: var(--green); } .c.submitted { background: var(--blue-bg); color: var(--accent-ink); }
.c.overdue { background: var(--red); color: #fff; } .c.returned { background: var(--orange-bg); color: var(--orange); }
.c.due_soon { background: var(--amber-bg); color: var(--amber); } .c.upcoming, .c.waived { background: var(--paper-2); color: var(--ink-2); }
.c.latedone { background: var(--green-bg); color: var(--red); }
.legend span { margin-right: 16px; font-size: var(--t-s); white-space: nowrap; display: inline-block; color: var(--ink-2); }

/* notifications */
.nt { display: flex; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.nt:last-child { border-bottom: 0; } .nt:hover { background: #fff; }
.nt > div { max-width: 78ch; }
.nt.unread { font-weight: 500; }
.nt .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; flex: none; background: transparent; border: 1px solid var(--edge); }
.nt.unread .dot { border-color: transparent; background: var(--accent); }
.nt.unread.overdue .dot, .nt.unread.returned .dot { background: var(--red); } .nt.unread.reminder .dot { background: #e0a100; }
.nt.unread.accepted .dot { background: var(--green); }
.nt .t { font-size: var(--t-s); color: var(--ink-2); font-weight: 400; }

/* sign-in: the website's contact block. Dark panel on the left, form on the right. */
.loginbg { min-height: 100vh; display: grid; place-items: center; padding: 32px 24px; }
.login { width: 100%; max-width: 980px; display: grid; grid-template-columns: 5fr 6fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; min-height: 520px; }
.login .side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.login .side::before { content: ""; position: absolute; inset: 0; background: url(/ships/fleet.webp) center 64% / cover no-repeat; filter: grayscale(1); opacity: .2; }
.login .side > * { position: relative; }
.login .side .brand b { color: #fff; } .login .side .brand small { color: #8fb6ff; }
.login .side .brand img { background: #fff; border-radius: 50%; padding: 4px; }
.login .side h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -.04em; }
.login .side h1 .tone { color: #8a93a6; }
.login .side p { margin: 16px 0 0; color: #c3cadb; max-width: 34ch; }
.login .form { padding: 56px; align-self: center; }
.login .form h2 { font-size: var(--t-xl); letter-spacing: -.025em; margin: 0 0 4px; }
.login input { width: 100%; } .login button { margin-top: 28px; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(11, 21, 48, .5); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 10; overflow: auto; }
.modal[hidden], .toast[hidden] { display: none; }
.modal .card { width: 100%; max-width: 520px; margin: 0; box-shadow: 0 24px 64px rgba(11, 21, 48, .25); }
.modal input[type=text], .modal input[type=date], .modal input[type=password], .modal select { width: 100%; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 12px 12px 22px; border-radius: 999px; z-index: 20; max-width: 90vw; font-weight: 500; box-shadow: 0 8px 24px rgba(11, 21, 48, .25); display: flex; gap: 16px; align-items: center; }
.toast.bad { background: var(--red); }
.toast button { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); padding: 0 9px; }

@media (max-width: 900px) {
  :root { --t-xxl: 30px; }
  .wrap { padding: 0 16px; }
  .topin { min-height: 60px; gap: 12px; justify-content: space-between; }
  .brand img { width: 36px; height: 36px; } .brand small { letter-spacing: .2em; }
  .me span { display: none; }
  /* the menu moves to the bottom of the screen, within thumb reach. No blur on the bar here: it would trap the menu. */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-top: 1px solid var(--line-strong); justify-content: space-around; gap: 0; padding-bottom: env(safe-area-inset-bottom); }
  .tabs a { flex: 1; justify-content: center; padding: 14px 4px; font-size: 13px; }
  .tabs a.on { font-weight: 500; } .tabs a.on::after { left: 20%; right: 20%; bottom: auto; top: 0; }
  .tabs .lg { display: none; } .tabs .sh { display: inline; }
  main.wrap { padding-bottom: 120px; }
  .toast { bottom: 84px; border-radius: 16px; }
  .mast .wrap { padding-top: 32px; } .photo { margin-top: 24px; }
  .card { padding: 20px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .tally { grid-template-columns: 1fr 1fr; gap: 12px 0; } .tally div:nth-child(3) { border-left: 0; padding-left: 0; }
  .doc { grid-template-columns: 68px auto 1fr; gap: 4px 10px; padding: 12px; }
  .doc .cd { grid-row: 1 / 4; align-self: start; } .doc .chip { align-self: start; }
  .doc .dw, .doc .da { grid-column: 2 / 4; } .doc .dw span { display: inline; } .doc .dw small { display: inline; margin-left: 8px; }
  .doc .da { text-align: left; min-width: 0; margin-top: 4px; } .doc .da:empty { display: none; }
  .sec { display: block; margin-top: 36px; }
  .choice { min-height: 0; padding: 20px; }
  .choice.wide { flex-direction: column; align-items: flex-start; gap: 12px; }
  .frow { grid-template-columns: auto 1fr; gap: 8px 12px; padding: 12px; }
  .frow .files, .frow > .btn { grid-column: 2; justify-self: start; }
  .frow .files:empty { display: none; }
  .login { grid-template-columns: 1fr; min-height: 0; } .login .side { padding: 28px 24px; gap: 24px; } .login .form { padding: 28px 24px; }
}
