/* RadarFleet, a Genesis Technologies company. Brand: charcoal #1A1D22, RadarFleet orange #FC7204, steel #656970.
   --accent = brand highlight (orange); --red = alarms, warnings and destructive actions only.
   (The --navy* variable names are kept from v0.1 so the rest of the stylesheet is unchanged; they now hold charcoal.) */
:root {
  --navy: #1A1D22;
  --navy-2: #2C3038;
  --navy-ink: #0F1114;
  --steel: #656970;
  --steel-light: #B9BDC4;
  --accent: #FC7204;
  --accent-dark: #C85800;
  --accent-tint: #FFF1E5;
  --red: #E30B12;
  --red-dark: #B5080D;
  --amber: #f2a900;
  --green: #1f9d55;
  --bg: #eff0f2;
  --panel: #ffffff;
  --line: #dcdee2;
  --ink: #16181c;
  --muted: #646973;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.4 "Barlow", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- top bar */
.topbar {
  z-index: 1500;
  height: 58px; display: flex; align-items: center; gap: 24px; padding: 0 18px;
  background: var(--navy); color: #fff; position: relative;
}
.topbar::after { /* red swoosh rule, echoing the logo */
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
  background: linear-gradient(90deg, transparent 0, var(--accent) 12%, var(--accent) 100%);
  clip-path: polygon(0 100%, 12% 0, 100% 0, 99% 100%);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 32px; display: block; }
@media (max-width: 1100px) { .tagline { display: none; } }
.tagline { font-size: 10px; letter-spacing: .9px; text-transform: uppercase; color: var(--steel-light); line-height: 1.25;
  padding-left: 12px; border-left: 1px solid rgba(255,255,255,.22); white-space: nowrap; }
.fleet-stats { display: flex; gap: 18px; margin-left: 12px; font-family: var(--cond); font-size: 16px; }
.fleet-stats b { font-size: 20px; margin-right: 4px; }
.fleet-stats .s-alarm b { color: #ff6b6e; }
.who { margin-left: auto; }

/* ---------- layout */
.layout { display: grid; grid-template-columns: 290px 1fr 470px; height: calc(100% - 58px); padding-top: 4px; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.sidebar-head { padding: 12px; border-bottom: 1px solid var(--line); }
.sidebar-head input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f7f8fb; }
.filters { display: flex; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.sign-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.sign-list li {
  padding: 10px 12px 10px 14px; border-bottom: 1px solid #eeeff1; cursor: pointer; display: grid;
  grid-template-columns: 12px 1fr auto; gap: 4px 10px; align-items: center; border-left: 4px solid transparent;
}
.sign-list li:hover { background: #f5f5f6; }
.sign-list li.sel { background: var(--accent-tint); border-left-color: var(--accent); }
.sign-list .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sign-list .meta { grid-column: 2 / 4; color: var(--muted); font-size: 12px; display: flex; gap: 10px; }
.sign-list .lim {
  font-family: var(--cond); font-weight: 700; font-size: 15px; border: 2px solid var(--ink); border-radius: 4px;
  padding: 0 5px; line-height: 18px; background: #fff;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #b5bacb; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(31,157,85,.18); }
.dot.alarm { background: var(--red); box-shadow: 0 0 0 3px rgba(232,2,7,.18); }
.unmatched { border-top: 1px solid var(--line); padding: 10px 12px; font-size: 12px; color: var(--muted); }
.unmatched:empty { display: none; }
.unmatched code { font-family: var(--mono); color: var(--ink); }

.mapwrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.pin {
  width: 34px; height: 34px; border-radius: 6px; background: #111; color: #ffd23f; border: 3px solid #fff;
  display: grid; place-items: center; font-family: var(--cond); font-weight: 700; font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.pin.off { color: #888; background: #444; }
.pin.alarm { border-color: var(--red); }
.pin.sel { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- detail panel */
.detail { background: var(--panel); border-left: 1px solid var(--line); overflow: auto; min-height: 0; }
.empty { height: 100%; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-mark { width: 120px; height: 10px; margin: 0 auto 14px; background: var(--accent); clip-path: polygon(0 100%, 18% 0, 100% 0, 92% 100%); }
.d-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.d-title { display: flex; align-items: center; gap: 10px; }
.d-title h2 { margin: 0; font-family: var(--cond); font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.d-sub { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.badge.on { background: #e3f5ea; color: #13703b; }
.badge.off { background: #eceef3; color: var(--muted); }
.badge.busy { background: #fff3d6; color: #8a5a00; }
.alarm-bar { margin: 10px 0 0; padding: 8px 10px; background: #fde8e8; color: var(--red-dark); border-left: 4px solid var(--red); font-weight: 600; font-size: 13px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 10px; position: sticky; top: 0; background: #fff; z-index: 5; }
.tabs button { border: 0; background: none; padding: 11px 10px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--accent); }
.tab-body { padding: 16px 18px 30px; }

/* the sign face: mimic an LED radar sign */
.sign-face { display: flex; gap: 14px; align-items: stretch; margin-bottom: 16px; }
.mutcd {
  width: 108px; background: #fff; border: 3px solid #111; border-radius: 8px; text-align: center; padding: 6px 4px;
  font-family: var(--cond); font-weight: 700; line-height: 1; color: #111;
}
.mutcd .t { font-size: 15px; }
.mutcd .v { font-size: 46px; margin-top: 4px; }
.led {
  flex: 1; background: #0b0b0b; border-radius: 8px; display: grid; place-items: center; position: relative;
  border: 3px solid #222; min-height: 110px;
}
.led .digits { font-family: var(--cond); font-weight: 700; font-size: 64px; color: #ffb000; text-shadow: 0 0 14px rgba(255,176,0,.55); letter-spacing: 4px; }
.led .digits.red { color: #ff2a2a; text-shadow: 0 0 14px rgba(255,42,42,.55); }
.led .digits.dim { color: #333; text-shadow: none; }
.led .cap { position: absolute; bottom: 6px; left: 10px; font-size: 11px; color: #9a9a9a; text-transform: uppercase; letter-spacing: .6px; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv div { background: #f5f6f7; border-radius: 6px; padding: 8px 10px; }
.kv span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kv b { font-size: 16px; font-weight: 600; }
.kv b.warn { color: var(--red); }

h3 { font-family: var(--cond); font-size: 17px; text-transform: uppercase; letter-spacing: .5px; color: var(--navy); margin: 20px 0 8px; }
h3:first-child { margin-top: 0; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 12px; font-weight: 600; color: var(--ink); }
.btn:hover { border-color: var(--navy); }
a.btn { text-decoration: none; display: inline-block; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.modes .btn { padding: 9px 6px; font-size: 13px; }
.modes .btn.cur { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-dark); }

.form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; align-items: end; }
.form label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; display: flex; flex-direction: column; gap: 3px; }
.form input, .form select, textarea, .console input {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; background: #fff; text-transform: none; letter-spacing: 0;
}
.form .wide { grid-column: span 3; }
.form .w2 { grid-column: span 2; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.hint code, code.cmd { font-family: var(--mono); font-size: 12px; background: #f1f2f4; padding: 1px 5px; border-radius: 4px; color: var(--navy); }

textarea { width: 100%; min-height: 120px; font-family: var(--mono); font-size: 12px; }
pre.out {
  background: #16181c; color: #e4e6ea; font-family: var(--mono); font-size: 12px; padding: 10px 12px; border-radius: 6px;
  white-space: pre-wrap; max-height: 360px; overflow: auto; margin: 8px 0 0;
}
.console { display: flex; gap: 6px; }
.console .pfx { font-family: var(--mono); padding: 7px 0 0; color: var(--muted); }
.console input { flex: 1; font-family: var(--mono); }

.chart { width: 100%; height: 170px; display: block; }
.chart .bar { fill: var(--navy); }
.chart .bar.hi { fill: var(--red); }
.chart text { font-size: 10px; fill: var(--muted); font-family: "Barlow", sans-serif; }
.chart .ax { stroke: var(--line); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 5px 4px; }
table.tbl td { border-bottom: 1px solid #f0f1f5; padding: 5px 4px; vertical-align: top; }
table.tbl td.mono { font-family: var(--mono); font-size: 11px; }
.ok { color: var(--green); } .bad { color: var(--red); }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 6px; border-left: 4px solid var(--accent); transition: transform .25s; z-index: 1000; max-width: 70vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red-dark); border-left-color: #fff; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- login */
.login-body { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #2C3038 0%, #121417 70%); position: relative; overflow: hidden; }
.login-body::before { content: ""; position: absolute; left: -10%; right: -10%; top: 62%; height: 26px; background: var(--accent); transform: skewY(-3deg); }
.login-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.login-brand { width: 340px; max-width: 80vw; display: block; }
.login-tag { color: var(--steel-light); font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; margin-top: -12px; }
.login-card { position: relative; background: #fff; width: 340px; padding: 30px 28px; border-radius: 10px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }

.login-title { font-family: var(--cond); font-weight: 700; font-size: 26px; text-align: center; color: var(--navy); line-height: 1; }
.login-sub { text-align: center; color: var(--muted); margin-top: -6px; margin-bottom: 4px; font-size: 13px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 2px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.login-card input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 15px; }
.login-card .btn { padding: 10px; margin-top: 6px; }
.err { color: var(--red); margin: 0; font-weight: 600; text-align: center; }

@media (max-width: 1200px) { .layout { grid-template-columns: 250px 1fr 420px; } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 220px 300px auto; height: auto; }
  .sidebar { order: 2; } .mapwrap { order: 1; height: 300px; } .detail { order: 3; }
  .page { padding: 16px; }
  .fleet-stats { display: none; }
}

/* ======================= v0.2: navigation, pages, modals ======================= */
.mainnav { display: flex; gap: 2px; margin-left: 8px; align-self: stretch; }
.mainnav a {
  display: flex; align-items: center; padding: 0 14px; color: rgba(255,255,255,.75); text-decoration: none;
  font-family: var(--cond); font-weight: 600; font-size: 17px; letter-spacing: .3px; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.mainnav a:hover { color: #fff; }
.mainnav a.active { color: #fff; border-bottom-color: var(--accent); }
.mainnav a[hidden] { display: none; }
.org-filter {
  background: var(--navy-2); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 5px 8px; max-width: 230px;
}
.who { position: relative; }
.who-btn { background: none; border: 0; color: #fff; opacity: .9; padding: 6px 4px; }
.who-menu {
  position: absolute; right: 0; top: 40px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); min-width: 220px; z-index: 2000; padding: 6px; display: flex; flex-direction: column;
}
.who-menu[hidden] { display: none; }
.who-menu .who-org { padding: 8px 10px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.who-menu button, .who-menu a { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.who-menu button:hover, .who-menu a:hover { background: #f1f2f4; }

.view[hidden] { display: none !important; }
.page { height: calc(100% - 58px); overflow: auto; padding: 24px 28px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0 12px 0 0; font-family: var(--cond); font-size: 30px; color: var(--navy); font-weight: 700; }
.page-head input[type=search] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; width: 280px; background: #fff; }
.page-head .btn.primary { margin-left: auto; }
.grow { flex: 1; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafafb; white-space: nowrap; }
table.grid td { padding: 10px 12px; border-bottom: 1px solid #eeeff1; vertical-align: middle; }
table.grid tbody tr:hover { background: #f7f7f8; cursor: pointer; }
table.grid td.actions { text-align: right; white-space: nowrap; }
table.grid td.actions .btn + .btn { margin-left: 6px; }
table.grid tr.row-off td { color: var(--muted); }
table.grid tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #eceef3; color: var(--muted); vertical-align: 1px; }
.pill.new { background: #fff3d6; color: #8a5a00; }
.pill.staff { background: var(--accent-tint); color: var(--accent-dark); }
.banner { background: #fff8e6; border: 1px solid #f2d48a; border-left: 4px solid var(--amber); padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger-outline { color: var(--red-dark); border-color: #f1b7b8; background: #fff; }
.btn.danger-outline:hover { border-color: var(--red); }
.sign-list li.disabled .nm { color: var(--muted); text-decoration: line-through; }
.sign-list li.none { cursor: default; color: var(--muted); display: block; }
.org-tag { color: var(--navy); font-weight: 600; }

.modal-back { position: fixed; inset: 0; background: rgba(10,11,13,.55); display: grid; place-items: center; z-index: 3000; padding: 20px; }
.modal-back[hidden] { display: none; }
.modal { background: #fff; border-radius: 12px; width: 520px; max-width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; }
.modal.wide { width: 720px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); position: relative; }
.modal-head::after { content: ""; position: absolute; left: 20px; bottom: -2px; width: 70px; height: 3px; background: var(--accent); clip-path: polygon(0 100%, 12% 0, 100% 0, 90% 100%); }
.modal-head h2 { margin: 0; font-family: var(--cond); font-size: 24px; color: var(--navy); }
.modal-head .x { margin-left: auto; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafafb; }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-content: start; }
.form1 { display: grid; gap: 12px; }
.form2 h4 { grid-column: 1 / -1; margin: 10px 0 -4px; font-family: var(--cond); text-transform: uppercase; letter-spacing: .5px; color: var(--navy); font-size: 15px; }
.form2 h4:first-child { margin-top: 0; }
.form2 h4 small, .form2 label small, .form1 label small { text-transform: none; letter-spacing: 0; font-family: "Barlow", sans-serif; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.form2 label, .form1 label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: #3a3e46; }
.form2 input, .form2 select, .form2 textarea, .form1 input { border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; font-weight: 400; background: #fff; }
.form2 input:focus, .form2 select:focus, .form1 input:focus, .form2 textarea:focus { outline: 2px solid rgba(26,29,34,.22); border-color: var(--navy); }
.form2 input:disabled, .form2 select:disabled { background: #f3f4f8; color: var(--muted); }
.form2 textarea { min-height: 0; font-family: inherit; font-size: 14px; }
.form2 .span2 { grid-column: 1 / -1; }
.form2 label.check { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 8px; }
.form2 label.check small { display: block; }
pre.creds { background: #16181c; color: #fff; font-family: var(--mono); padding: 14px 16px; border-radius: 8px; font-size: 14px; line-height: 1.6; border-left: 4px solid var(--accent); }
@media (max-width: 900px) { .form2 { grid-template-columns: 1fr; } .mainnav a { padding: 0 8px; font-size: 15px; } .org-filter { max-width: 140px; } }
table.grid .dot { display: inline-block; vertical-align: middle; }
.form2 { align-items: end; }
.form2 label > small { display: inline; margin-left: 4px; }
.form2 label.check > small { display: block; margin-left: 0; }
.form2 label:not(.check) { display: block; }
.form2 label:not(.check) > input, .form2 label:not(.check) > select, .form2 label:not(.check) > textarea { display: block; width: 100%; margin-top: 5px; }
