/* Bluefields Gas — one stylesheet for all three screens.
   Dark by default: this app is used at night, by someone whose eyes are adjusted. */

:root {
  --bg: #12161b;
  --panel: #1a2029;
  --panel-2: #222a35;
  --line: #2e3846;
  --ink: #e8edf3;
  --ink-dim: #97a3b2;
  --accent: #4da3ff;
  --ok: #3ecf8e;
  --warn: #f5a524;
  --bad: #ff6b6b;
  --crit: #ff3b3b;
  --radius: 14px;
  --tap: 52px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

header.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
header.bar h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: .2px; }
header.bar .spacer { flex: 1; }
header.bar a, header.bar button.link {
  color: var(--ink-dim); text-decoration: none; font-size: 14px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
header.bar a:hover, header.bar button.link:hover { color: var(--ink); }

main { padding: 16px; max-width: 1100px; margin: 0 auto; }

h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em;
     color: var(--ink-dim); margin: 26px 0 10px; font-weight: 600; }
h2:first-child { margin-top: 0; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}

.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 2px; }
.spacer { flex: 1; }

.muted { color: var(--ink-dim); font-size: 13px; }
.tiny { font-size: 12px; color: var(--ink-dim); }

.pct { font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; }
.pct .unit { font-size: 15px; color: var(--ink-dim); font-weight: 500; }

.bar-track { height: 8px; border-radius: 6px; background: var(--panel-2); overflow: hidden; margin-top: 10px; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }
.bar-fill.crit { background: var(--crit); }
/* Where a full tank actually sits. Without it, an 80% bar looks like a tank
   that is 20% short, which is the opposite of the truth. */
.bar-track { position: relative; }
.fill-line { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-dim); opacity: .6; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.pill.ok { background: rgba(62,207,142,.16); color: var(--ok); }
.pill.warn { background: rgba(245,165,36,.16); color: var(--warn); }
.pill.bad { background: rgba(255,107,107,.16); color: var(--bad); }
.pill.crit { background: rgba(255,59,59,.2); color: var(--crit); }
.pill.grey { background: var(--panel-2); color: var(--ink-dim); }

button, .btn {
  font: inherit; font-weight: 600;
  background: var(--accent); color: #06121f; border: 0;
  border-radius: 10px; padding: 12px 16px; min-height: var(--tap);
  cursor: pointer;
}
button.ghost, .btn.ghost {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
}
button.small { min-height: 38px; padding: 8px 12px; font-size: 14px; }
button:disabled { opacity: .45; cursor: default; }

input, select, textarea {
  font: inherit; background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; min-height: var(--tap); width: 100%;
}
label { display: block; font-size: 13px; color: var(--ink-dim); margin: 12px 0 5px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--ink-dim); font-weight: 600; font-size: 12px;
     text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; }
td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
.scroll-x { overflow-x: auto; }

.banner {
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
  font-size: 14px; border: 1px solid;
}
.banner.warn { background: rgba(245,165,36,.1); border-color: rgba(245,165,36,.4); color: #ffd79a; }
.banner.bad { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.4); color: #ffc2c2; }
.banner.info { background: rgba(77,163,255,.1); border-color: rgba(77,163,255,.35); color: #bcdcff; }

.center { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.center .card { width: 100%; max-width: 340px; }

dialog {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; max-width: 520px; width: calc(100% - 32px);
}
dialog::backdrop { background: rgba(0,0,0,.6); }
