/* Blue Ocean Build - design system.
   White, blue, navy, light gray. Thin borders, compact status pills,
   generous whitespace, restrained shadows. Nothing decorative. */

:root {
  /* Sampled from the Blue Ocean Development logo, not guessed:
     deep #004db0 is the lower sphere, sky #219ce0 the upper,
     #1082d1 the "Blue" wordmark, #232323 the "Ocean" wordmark. */
  --navy: #0b2545;
  --blue: #004db0;
  --blue-dark: #003d8c;
  --sky: #219ce0;
  --charcoal: #232323;
  --blue-tint: #eaf2fc;
  --blue-tint-2: #d3e4f8;

  --ink: #16212e;
  --ink-2: #44566b;
  --ink-3: #6b7c8f;
  --ink-4: #94a3b3;

  --line: #dfe5ec;
  --line-2: #eef1f5;
  --bg: #f6f8fa;
  --panel: #ffffff;

  --good: #127a52;
  --good-bg: #e6f4ee;
  --warn: #a9660f;
  --warn-bg: #fdf3e3;
  --bad: #b3261e;
  --bad-bg: #fdeceb;
  --info: #6b4fbb;
  --info-bg: #f0ecfa;
  --muted: #7b8b9c;
  --muted-bg: #f0f3f6;

  /* Brand, taken from blueoceanmodulars.com. Orange is the accent the website
     leads with; it is used here for identity and the primary action only.
     It is deliberately NOT used for state - amber below still means
     "watch this", and a tool people scan quickly cannot have two oranges
     that mean different things. */
  --brand: #ff8a00;
  --brand-dark: #e07600;
  --brand-tint: #fff4e6;
  --brand-ink: #8a4b00;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 4px 12px rgba(11, 37, 69, .05);
  --shadow-lg: 0 8px 32px rgba(11, 37, 69, .14);
  --font: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .4rem; color: var(--navy); font-weight: 700; letter-spacing: -.005em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
h4 { font-size: .85rem; }
p { margin: 0 0 .75rem; }

.muted { color: var(--ink-3); }
.small { font-size: .8rem; }
.tiny { font-size: .72rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.strong { font-weight: 650; }
.eyebrow {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-4); font-weight: 600;
}

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px; flex: 0 0 216px; background: var(--navy); color: #cfdbe8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 1.05rem 1.1rem .9rem; display: flex; align-items: center; gap: .55rem;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.sidebar .brand svg { flex: 0 0 auto; }
.sidebar .brand-text { line-height: 1.15; }
.sidebar .brand-name { color: #fff; font-weight: 650; font-size: .92rem; letter-spacing: -.01em; }
.sidebar .brand-sub { font-size: .63rem; color: #7d97b4; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.sidebar nav { padding: .7rem .6rem; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: .55rem; padding: .48rem .6rem;
  color: #b9c9db; border-radius: var(--radius-sm); font-size: .855rem;
  margin-bottom: 1px; text-decoration: none;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active {
  background: rgba(255,255,255,.10); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}
.sidebar .nav-sep {
  margin: .7rem .6rem .45rem; border-top: 1px solid rgba(255,255,255,.1);
  padding-top: .6rem; font-size: .64rem; text-transform: uppercase;
  letter-spacing: .07em; color: #6e88a5;
}
.sidebar .user {
  padding: .7rem .8rem; border-top: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; gap: .55rem; font-size: .78rem;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--blue);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 650; flex: 0 0 auto;
}
.avatar.sm { width: 21px; height: 21px; font-size: .6rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: .6rem 1.4rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 30;
}
.topbar .crumbs { font-size: .8rem; color: var(--ink-3); flex: 1; min-width: 0; }
.topbar .crumbs strong { color: var(--navy); }
.content { padding: 1.4rem; flex: 1; }
.content.flush { padding: 0; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.card.tight { padding: .75rem .85rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line-2);
}
.card-body { padding: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }

/* ---------- Stats ---------- */
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem .95rem;
}
.stat .label {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-4); font-weight: 600; margin-bottom: .25rem;
}
.stat .value { font-size: 1.7rem; font-weight: 650; color: var(--navy); line-height: 1.1; }
.stat .value small { font-size: .8rem; font-weight: 400; color: var(--ink-3); }
.stat.warn .value { color: var(--warn); }
.stat.bad .value { color: var(--bad); }

.statstrip {
  display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap;
  padding: .55rem 0;
}
.statstrip .item { display: flex; align-items: baseline; gap: .35rem; font-size: .84rem; }
.statstrip .n { font-weight: 650; color: var(--navy); font-size: 1rem; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem;
  border-radius: 999px; font-size: .7rem; font-weight: 600; line-height: 1.5;
  white-space: nowrap; border: 1px solid transparent;
}
.pill.good { background: var(--good-bg); color: var(--good); border-color: #c7e6d8; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: #f2ddba; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: #f4cbc8; }
.pill.info { background: var(--info-bg); color: var(--info); border-color: #dcd3f2; }
.pill.muted { background: var(--muted-bg); color: var(--ink-2); border-color: var(--line); }
.pill.blue { background: var(--blue-tint); color: var(--blue); border-color: var(--blue-tint-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .42rem .8rem; border-radius: var(--radius-sm); font-size: .82rem;
  font-weight: 550; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); cursor: pointer; text-decoration: none; font-family: inherit;
  line-height: 1.45; white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e0; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
/* Kept for the places that want the old blue call to action. */
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: #143154; }
.btn.danger { color: var(--bad); border-color: #f0c9c6; background: #fff; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: .26rem .55rem; font-size: .74rem; }
.btn.xs { padding: .16rem .42rem; font-size: .68rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--navy); color: #fff; border-color: var(--navy); z-index: 1; }

/* ---------- Forms ---------- */
label { display: block; font-size: .74rem; font-weight: 600; color: var(--ink-2);
  margin-bottom: .22rem; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], input[type=url], input[type=search],
select, textarea {
  width: 100%; padding: .44rem .6rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: .86rem; font-family: inherit;
  color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,95,165,.12);
}
textarea { resize: vertical; line-height: 1.5; }
select[multiple] { min-height: 110px; }
.field { margin-bottom: .85rem; }
.field .help { font-size: .72rem; color: var(--ink-3); margin-top: .2rem; }
.field .errors { font-size: .75rem; color: var(--bad); margin-top: .2rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem 1rem; margin: 0 0 1rem; }
legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 600; padding: 0 .35rem; }
details.more { margin-bottom: .85rem; }
details.more > summary {
  cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--blue);
  padding: .3rem 0; list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+ "; }
details.more[open] > summary::before { content: "- "; }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data th {
  text-align: left; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-4); font-weight: 600;
  padding: .5rem .7rem; border-bottom: 1px solid var(--line); background: #fbfcfd;
}
table.data td { padding: .55rem .7rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafbfc; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Progress ---------- */
.bar { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.bar.blue > span { background: var(--blue); }
.bar.lg { height: 8px; }

/* ---------- Portfolio cards ---------- */
.project-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: .85rem; overflow: hidden;
}
.project-card:hover { border-color: #c6d2e0; }
.project-card .pc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.05rem .5rem;
}
.project-card .pc-title { font-size: 1rem; font-weight: 650; color: var(--navy); }
.project-card .pc-sub { font-size: .77rem; color: var(--ink-3); margin-top: .1rem; }
.project-card .pc-bar { padding: 0 1.05rem .6rem; display: flex; align-items: center; gap: .7rem; }
.project-card .pc-bar .bar { flex: 1; }
.project-card .pc-pct { font-size: .78rem; font-weight: 650; color: var(--ink-2);
  font-variant-numeric: tabular-nums; }
.project-card .pc-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .1rem 1rem; padding: .6rem 1.05rem .85rem; border-top: 1px solid var(--line-2);
  background: #fcfdfe;
}
.project-card .pc-meta .k { font-size: .66rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-4); font-weight: 600; }
.project-card .pc-meta .v { font-size: .82rem; color: var(--ink); }
.project-card .pc-alert {
  margin: 0 1.05rem .85rem; padding: .5rem .7rem; background: var(--warn-bg);
  border: 1px solid #f2ddba; border-radius: var(--radius-sm);
  font-size: .78rem; color: #7c4c07;
}

/* ---------- Alerts / messages ---------- */
.alert {
  padding: .6rem .85rem; border-radius: var(--radius-sm); font-size: .84rem;
  margin-bottom: .8rem; border: 1px solid;
}
.alert.success { background: var(--good-bg); border-color: #c7e6d8; color: #0d5c3e; }
.alert.error { background: var(--bad-bg); border-color: #f4cbc8; color: #8f1d17; }
.alert.warning { background: var(--warn-bg); border-color: #f2ddba; color: #7c4c07; }
.alert.info { background: var(--blue-tint); border-color: var(--blue-tint-2); color: #10456f; }

#gantt-flash { pointer-events: none; transition: opacity .25s ease; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-3); font-size: .86rem; }
.demo-flag {
  display: inline-block; padding: .05rem .35rem; background: var(--muted-bg);
  border: 1px solid var(--line); border-radius: 3px; font-size: .62rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600;
}

/* ---------- Gantt ---------- */
.gantt-page { display: flex; flex-direction: column; height: calc(100vh - 49px); }
.gantt-head { padding: .85rem 1.4rem .6rem; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.gantt-toolbar {
  display: flex; align-items: center; gap: .5rem; padding: .55rem 1.4rem;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.gantt-toolbar .spacer { flex: 1; }

/* The scroll container. Four panes inside it stay frozen via position:sticky,
   so task names survive scrolling right and the date header survives scrolling
   down. */
.gantt-wrap { flex: 1; overflow: auto; background: var(--panel); position: relative; }
.gantt-wrap.fullscreen { position: fixed; inset: 0; z-index: 200; background: #fff; }

.gantt-grid {
  display: grid;
  grid-template-columns: 288px max-content;
  grid-template-rows: 40px max-content;
  width: max-content;
}
.g-corner {
  position: sticky; top: 0; left: 0; z-index: 4;
  background: #fbfcfd;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.g-axis {
  position: sticky; top: 0; z-index: 3;
  background: #fbfcfd; border-bottom: 1px solid var(--line);
}
.g-labels {
  position: sticky; left: 0; z-index: 2;
  background: #fff; border-right: 1px solid var(--line);
  box-shadow: 2px 0 4px -2px rgba(11, 37, 69, .10);
}
.g-chart { z-index: 1; }
.g-corner svg, .g-axis svg, .g-labels svg, .g-chart svg { display: block; }

.g-labels .label-row:hover .row-band { fill: #f4f7fa; }
.g-labels .phase-row { cursor: pointer; }
.g-chart .phase-row { cursor: pointer; }
.g-chart .bar-shape { cursor: grab; }
.g-chart .bar-shape.dragging { cursor: grabbing; opacity: .8; }
.g-chart .resize-handle { cursor: ew-resize; opacity: 0; }
.g-chart .bar-group:hover .resize-handle { opacity: .55; }
/* There is no hover on a touch screen, so the handle has to be permanently
   visible or it may as well not exist. */
@media (pointer: coarse) {
  .g-chart .resize-handle { opacity: .35; }
  .g-chart .bar-shape { cursor: default; }
}
.g-chart .bar-group:hover .row-band { fill: #f4f7fa; }
.g-chart .dep-line { pointer-events: none; }
/* While dragging, nothing else on the page should try to select or highlight. */
body.gantt-dragging { user-select: none; cursor: grabbing; }
body.gantt-dragging .g-chart .row-band { fill: transparent; }

.gantt-legend {
  display: flex; gap: 1rem; padding: .45rem 1.4rem; font-size: .71rem;
  color: var(--ink-3); border-top: 1px solid var(--line); background: #fbfcfd;
  flex-wrap: wrap;
}
.gantt-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.diamond { transform: rotate(45deg); border-radius: 1px; }

/* ---------- Drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(11,37,69,.28); z-index: 300;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw;
  background: #fff; z-index: 301; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer-head { padding: 1rem 1.1rem .8rem; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; }
.drawer-section { margin-bottom: 1.15rem; }
.drawer-section > .eyebrow { margin-bottom: .4rem; }
.drawer-close {
  position: absolute; top: .75rem; right: .85rem; background: none; border: none;
  font-size: 1.2rem; color: var(--ink-3); cursor: pointer; line-height: 1;
}
.kv { display: grid; grid-template-columns: 92px 1fr; gap: .3rem .6rem; font-size: .83rem; }
.kv dt { color: var(--ink-3); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; padding-top: .1rem; }
.kv dd { margin: 0; }

/* ---------- Activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2);
  font-size: .83rem;
}
.feed li:last-child { border-bottom: none; }
.feed .when { flex: 0 0 82px; font-size: .72rem; color: var(--ink-4); padding-top: .12rem; }
.feed .what { flex: 1; min-width: 0; }
.feed .who { font-weight: 600; color: var(--navy); }
.feed .tag { flex: 0 0 auto; }

/* ---------- Messages / SMS ---------- */
.sms-thread { display: flex; flex-direction: column; gap: .55rem; }
.sms {
  max-width: 74%; padding: .5rem .7rem; border-radius: 12px; font-size: .83rem;
  line-height: 1.45; white-space: pre-wrap;
}
.sms.out { align-self: flex-start; background: var(--blue); color: #fff;
  border-bottom-left-radius: 3px; }
.sms.in { align-self: flex-end; background: var(--muted-bg); color: var(--ink);
  border: 1px solid var(--line); border-bottom-right-radius: 3px; }
.sms-meta { font-size: .68rem; color: var(--ink-4); margin: .1rem .2rem; }
.sms-meta.out { align-self: flex-start; }
.sms-meta.in { align-self: flex-end; }

/* ---------- Auth ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy); padding: 1.5rem;
}
.auth-card {
  background: #fff; border-radius: var(--radius); padding: 1.9rem;
  width: 100%; max-width: 380px; box-shadow: var(--shadow-lg);
}
.auth-card .brandmark { display: flex; align-items: center; gap: .55rem; margin-bottom: 1.4rem; }

/* ---------- Extraction review ---------- */
.extract-row {
  display: grid; grid-template-columns: 140px 1fr auto; gap: .6rem;
  align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line-2);
}
.extract-row:last-child { border-bottom: none; }
.extract-row .fname { font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.provenance { font-size: .7rem; color: var(--ink-4); }

/* ---------- Timeline ---------- */
.tl-row { display: grid; grid-template-columns: 160px 1fr; gap: .8rem;
  align-items: center; padding: .45rem 0; }
.tl-track { position: relative; height: 20px; background: var(--line-2);
  border-radius: 4px; }
.tl-bar { position: absolute; top: 0; height: 20px; border-radius: 4px;
  background: var(--blue); }
.tl-milestone { position: absolute; top: 3px; width: 9px; height: 9px;
  background: var(--info); transform: rotate(45deg); }
.tl-today { position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--bad); }

/* ---------- Mobile navigation ---------- */
[x-cloak] { display: none !important; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; padding: 0 9px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel); cursor: pointer;
  flex: 0 0 auto;
}
.nav-toggle span { display: block; height: 2px; background: var(--navy);
  border-radius: 2px; }
.nav-close {
  display: none; position: absolute; top: .5rem; right: .7rem; background: none;
  border: none; color: #9fb3c8; font-size: 1.6rem; line-height: 1; cursor: pointer;
  width: 40px; height: 40px;
}
.nav-scrim { display: none; }
.topbar-search { width: 230px; }
.topbar-search input { padding: .3rem .55rem; font-size: .8rem; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .content { padding: 1.1rem; }
  .gantt-head, .gantt-toolbar, .gantt-legend { padding-left: 1.1rem; padding-right: 1.1rem; }
  .drawer { width: 400px; }
}

/* Below this the sidebar becomes an overlay drawer. Hiding it with no
   replacement left the app with no navigation at all. */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-close { display: block; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 120;
    transform: translateX(-100%); transition: transform .22s ease;
    width: 264px; flex-basis: 264px; height: 100vh;
    box-shadow: 4px 0 24px rgba(11, 37, 69, .28);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 110;
    background: rgba(11, 37, 69, .42);
  }
  /* Comfortable targets for a thumb. */
  .sidebar nav a { padding: .72rem .75rem; font-size: .92rem; }
  .sidebar .user { padding: .9rem .8rem; }

  .content { padding: .9rem; }
  .topbar { padding: .5rem .9rem; gap: .6rem; }
  .topbar-search { width: auto; flex: 1; min-width: 0; max-width: 260px; }
  .crumbs { display: none; }

  .page-head { gap: .6rem; margin-bottom: .9rem; }
  .page-head h1 { font-size: 1.28rem; }

  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .kv { grid-template-columns: 84px 1fr; }

  /* Tables scroll rather than squeeze into unreadable columns. */
  .card.flush { overflow-x: auto; }
  table.data { min-width: 560px; }

  /* Touch targets. 40px is the practical floor on a phone. */
  .btn { padding: .58rem .9rem; font-size: .86rem; min-height: 40px; }
  .btn.sm { padding: .45rem .7rem; font-size: .8rem; min-height: 36px; }
  .btn.xs { padding: .35rem .6rem; font-size: .75rem; min-height: 32px; }
  input[type=text], input[type=email], input[type=password], input[type=date],
  input[type=time], input[type=number], input[type=url], input[type=search],
  select, textarea { font-size: 16px; min-height: 42px; }  /* 16px stops iOS zooming on focus */

  .gantt-page { height: calc(100vh - 46px); }
  .gantt-head { padding: .7rem .9rem .5rem; }
  .gantt-toolbar { padding: .5rem .9rem; gap: .4rem; }
  .statstrip { gap: .9rem; font-size: .8rem; }
  .gantt-legend { display: none; }
  /* The name column has to give ground when the screen is this narrow. */
  .gantt-grid { grid-template-columns: 168px max-content; }
  .g-labels { width: 168px; }
}

/* Touch targets follow the input device, not the screen width. An iPad in
   landscape is 1180px wide and still driven by a fingertip. */
@media (pointer: coarse) {
  .btn { min-height: 40px; padding: .5rem .85rem; }
  .btn.sm { min-height: 38px; padding: .42rem .7rem; }
  .btn.xs { min-height: 34px; padding: .3rem .6rem; }
  .btn-group .btn { min-height: 40px; }
  .sidebar nav a { padding: .62rem .7rem; }
  table.data td, table.data th { padding: .7rem .7rem; }
  input, select, textarea { min-height: 42px; font-size: 16px; }
  .drawer-close { width: 44px; height: 44px; font-size: 1.5rem; }
  details.more > summary { padding: .5rem 0; }
}

@media (max-width: 560px) {
  .content { padding: .7rem; }
  .card { padding: .8rem .85rem; }
  .project-card .pc-meta { grid-template-columns: 1fr 1fr; }
  .statstrip { gap: .7rem; }
  .gantt-grid { grid-template-columns: 140px max-content; }
  .g-labels { width: 140px; }
}

/* ---------- Field view (phone) ---------- */
.field-head {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem;
}
.field-head select {
  font-weight: 650; color: var(--navy); border-color: var(--line);
  background: var(--panel);
}
.field-date { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }

.field-block { margin-bottom: 1.15rem; }
.field-h {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-4); font-weight: 700; margin: 0 0 .45rem;
  display: flex; align-items: center; gap: .4rem;
}
.field-h.bad { color: var(--bad); }
.field-h.warn { color: var(--warn); }
.field-h.info { color: var(--info); }
.field-h .n {
  background: currentColor; color: #fff; border-radius: 999px;
  padding: 0 .38rem; font-size: .66rem; line-height: 1.5;
}

.field-row {
  display: flex; align-items: center; gap: .6rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .8rem; margin-bottom: .45rem;
}
.field-row.bad { border-color: #f4cbc8; background: var(--bad-bg); }
.fr-main { flex: 1; min-width: 0; }
.fr-title {
  font-size: .93rem; font-weight: 600; color: var(--navy);
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  line-height: 1.35;
}
.fr-sub { font-size: .78rem; color: var(--ink-3); margin-top: .12rem; line-height: 1.4; }
.fr-right { display: flex; align-items: center; gap: .35rem; flex: 0 0 auto; }

/* Deliberately chunky. These are the only controls on the screen. */
.fr-act {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; min-height: 42px; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); font-size: .82rem;
  font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit;
}
.fr-act:hover { background: #f8fafc; text-decoration: none; }
.fr-act.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.fr-act.ghost { min-width: 38px; color: var(--ink-4); font-size: 1rem; }

.field-foot { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }

@media print {
  .sidebar, .topbar, .gantt-toolbar, .btn { display: none !important; }
  .content { padding: 0; }
  .card { border: none; }
}

/* ==========================================================================
   Project dashboard
   The morning screen. Icons carry the scan, numbers carry the answer, and
   every tile says in plain words what it wants you to do about it.
   ========================================================================== */

.ic {
  width: 1em; height: 1em; flex: none;
  vertical-align: -.14em;
}

/* --- stat tiles ---------------------------------------------------------- */
.dash-kpis {
  display: grid; gap: .75rem; margin-bottom: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem .9rem .75rem;
  display: flex; flex-direction: column; min-width: 0;
}
.kpi .kpi-top {
  display: flex; align-items: center; gap: .4rem;
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 650; color: var(--ink-3);
}
.kpi .kpi-top .ic { font-size: 1.05rem; color: var(--ink-4); }
.kpi .kpi-val {
  font-size: 1.75rem; font-weight: 680; color: var(--navy);
  line-height: 1.15; letter-spacing: -.02em; margin: .3rem 0 .05rem;
}
.kpi .kpi-val small { font-size: .85rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.kpi .kpi-note { font-size: .76rem; color: var(--ink-2); }
.kpi .kpi-note.good { color: var(--good); font-weight: 600; }
.kpi .kpi-note.warn { color: var(--warn); font-weight: 600; }
.kpi .kpi-note.bad  { color: var(--bad);  font-weight: 600; }
.kpi.accent-good .kpi-top .ic { color: var(--good); }
.kpi.accent-warn .kpi-top .ic { color: var(--warn); }
.kpi.accent-bad  .kpi-top .ic { color: var(--bad); }
.kpi.accent-blue .kpi-top .ic { color: var(--blue); }

/* --- card heading with icon ---------------------------------------------- */
.h-ic {
  display: flex; align-items: center; gap: .45rem;
  margin: 0 0 .15rem; font-size: 1rem; color: var(--navy); font-weight: 650;
}
.h-ic .ic { font-size: 1.15rem; color: var(--blue); }
.h-sub { font-size: .78rem; color: var(--ink-3); margin: 0 0 .8rem; }
.h-act { margin-left: auto; font-size: .76rem; font-weight: 600; }

/* --- curve --------------------------------------------------------------- */
.curve-wrap { position: relative; }
.curve-wrap svg.curve { display: block; width: 100%; height: auto; overflow: visible; }
.curve-legend {
  display: flex; gap: 1rem; font-size: .76rem; color: var(--ink-2);
  margin-bottom: .3rem; flex-wrap: wrap;
}
.curve-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.curve-legend i { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.curve-tip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .08s;
  background: var(--navy); color: #fff; border-radius: 7px; padding: .4rem .55rem;
  font-size: .75rem; line-height: 1.35; white-space: nowrap; z-index: 5;
  box-shadow: var(--shadow-lg);
}
.curve-tip b { font-weight: 650; }
.curve-tip .r { display: flex; align-items: center; gap: .35rem; margin-top: .15rem; }
.curve-tip .r i { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* --- phase bars ---------------------------------------------------------- */
.ph-row {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem .7rem;
  padding: .55rem 0; border-top: 1px solid var(--line-2);
}
.ph-row:first-of-type { border-top: 0; }
.ph-row .ph-name { grid-column: 1; grid-row: 1; font-weight: 600; font-size: .84rem; }
.ph-row .ph-meta { grid-column: 1; grid-row: 2; font-size: .73rem; color: var(--ink-4); }
.ph-row .ph-meta.warn { color: var(--warn); }
.ph-row .ph-pc {
  grid-column: 2; grid-row: 1 / 3; align-self: center;
  font-size: .82rem; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.ph-bar {
  grid-column: 1 / 3; height: 6px; border-radius: 4px;
  background: var(--line-2); overflow: hidden; margin-top: .35rem;
}
.ph-bar i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.ph-bar i.good { background: var(--good); }
.ph-bar i.warn { background: var(--warn); }

/* --- compact list rows --------------------------------------------------- */
.d-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 0; border-top: 1px solid var(--line-2); font-size: .84rem;
}
.d-row:first-of-type { border-top: 0; }
.d-row .d-ic {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: .95rem;
}
.d-ic.blue { background: var(--blue-tint); color: var(--blue); }
.d-ic.good { background: var(--good-bg); color: var(--good); }
.d-ic.warn { background: var(--warn-bg); color: var(--warn); }
.d-ic.bad  { background: var(--bad-bg);  color: var(--bad); }
.d-ic.info { background: var(--info-bg); color: var(--info); }
.d-ic.muted{ background: var(--muted-bg);color: var(--ink-3); }
.d-row .d-body { min-width: 0; flex: 1; }
.d-row .d-body .d-t { font-weight: 600; }
.d-row .d-body .d-s { font-size: .74rem; color: var(--ink-3); }
.d-row .d-end { margin-left: auto; text-align: right; white-space: nowrap; }
.d-row .d-end .d-when { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .kpi .kpi-val { font-size: 1.45rem; }
  .kpi { padding: .65rem .7rem; }
}

/* ==========================================================================
   Brand lockup
   The mark is the Blue Ocean Development logo, unaltered — only the white
   page behind it was made transparent, so the wave still reads white on the
   navy sidebar rather than punching a hole through it.
   ========================================================================== */

.sidebar .brand-logo {
  width: 30px; height: 30px; flex: none;
  object-fit: contain;
}

.brandmark.stacked {
  display: flex; flex-direction: column; align-items: center;
  gap: .5rem; text-align: center; margin-bottom: 1.4rem;
}
.auth-logo {
  width: 100%; max-width: 236px; height: auto; display: block;
}
.auth-product {
  font-size: .64rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 600;
}
