* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0b1220;
  color: #d8e0ec;
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: auto 1fr 220px;
  height: 100vh;
}

header {
  background: #0f1a30;
  border-bottom: 1px solid #23304f;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}

header h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.controls {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.controls button {
  background: #1b2847;
  border: 1px solid #2f3e63;
  color: #d8e0ec;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.controls button:hover { background: #253768; }

.controls input[type="number"] {
  width: 56px;
  background: #1b2847;
  border: 1px solid #2f3e63;
  color: #d8e0ec;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 4px;
}

.hint {
  font-size: 11px;
  color: #8896b4;
}

kbd {
  background: #1b2847;
  border: 1px solid #2f3e63;
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-family: monospace;
}

main {
  display: grid;
  grid-template-columns: 1fr 320px;
  overflow: hidden;
  min-height: 0;
}

#ocean-panel {
  background: #071024;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#ocean {
  max-width: 100%;
  max-height: 100%;
  display: block;
  image-rendering: crisp-edges;
}

#dashboard {
  background: #0f1a30;
  border-left: 1px solid #23304f;
  overflow-y: auto;
  padding: 12px;
}

#dashboard h2 {
  font-size: 12px;
  text-transform: uppercase;
  color: #8896b4;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

#fleet-list { list-style: none; }

.fleet-item {
  background: #0b1428;
  border: 1px solid #23304f;
  border-left-width: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.fleet-item:hover { background: #142042; }
.fleet-item.selected { outline: 1px solid #5a8bff; }
.fleet-item.manual { background: #1a2850; }

.fleet-item .name {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.fleet-item .meta {
  color: #8896b4;
  font-size: 11px;
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
}

.fleet-item.phase-GREEN  { border-left-color: #34d399; }
.fleet-item.phase-YELLOW { border-left-color: #fbbf24; }
.fleet-item.phase-ORANGE { border-left-color: #fb923c; }
.fleet-item.phase-RED    { border-left-color: #ef4444; }

.time-bar {
  height: 5px;
  background: #0b1428;
  border: 1px solid #23304f;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.time-bar > span {
  display: block;
  height: 100%;
  transition: width 0.3s linear;
}

.time-bar.GREEN  > span { background: #34d399; }
.time-bar.YELLOW > span { background: #fbbf24; }
.time-bar.ORANGE > span { background: #fb923c; }
.time-bar.RED    > span { background: #ef4444; }

.badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 4px;
  background: #2f3e63;
}
.badge.warn    { background: #9a7a1a; color: #fff; }
.badge.drossel { background: #c2410c; color: #fff; }
.badge.stop    { background: #b91c1c; color: #fff; }
.badge.manual  { background: #2563eb; color: #fff; }

#console-panel {
  background: #05080f;
  border-top: 1px solid #23304f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.console-header {
  padding: 6px 12px;
  background: #0f1a30;
  border-bottom: 1px solid #23304f;
  font-size: 11px;
  text-transform: uppercase;
  color: #8896b4;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.console-header button {
  background: transparent;
  border: 1px solid #2f3e63;
  color: #8896b4;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
}

#console-log {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 11px;
  line-height: 1.5;
}

.log-line {
  display: grid;
  grid-template-columns: 80px 70px 80px 1fr;
  gap: 8px;
  padding: 1px 0;
  white-space: nowrap;
}

.log-line .ts    { color: #5a6a8a; }
.log-line .lvl   { font-weight: 600; }
.log-line .src   { color: #7aa2ff; }
.log-line .msg   { color: #d8e0ec; white-space: normal; }

.log-line.lvl-INFO  .lvl { color: #60a5fa; }
.log-line.lvl-WARN  .lvl { color: #fbbf24; }
.log-line.lvl-ALARM .lvl { color: #fb923c; }
.log-line.lvl-CRIT  .lvl { color: #ef4444; }
