/* Flagship Shipyard Werf-ERP: shared styles. Tokens on :root, dark variant under prefers-color-scheme (and an explicit data-theme). */
/* Flagship look (same as optrack, growth and hr_dashboard): Inter, self-hosted (static/fonts, SIL Open Font License), navy and orange. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/InterVariable.woff2') format('woff2'); }
:root {
  --navy: #13213a; --navy-2: #1d2f4d; --orange: #fa7c00; --orange-ink: #a85200; --orange-soft: #fff4e5;
  --bg: #f7f8fa; --card: #ffffff; --ink: #13213a; --ink-2: #3b4a62; --muted: #5b6b82; --line: #e3e7ed; --line-2: #c9d0da;
  --ok: #2f6846; --ok-soft: #eaf4ed; --danger: #b3261e; --danger-soft: #fbeae8; --chip: #eef3f7; --field: #ffffff;
  --nav-ink: #c9d1dc; --nav-active-bg: rgba(250, 124, 0, 0.16); --nav-active-ink: #ffb366; --link: #a85200;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #15181a; --card: #1d2124; --ink: #edeae3; --ink-2: #cfcbc3; --muted: #9aa39c; --line: #32373a; --line-2: #454b4f;
  --ok: #8fd0a5; --ok-soft: #1e3326; --danger: #f1a39d; --danger-soft: #3a1f1d; --orange-soft: #3a2e1a; --orange-ink: #ffb366;
  --chip: #262b2e; --field: #262b2e; --link: #ffb366; --navy: #1b2c45; --navy-2: #2a3f5f;
  }
}
:root[data-theme="dark"] {
  --bg: #15181a; --card: #1d2124; --ink: #edeae3; --ink-2: #cfcbc3; --muted: #9aa39c; --line: #32373a; --line-2: #454b4f;
  --ok: #8fd0a5; --ok-soft: #1e3326; --danger: #f1a39d; --danger-soft: #3a1f1d; --orange-soft: #3a2e1a; --orange-ink: #ffb366;
  --chip: #262b2e; --field: #262b2e; --link: #ffb366; --navy: #1b2c45; --navy-2: #2a3f5f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
a { color: var(--link); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Shell: navigation left, content right; on a phone the navigation is a strip on top. */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 230px; max-width: 280px; background: var(--navy); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 8px 22px; }
.brand img { display: block; width: 150px; max-width: 100%; height: auto; }
.brand-app { font-weight: 600; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--nav-ink); }
.brand.on-light .brand-app { color: var(--muted); }
.nav a.item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--nav-ink); text-decoration: none; font-weight: 500; }
.nav a.item[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 600; }
.nav .foot { margin-top: auto; padding: 12px; border-radius: 10px; background: var(--navy-2); font-size: 13px; color: #a9b4c4; display: flex; flex-direction: column; gap: 8px; }
.nav .foot button { align-self: flex-start; background: transparent; border: 1px solid #3a4a63; color: #fff; border-radius: 8px; min-height: 36px; padding: 0 12px; }
.content { flex: 999 1 560px; min-width: 0; padding: 28px 36px; }
main { max-width: 1800px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-ink); }
h1 { margin: 2px 0 0; font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -.015em; }
h2 { margin: 0; font-family: var(--font-head); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.lang { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); }
.lang button { display: flex; align-items: center; justify-content: center; width: 44px; height: 36px; border: 0; border-radius: 8px; background: transparent; padding: 0; opacity: .55; }
.lang button[aria-pressed="true"] { background: var(--chip); opacity: 1; box-shadow: inset 0 0 0 2px var(--orange); }
.lang svg { width: 28px; height: 18px; border-radius: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.cols > .grow { flex: 3 1 560px; min-width: 0; } .cols > .side { flex: 1 1 320px; min-width: 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .l { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-family: var(--font-head); font-size: 28px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.sep { border-top: 1px solid var(--line); padding-top: 14px; }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input, select, textarea { min-height: 46px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); }
textarea { padding: 10px 12px; min-height: 76px; resize: vertical; }
input.bad, textarea.bad, select.bad { border-color: var(--danger); }
.btn { min-height: 46px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); font-weight: 600; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #0f1b2d; font-weight: 700; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #0f1b2d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #0f1b2d; } }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: var(--chip); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--orange-soft); color: var(--orange-ink); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.banner { padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.banner.error { background: var(--danger-soft); color: var(--danger); } .banner.info { background: var(--orange-soft); color: var(--orange-ink); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }

.days { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.day { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.day[aria-pressed="true"] { border-color: var(--orange); }
.day .n { font-weight: 700; } .day .t { font-family: var(--font-head); font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.bar { display: block; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 6px; background: var(--orange); } .bar.full > i { background: var(--ok); }

.entry { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.entry:first-child { border-top: 0; }
.entry .main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.entry .time { font-family: var(--font-head); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-ink); }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--chip); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { white-space: normal; vertical-align: bottom; }
table.t td.wrap { white-space: normal; min-width: 200px; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.scroll { overflow-x: auto; }
@media (max-width: 640px) {
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 6px 0; }
  table.t.cards td { display: flex; justify-content: space-between; border: 0; padding: 6px 12px; }
  table.t.cards td::before { content: attr(data-label); color: var(--muted); font-weight: 600; }
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 440px; }

@media (max-width: 800px) {
  .nav { flex: 0 0 100%; max-width: none; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px; align-items: center; }
  .brand { padding: 0 8px 0 0; } .brand img { width: 96px; } .brand-app { display: none; }
  .nav a.item { flex: 0 0 auto; white-space: nowrap; } .nav .foot { margin: 0 0 0 auto; flex: 0 0 auto; flex-direction: row; align-items: center; padding: 6px 8px; }
  .nav .foot span { display: none; }
  .content { padding: 16px; } h1 { font-size: 34px; }
}

/* Printing (project overview for the team leaders and meetings): no menu, no buttons, light colours on white, cards stay whole. */
@media print {
  :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --bg: #fff; --card: #fff; --ink: #000; --ink-2: #222; --muted: #444; --line: #bbb; --line-2: #999; --chip: #eee; --field: #fff;
    --ok: #1f7a4d; --ok-soft: #fff; --danger: #b42318; --danger-soft: #fff; --orange-soft: #fff; --orange-ink: #7a3c00; --link: #000;
  }
  body { background: #fff; }
  .nav, .lang, .noprint, .tabs { display: none !important; }
  .content { padding: 0; }
  .card, .kpi { break-inside: avoid; box-shadow: none; }
  table.t th, table.t td { white-space: normal; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } }
