:root {
  --bg: #f4f6f8; --panel: #fff; --line: #dde3ea; --text: #1d2733; --muted: #6b7a8c;
  --accent: #0b5fff; --accent-2: #e8f0ff; --warn-bg: #fff6e0; --warn: #8a5a00; --bad: #c0392b; --ok: #1e8e3e;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: baseline; gap: 16px; padding: 10px 18px; background: #111b2b; color: #fff; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.brand span { color: #6fa3ff; }
.topbar .meta { color: #b9c5d6; font-size: 12px; }

.layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; padding: 14px; height: calc(100vh - 44px); }
.side { display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; position: relative; }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.links { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
input[type=search] { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.dropdown { position: absolute; left: 12px; right: 12px; z-index: 10; margin: 2px 0 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 6px; max-height: 260px; overflow: auto; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.dropdown li { padding: 7px 10px; cursor: pointer; }
.dropdown li:hover { background: var(--accent-2); }
.dropdown .id { color: var(--muted); font-size: 12px; margin-left: 6px; }
.selected { margin-top: 8px; padding: 8px 10px; background: var(--accent-2); border-radius: 6px; font-weight: 600; display: flex; justify-content: space-between; }
.selected a { font-weight: 400; font-size: 12px; }

.vessels { list-style: none; margin: 8px 0 0; padding: 0; max-height: 40vh; overflow: auto; }
.vessels li { display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; align-items: center; padding: 5px 4px; border-top: 1px solid #eef2f6; font-size: 13px; }
.vessels li .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vessels li .imo { color: var(--muted); font-size: 11px; }
.vessels li .st { font-size: 11px; color: var(--muted); text-align: right; }
.vessels li .st.ok { color: var(--ok); }
.vessels li .st.no { color: var(--warn); }
.vessels li.inactive .name { color: var(--muted); font-style: italic; }

.btn { font: inherit; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; margin-right: 6px; }
.btn:hover { background: #f1f4f8; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #094fd6; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.chk { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.job { margin-top: 10px; }
.bar { height: 6px; background: #e6ebf1; border-radius: 3px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.main { display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); background: #fafbfc; overflow-x: auto; }
.tabs button { font: inherit; border: 1px solid transparent; border-bottom: none; background: transparent; padding: 8px 12px; border-radius: 6px 6px 0 0; cursor: pointer; white-space: nowrap; color: var(--muted); }
.tabs button .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: #e6ebf1; font-size: 11px; color: var(--text); }
.tabs button .n.bad { background: #fde8e6; color: var(--bad); }
.tabs button.active { background: #fff; border-color: var(--line); color: var(--text); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.toolbar input { width: 260px; }
.spacer { flex: 1; }
.warn { margin: 8px 10px 0; padding: 8px 10px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; font-size: 13px; }
.tablewrap { overflow: auto; flex: 1; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 8px; border-bottom: 1px solid #eef2f6; text-align: left; white-space: nowrap; vertical-align: top; }
th { position: sticky; top: 0; background: #f7f9fb; cursor: pointer; user-select: none; font-weight: 600; }
th.sorted::after { content: " ▲"; font-size: 10px; color: var(--muted); }
th.sorted.desc::after { content: " ▼"; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td .bad { color: var(--bad); font-weight: 600; }
td .ok { color: var(--ok); }
tr:hover td { background: #fbfcfe; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.period { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.period input[type=date] { font: inherit; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; width: 128px; }

[hidden] { display: none !important; }

/* oturum kutusu (topbar sağı) */
.userbox { margin-left: auto; color: #b9c5d6; font-size: 12px; display: flex; align-items: baseline; gap: 10px; }
.userbox .uname { color: #fff; font-weight: 600; }
.userbox a { color: #6fa3ff; text-decoration: none; }
.userbox a:hover { text-decoration: underline; }
