/* EA Guard — instrument panel
 *
 * The audience is one person who opens this to answer two questions: is
 * anything wrong, and what do I do about it. So the visual job is legibility of
 * state, not persuasion. Data sits in flat tables with hairline rules; the only
 * saturated colour is the amber used for the thing that needs a decision.
 *
 * Green and red are reserved for status so they always mean the same thing.
 * Nothing else in the interface may use them.
 */

:root {
  --ink:        #0E1621;
  --panel:      #16202C;
  --panel-hi:   #1C2836;
  --line:       #24313F;
  --line-soft:  #1D2836;

  --text:       #C9D6E2;
  --text-hi:    #EDF3F8;
  --muted:      #7A8B9C;

  --amber:      #E8A33D;
  --amber-dim:  #8A6224;

  --ok:         #4BB07A;
  --warn:       #D9A441;
  --bad:        #D8574B;

  --sidebar-w:  232px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.num, td.num, .stat-value, code, .mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

#sb {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 8px 22px;
  color: var(--text-hi);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(75,176,122,.15);
  align-self: center;
}

.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  border-left: 2px solid transparent;
}
.nav a:hover { background: var(--panel-hi); color: var(--text); }
.nav a.on {
  background: var(--panel-hi);
  color: var(--text-hi);
  border-left-color: var(--amber);
}
.nav a i { width: 17px; font-size: 14px; opacity: .85; }
.nav .spacer { flex: 1; }
.nav a.leave { color: #9A6660; }
.nav a.leave:hover { color: var(--bad); }

#main { margin-left: var(--sidebar-w); padding: 28px 34px 60px; max-width: 1500px; }

h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-hi);
}
.lede { margin: 0 0 26px; color: var(--muted); max-width: 66ch; }

h2 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--text-hi); }

.status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: 3px;
  margin-bottom: 26px;
}
.status.attention { border-left-color: var(--amber); }
.status .lamp {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ok); flex: none;
  box-shadow: 0 0 0 4px rgba(75,176,122,.14);
}
.status.attention .lamp {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(232,163,61,.16);
}
.status .headline { font-size: 15px; color: var(--text-hi); }
.status .detail { color: var(--muted); font-size: 13px; }

.readings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  margin-bottom: 26px;
}
.reading { padding: 15px 18px; border-right: 1px solid var(--line-soft); }
.reading:last-child { border-right: 0; }
.reading .label { color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.stat-value { font-size: 25px; color: var(--text-hi); line-height: 1.15; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.panel > h2 { margin-bottom: 4px; }
.panel > .note { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1050px) { .split { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--muted);
  padding: 0 10px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.016); }
td.right, th.right { text-align: right; }
.key { color: var(--text-hi); font-weight: 500; }

.empty { color: var(--muted); padding: 8px 2px; }

.state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.state.ok::before   { background: var(--ok); }
.state.bad::before  { background: var(--bad); }
.state.warn::before { background: var(--warn); }
.state.off::before  { background: var(--muted); }
.state.bad  { color: #E48A80; }
.state.warn { color: var(--warn); }
.state.off  { color: var(--muted); }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 12px;
  color: var(--muted);
}
.tag.manual { border-color: var(--amber-dim); color: var(--amber); }

code {
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  padding: 1px 5px;
  border-radius: 3px;
}

label { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 5px; }

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=file], select, .inp {
  width: 100%;
  padding: 8px 10px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 2px rgba(232,163,61,.1);
}
input::placeholder { color: #55677A; }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1 1 150px; }
.row > div.narrow { flex: 0 0 130px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-hi);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: #33455A; color: var(--text-hi); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.btn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1A1206;
  font-weight: 600;
}
.btn.primary:hover { background: #F0B055; border-color: #F0B055; }

.btn.icon { padding: 6px 9px; }
.btn.danger:hover { border-color: #6E3831; color: #E48A80; }
.btn.on { border-color: #2E5B47; color: var(--ok); }

.actions { display: flex; gap: 5px; justify-content: flex-end; }
.actions form { display: inline; }

/* ---------------------------------------------------------------- sign in
 * No floating card. A card in an empty viewport is the default shape of every
 * SaaS login and says nothing about what is behind the door. Instead: a narrow
 * left-aligned column with the machine's own hostname under the wordmark, so
 * you can see at a glance which server you are about to open — and a phishing
 * copy would have to get that wrong.
 */

.signin {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 40px 8vw;
  max-width: 640px;
}

.signin .mark {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-hi);
  line-height: 1;
}
.signin .host {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.signin form {
  width: 100%;
  max-width: 310px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.signin .field + .field { margin-top: 16px; }
.signin .go { margin-top: 24px; }

.hint { color: var(--muted); font-size: 12.5px; margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 780px) {
  #sb { position: static; width: auto; flex-direction: row; flex-wrap: wrap; }
  #sb .nav { flex-direction: row; flex-wrap: wrap; }
  #main { margin-left: 0; padding: 20px 16px 50px; }
}
