/* FIS 2.0 UI foundation. See docs/UI_UX_BASELINE.md. */
:root {
  color-scheme: light;
  --bg: #f2f6fc;
  --panel: #ffffff;
  --panel-soft: #f7f9fd;
  --text: #17263f;
  --muted: #5b6b83;
  --line: #dce4ef;
  --link: #215bc6;
  --accent: #225dd1;
  --accent-text: #ffffff;
  --accent-soft: #eaf1ff;
  --nav: #0c2047;
  --nav-text: #d4dfef;
  --nav-muted: #a4b5d1;
  --nav-active: #244a86;
  --focus: #d28b16;
  --success: #236443;
  --success-bg: #eaf6ef;
  --warning: #825315;
  --warning-bg: #fff4dc;
  --danger: #a13137;
  --danger-bg: #fff0f0;
  --shadow: 0 3px 15px #193b6410;
  --radius: 10px;
  --sidebar-width: 232px;
  --header-height: 68px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; }
body {
  margin: 0;
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body[data-theme=dark] {
  color-scheme: dark;
  --bg: #0e1929;
  --panel: #16263a;
  --panel-soft: #1b2e44;
  --text: #e7eef7;
  --muted: #afbed1;
  --line: #30435c;
  --link: #83dce3;
  --accent: #5bd5d9;
  --accent-text: #102832;
  --accent-soft: #203f4d;
  --nav: #091525;
  --nav-text: #d7e4f3;
  --nav-muted: #9eafc8;
  --nav-active: #1c424f;
  --focus: #f1c76b;
  --success: #a3dfbd;
  --success-bg: #1b3c35;
  --warning: #f3d18c;
  --warning-bg: #44391f;
  --danger: #ffb6b8;
  --danger-bg: #45282f;
  --shadow: 0 3px 15px #00000012;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button {
  display: inline-flex; gap: 7px; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 13px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); color: var(--text);
  cursor: pointer; font-weight: 600; line-height: 1.35;
}
button:hover { border-color: var(--link); background: var(--accent-soft); }
button[type=submit]:not(.secondary):not(.nav-signout) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button[type=submit]:not(.secondary):hover { filter: brightness(.96); }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, select, textarea {
  display: block; width: 100%; max-width: 100%; min-height: 42px; margin-top: 5px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text); font-weight: 400;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--link); }
input[type=checkbox] { display: inline-block; width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
textarea { min-height: 100px; resize: vertical; }
label { display: block; margin: 0 0 17px; font-size: 13px; font-weight: 600; }
label span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
h1, h2 { letter-spacing: -.025em; }
h1 { margin: 0 0 7px; font-size: clamp(25px, 2.2vw, 30px); line-height: 1.25; font-weight: 700; }
h2 { margin: 25px 0 12px; font-size: 17px; line-height: 1.35; font-weight: 650; }
p { margin: 0 0 17px; }
h1 + .muted { margin-bottom: 25px; }
.icon { display: inline-block; width: 20px; height: 20px; vertical-align: middle; flex: 0 0 auto; }
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: 25px 17px 18px; overflow-y: auto; background: var(--nav); color: var(--nav-text);
}
.brand-block { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 8px; }
.brand-mark { display: inline-flex; color: #eef5ff; }
.brand-mark .icon { width: 31px; height: 31px; }
.brand { font-size: 23px; font-weight: 750; line-height: 1.15; letter-spacing: -.03em; }
.subtitle { margin-top: 3px; color: var(--nav-muted); font-size: 10px; font-weight: 450; letter-spacing: .015em; }
.nav-caption { margin: 33px 11px 11px; color: var(--nav-muted); text-transform: uppercase; font-size: 10px; letter-spacing: .12em; font-weight: 650; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 10px 12px; border-radius: 6px; color: var(--nav-text); text-decoration: none; line-height: 1.35; }
.sidebar nav a:hover { background: #ffffff0c; }
.sidebar nav a[aria-current=page] { background: var(--nav-active); color: #fff; font-weight: 600; }
.sidebar nav a[aria-current=page]::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #9abaff; }
body[data-theme=dark] .sidebar nav a[aria-current=page]::before { background: var(--accent); }
.account { margin-top: auto; padding: 21px 9px 0; }
.account-inner { border-top: 1px solid #ffffff25; padding-top: 17px; }
.account-name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.account-role { display: block; margin-top: 3px; color: var(--nav-muted); font-size: 11px; }
.account form { margin-top: 13px; }
.nav-signout { padding: 5px 0; color: var(--nav-text); background: transparent; border-color: transparent; font-size: 12px; }
.nav-signout:hover { background: transparent; color: #fff; border-color: transparent; }
.workspace { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--header-height); padding: 12px 32px; border-bottom: 1px solid var(--line);
  background: var(--panel); background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(12px);
}
.breadcrumb { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12px; color: var(--muted); }
.breadcrumb strong { color: var(--text); font-weight: 600; }
.breadcrumb-separator { color: var(--muted); opacity: .65; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar-actions form { margin: 0; }
.theme-button { min-height: 34px; padding: 6px 10px; border-color: transparent; font-size: 12px; background: transparent; }
.theme-button .icon { width: 17px; height: 17px; }
.scope-label { color: var(--muted); font-size: 11px; }
.content { width: 100%; max-width: 1540px; padding: 29px 32px 40px; }
.muted { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; align-items: flex-end; gap: 13px; flex-wrap: wrap; margin: 17px 0 23px; }
.toolbar label { min-width: 190px; max-width: 100%; margin: 0; }
.toolbar select { width: auto; min-width: 190px; max-width: 100%; }
.toolbar button { min-height: 44px; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 17px; margin: 23px 0 29px; }
.metric { display: grid; grid-template-columns: 38px minmax(0,1fr); column-gap: 12px; align-content: start; padding: 21px 19px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: var(--link); background: var(--accent-soft); }
.metric strong { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-label { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.panel { margin: 20px 0; padding: 23px 25px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel > h2:first-child { margin-top: 0; }
.panel > .muted { max-width: 75ch; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 24px; }
.fields .wide { grid-column: 1 / -1; }
.form-note { color: var(--muted); font-size: 11px; margin-bottom: 19px; }
.required-mark { display: inline; margin-left: 3px; color: var(--muted); font-weight: 400; }
.table-wrap { position: relative; max-width: 100%; margin: 14px 0 22px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; vertical-align: top; padding: 14px 17px; border-bottom: 1px solid var(--line); line-height: 1.5; }
th { background: var(--panel-soft); color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .01em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-soft); }
td a { font-weight: 550; }
td:first-child:not(:last-child) { min-width: 70px; }
td form { display: inline; }
.compact { white-space: nowrap; }
.table-hint { display: flex; gap: 7px; align-items: center; margin: -12px 0 20px; color: var(--muted); font-size: 11px; }
.table-hint[hidden] { display: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 550; white-space: nowrap; background: var(--panel-soft); color: var(--muted); }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-positive { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.notice { padding: 13px 16px; margin: 0 0 22px; border: 1px solid var(--line); border-left: 3px solid var(--link); border-radius: 6px; background: var(--panel); font-size: 13px; }
.notice[role=status] { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.notice.error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.notice:focus { outline-offset: 3px; }
.empty { margin: 13px 0 19px; padding: 17px 19px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: var(--panel); font-size: 13px; }
.login { width: min(430px, calc(100% - 32px)); margin: 10vh auto; padding: 31px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow); }
.login .brand { color: var(--text); }
.login .muted { margin: 7px 0 28px; }
.login h1 { margin-bottom: 23px; font-size: 24px; }
.login button[type=submit] { min-height: 42px; margin-top: 5px; }
details > summary { cursor: pointer; }
.history details { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.history details:last-child { border-bottom: 0; }
.history summary { font-weight: 550; }
.history pre { margin: 9px 0 16px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.check-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px 17px; }
.check-grid label { display: flex; align-items: center; gap: 9px; min-height: 32px; margin: 0; font-size: 12px; font-weight: 450; }
.skip { position: fixed; left: -10000px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; padding: 10px 14px; background: var(--panel); }
.menu-toggle, .drawer-close, .nav-backdrop { display: none; }
@media (max-width: 1150px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .check-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .content { padding: 25px; }
  .topbar { padding-inline: 25px; }
}
@media (max-width: 900px) {
  :root { --header-height: 62px; }
  .shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; }
  .sidebar .account { margin-top: 20px; }
  .topbar { padding: 10px 19px; }
  .breadcrumb-workspace, .breadcrumb-separator, .scope-label { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--text); border: 1px solid var(--line); background: var(--panel); min-height: 44px; }
  .menu-toggle .icon { width: 18px; height: 18px; }
  .breadcrumb { flex: 1; }
  .js-enabled .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(285px, calc(100vw - 45px)); height: 100vh; height: 100dvh; transform: translateX(-105%); transition: transform 150ms ease; box-shadow: 10px 0 40px #0003; }
  .js-enabled.nav-open .sidebar { transform: translateX(0); }
  .js-enabled .sidebar .account { margin-top: auto; }
  .drawer-close { position: absolute; right: 12px; top: 12px; display: inline-flex; width: 44px; height: 44px; padding: 10px; min-height: 44px; border-color: transparent; color: var(--nav-text); background: transparent; }
  .nav-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 50; display: block; background: #07152a80; }
  body.nav-open { overflow: hidden; }
  .table-wrap table { min-width: 540px; }
}
@media (max-width: 600px) {
  h1 { font-size: 25px; }
  h2 { font-size: 16px; }
  .content { padding: 23px 16px 32px; }
  .topbar { gap: 11px; padding-inline: 14px; }
  .theme-button { min-height: 42px; padding: 9px; }
  .theme-button span { display: none; }
  .breadcrumb { font-size: 12px; }
  .metrics { gap: 11px; margin-block: 21px 25px; }
  .metric { grid-template-columns: 1fr; padding: 17px 15px; position: relative; }
  .metric-icon { position: absolute; top: 15px; right: 13px; width: 29px; height: 29px; }
  .metric-icon .icon { width: 16px; height: 16px; }
  .metric strong { padding-right: 33px; font-size: 27px; }
  .metric-label { margin-top: 13px; font-size: 12px; }
  .fields { grid-template-columns: 1fr; }
  .panel { padding: 20px 17px; }
  .check-grid { grid-template-columns: 1fr; gap: 3px; }
  .check-grid label { min-height: 44px; }
  .toolbar { align-items: flex-end; gap: 11px; }
  .toolbar label { flex: 1 1 100%; min-width: 0; width: 100%; }
  .toolbar select { width: 100%; min-width: 0; }
  th, td { padding: 12px 14px; }
  .table-wrap td:first-child, .table-wrap th:first-child { position: sticky; left: 0; background: var(--panel); }
  .table-wrap th:first-child { background: var(--panel-soft); }
  button, input, select { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
  .content a { display: inline-block; padding-block: 5px; }
  .content td a { padding-block: 4px; }
  .login { margin: 6vh auto; padding: 26px 23px; }
}
@media (max-width: 350px) { .metrics { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
body:not(.js-enabled) .menu-toggle, body:not(.js-enabled) .drawer-close { display: none; }

@media (max-width: 600px) { .sidebar nav a { min-height: 44px; } .content td a { min-height: 44px; display: inline-flex; align-items: center; } .theme-button { min-height: 44px; } }

/* Issue #15: vessel asset workspace, using the shared light/dark tokens. */
.asset-heading { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.asset-heading h2 { margin:0; }
.request-tabs { margin:12px 0 20px; }
.request-tabs [aria-current=page] { font-weight:700; }
.request-links { display:grid; gap:10px; margin-top:12px; }
.request-changes { margin:12px 0; }
.request-changes dt { color:var(--muted); font-size:12px; }
.request-changes dd { margin:0 0 8px; overflow-wrap:anywhere; }
.request-decisions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin:20px 0; }
.asset-requests td { overflow-wrap:anywhere; max-width:480px; }
@media(max-width:600px) { .request-decisions { grid-template-columns:minmax(0,1fr); } }
.asset-heading p { margin:6px 0 0; }
.asset-action { font-weight:650; }
.asset-filters { padding:20px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); margin-bottom:18px; }
.asset-filter-main { display:grid; grid-template-columns:minmax(160px,1fr) minmax(200px,2fr) minmax(140px,1fr); gap:16px; }
.asset-filter-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 16px; margin-top:16px; }
.asset-filter-main label,.asset-filter-grid label { min-width:0; }
.asset-filter-details { border-top:1px solid var(--line); padding-top:12px; margin:0 0 16px; }
.asset-filter-details summary { font-weight:600; color:var(--link); }
.asset-actions { display:flex; gap:12px 20px; align-items:center; flex-wrap:wrap; }
.asset-properties { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 24px; margin:20px 0; }
.asset-properties div { min-width:0; }
.asset-properties dt { font-size:12px; color:var(--muted); }
.asset-properties dd { margin:3px 0 0; overflow-wrap:anywhere; }
.asset-table td { max-width:320px; overflow-wrap:anywhere; }
.asset-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media(max-width:1024px) { .asset-filter-main,.asset-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .asset-search { grid-column:1/-1; grid-row:1; } }
@media(max-width:600px) { .asset-filter-main,.asset-filter-grid,.asset-properties { grid-template-columns:minmax(0,1fr); } .asset-filters { padding:16px; } .asset-search { grid-column:auto; } .asset-filters select { width:100%; } }
