:root {
  color-scheme: dark;
  --page:#06151d;
  --panel:#0b2430;
  --panel-2:#0f2d3b;
  --line:#285064;
  --text:#f5fbff;
  --muted:#91b7ca;
  --accent:#19c7dc;
  --ok:#20d39b;
  --warn:#f0b54a;
  --bad:#f0526f;
  --shadow:0 16px 34px rgba(0,0,0,.2);
}

* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--page); color:var(--text); font-family:Inter,Segoe UI,Arial,sans-serif; letter-spacing:0; }
button,input,select { font:inherit; }
button,a,select,input { outline-offset:2px; }

.module-header { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; padding:24px clamp(18px,3vw,44px) 20px; border-bottom:1px solid var(--line); background:#081b26; }
.module-header small { color:var(--accent); font-size:12px; font-weight:800; }
.module-header h1 { margin:4px 0 2px; font-size:30px; line-height:1.1; }
.module-header p { margin:0; color:var(--muted); font-size:13px; }
.module-header nav { display:flex; gap:8px; }
.module-header a { padding:10px 13px; border:1px solid var(--line); border-radius:6px; color:var(--text); text-decoration:none; font-weight:750; }
.module-header a:hover { border-color:var(--accent); }

main { width:100%; padding:18px clamp(14px,2vw,34px) 34px; }
.archive-band { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:7px; overflow:hidden; background:var(--panel); box-shadow:var(--shadow); }
.archive-band div { min-height:66px; padding:13px 16px; border-right:1px solid var(--line); }
.archive-band div:last-child { border-right:0; }
.archive-band span,.summary-card span { display:block; color:var(--muted); font-size:10px; font-weight:800; }
.archive-band strong { display:block; margin-top:6px; font-size:15px; }

.fleet-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:12px; }
.summary-card { min-height:122px; padding:15px 17px; border:1px solid var(--line); border-left:4px solid var(--vessel); border-radius:7px; background:var(--panel); }
.summary-card header { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.summary-card h2 { margin:0; font-size:18px; }
.summary-card em { color:var(--ok); font-style:normal; font-size:11px; font-weight:800; }
.summary-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:16px; }
.summary-grid strong { display:block; margin-top:4px; font-size:13px; }

.filters { display:grid; grid-template-columns:minmax(180px,240px) auto minmax(190px,240px) minmax(190px,240px) auto; gap:10px; align-items:end; margin-top:12px; padding:13px; border:1px solid var(--line); border-radius:7px; background:var(--panel); }
.filters label { color:var(--muted); font-size:11px; font-weight:800; }
.filters select,.filters input { width:100%; height:40px; margin-top:5px; padding:0 11px; border:1px solid var(--line); border-radius:5px; background:#061922; color:var(--text); }
.range-control { display:flex; align-items:center; height:40px; }
.range-control button { height:40px; min-width:52px; border:1px solid var(--line); border-right:0; background:#071c27; color:var(--muted); cursor:pointer; }
.range-control button:first-child { border-radius:5px 0 0 5px; }
.range-control button:last-child { border-right:1px solid var(--line); border-radius:0 5px 5px 0; }
.range-control button.active { background:var(--accent); color:#021217; font-weight:850; }
.primary-action { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:40px; padding:0 16px; border:1px solid var(--accent); border-radius:5px; background:var(--accent); color:#021217; font-weight:850; cursor:pointer; }
.primary-action svg,.pager svg { width:17px; height:17px; }

.records-panel { margin-top:12px; border:1px solid var(--line); border-radius:7px; overflow:hidden; background:var(--panel); box-shadow:var(--shadow); }
.records-panel > header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; border-bottom:1px solid var(--line); }
.records-panel h2 { margin:0; font-size:17px; }
.records-panel header p { margin:3px 0 0; color:var(--muted); font-size:12px; }
.records-panel header > span { padding:6px 9px; border:1px solid var(--line); border-radius:5px; color:var(--muted); font-size:12px; font-weight:800; }
.table-scroll { width:100%; overflow:auto; }
table { width:100%; min-width:1080px; border-collapse:collapse; }
th { padding:10px 12px; background:#081c27; color:var(--muted); text-align:left; font-size:10px; text-transform:uppercase; white-space:nowrap; }
td { padding:10px 12px; border-top:1px solid var(--line); font-size:12px; white-space:nowrap; }
tbody tr:hover { background:rgba(25,199,220,.07); }
.vessel-code { font-weight:900; color:var(--accent); }
.source-pill { display:inline-block; max-width:210px; overflow:hidden; text-overflow:ellipsis; padding:4px 7px; border:1px solid var(--line); border-radius:4px; color:var(--muted); vertical-align:middle; }
.fix-ok { color:var(--ok); font-weight:850; }
.fix-bad { color:var(--bad); font-weight:850; }
.empty-row td { height:180px; color:var(--muted); text-align:center; }
.records-panel > footer { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.pager { display:flex; gap:6px; }
.pager button { display:grid; place-items:center; width:36px; height:32px; border:1px solid var(--line); border-radius:5px; background:#071c27; color:var(--text); cursor:pointer; }
.pager button:disabled { opacity:.35; cursor:not-allowed; }

html[data-smc-theme="full-black"] { color-scheme:dark; --page:#000; --panel:#050505; --panel-2:#0a0a0a; --line:#555; --text:#fff; --muted:#d5d5d5; --accent:#fff; --ok:#fff; --warn:#fff; --bad:#fff; --shadow:none; }
html[data-smc-theme="full-black"] .module-header,html[data-smc-theme="full-black"] th { background:#000; }
html[data-smc-theme="full-black"] .range-control button.active,html[data-smc-theme="full-black"] .primary-action { background:#fff; color:#000; }
html[data-smc-theme="full-white"] { color-scheme:light; --page:#fff; --panel:#fff; --panel-2:#f7f7f7; --line:#222; --text:#000; --muted:#333; --accent:#000; --ok:#000; --warn:#000; --bad:#000; --shadow:none; }
html[data-smc-theme="full-white"] .module-header,html[data-smc-theme="full-white"] th { background:#fff; }
html[data-smc-theme="full-white"] .filters select,html[data-smc-theme="full-white"] .filters input,html[data-smc-theme="full-white"] .range-control button,html[data-smc-theme="full-white"] .pager button { background:#fff; color:#000; }
html[data-smc-theme="full-white"] .range-control button.active,html[data-smc-theme="full-white"] .primary-action { background:#000; color:#fff; }

@media (max-width:1050px) {
  .filters { grid-template-columns:1fr 2fr auto; }
  .custom-field { grid-row:2; }
  .fleet-summary { grid-template-columns:1fr; }
}
@media (max-width:720px) {
  .module-header { align-items:flex-start; flex-direction:column; }
  .module-header h1 { font-size:24px; }
  .archive-band { grid-template-columns:1fr 1fr; }
  .archive-band div:nth-child(2) { border-right:0; }
  .archive-band div:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .filters { grid-template-columns:1fr; }
  .range-control { width:100%; overflow:auto; }
  .range-control button { flex:1 0 54px; }
  .custom-field { grid-row:auto; }
  .primary-action { width:100%; }
}
