/*
 * Vessel portal: AI Supply Chain Solutions design system (matches
 * aiscsolutions.com). Navy for type and structure, orange as the action color.
 * Orange text on white uses --orange-ink (passes contrast); the logo orange
 * is for fills with navy text.
 */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-display: swap; src: url(/fonts/source-serif-4-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-display: swap; src: url(/fonts/source-serif-4-latin-700-normal.woff2) format("woff2"); }

:root {
  --navy: #03206c;
  --navy-700: #0a2e8a;
  --deep: #06173f;
  --orange: #fe5d13;
  --orange-hover: #ff7535;
  --orange-ink: #c2410c;
  --ink: #0b1838;
  --muted: #55617e;
  --mist: #eef2f9;
  --wash: #f6f8fc;
  --line: #d7ddea;
  --field: #9aa6c0;
  --white: #ffffff;
  --warn: #b45309;
  --danger: #b42318;
  --ok: #1d6b46;
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(3, 32, 108, .05), 0 10px 30px -18px rgba(3, 32, 108, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--wash);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 2px; }

.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px; }

/* ── App header ─────────────────────────────────────────────── */
header.app {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 24px;
  position: sticky; top: 0; z-index: 10;
}
header.app .brand a { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
header.app .brand img { height: 42px; width: auto; display: block; }
header.app .brand span { font-family: var(--display); font-weight: 600; font-size: 17px; padding-left: 12px; border-left: 1px solid var(--line); }
header.app nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; }
header.app nav a { color: var(--ink); font-weight: 500; }
header.app nav a.active { color: var(--navy); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 8px; }
header.app nav a:hover { color: var(--orange-ink); text-decoration: none; }
header.app .who { color: var(--muted); font-size: 13px; }
header.app .who .badge { margin-left: 6px; }
header.app form { display: inline; }
header.app button.link {
  background: none; border: 0; color: var(--navy); cursor: pointer;
  font: 500 15px var(--body); padding: 0;
}
header.app button.link:hover { color: var(--orange-ink); text-decoration: underline; }
.client-bar { background: var(--mist); color: var(--navy); font-size: 13px; text-align: center; padding: 6px 16px; }

/* ── Type ───────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--display); color: var(--navy); text-wrap: balance; line-height: 1.2; }
h1 { font-size: 32px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 22px; font-weight: 600; margin: 28px 0 12px; }
h3 { font-size: 17px; font-weight: 600; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.eyebrow { font: 600 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--orange-ink); }
code { background: var(--mist); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

/* ── Surfaces ───────────────────────────────────────────────── */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.panel > h2:first-child, .panel > .between:first-child h2 { margin-top: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ── Forms ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  padding: 10px 12px; border: 1px solid var(--field); border-radius: 4px;
  font: inherit; background: #fff; color: var(--ink); min-height: 42px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid rgba(254, 93, 19, .35); outline-offset: 0; border-color: var(--navy);
}
.field textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border-radius: 4px;
  border: 2px solid var(--navy); background: var(--navy); color: #fff;
  cursor: pointer; font: 600 15px var(--body); text-decoration: none; line-height: 1.1;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; background: var(--navy-700); border-color: var(--navy-700); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--deep); }
.btn.primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--navy); background: #fff; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0c2bd; }
.btn.danger:hover { border-color: var(--danger); background: #fff; }
.btn.sm { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn.block { width: 100%; }

.stack { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
table.data th, table.data td {
  padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top;
}
table.data th { background: var(--mist); font-weight: 600; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fafbfe; }

/* ── Badges, stats, alerts ──────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--mist); color: var(--navy);
}
.badge.warn { background: #fdf0e1; color: var(--warn); }
.badge.danger { background: #fdecea; color: var(--danger); }
.badge.ok { background: #e2f4ea; color: var(--ok); }

.stat { display: flex; flex-direction: column; border-top: 3px solid var(--navy); }
.stat .n { font-family: var(--display); font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }
.grid .stat:nth-child(2) { border-top-color: var(--orange); }

.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.alert.error { background: #fdecea; color: #7a1a12; border-color: #f0c2bd; }
.alert.ok { background: #e2f4ea; color: #144d33; border-color: #b6e0c8; }
.alert.info { background: var(--mist); color: var(--navy); border-color: var(--line); }

.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt, .kv .k { color: var(--muted); }

/* ── Sign-in pages ──────────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 36px 32px; }
.auth-card .logo { height: 54px; width: auto; display: block; margin-bottom: 22px; }
.auth-card h1 { font-size: 28px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ms-btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; min-height: 46px; border: 1px solid var(--field); border-radius: 4px; background: #fff; color: var(--ink); font: 600 15px var(--body); text-decoration: none; }
.ms-btn:hover { border-color: var(--navy); text-decoration: none; }

/* ── Landing ────────────────────────────────────────────────── */
.hero { position: relative; background: var(--deep); color: #fff; padding: 88px 24px 96px; overflow: hidden; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--orange); }
.hero .inner { max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hero h1 { color: #fff; font-size: clamp(36px, 5vw, 54px); max-width: 16ch; margin: 12px 0; }
.hero p { max-width: 640px; font-size: 18px; color: #d8e0f2; margin: 0 0 26px; }
.hero .eyebrow { color: #ffb08a; }
.hero .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn.secondary:hover { background: rgba(255,255,255,.1); }

.services { padding: 56px 24px; }
.service-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.service-card h3 { margin-top: 0; color: var(--navy); }
.service-card p { color: var(--muted); margin-bottom: 0; }

footer.site { padding: 28px 24px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: #fff; }
footer.site a { color: var(--muted); }

@media (max-width: 640px) {
  .container { padding: 24px 16px; }
  header.app .brand span { display: none; }
  h1 { font-size: 26px; }
  .panel { padding: 18px 16px; }
}
@media print {
  header.app, footer.site, .no-print, .client-bar { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; }
}
