:root {
  /* Bright theme — matches the kronospulse.com palette so the two lab sites
   * feel like part of the same family. */
  --bg:        #FFFFFF;
  --panel:     #FFFFFF;
  --panel-2:   #F5FAF7;
  --border:    #E2EBE6;
  --border-2:  #C7D5DA;
  --text:      #1F2A2A;
  --muted:     #6B7785;
  --accent:    #228B22;   /* forest green */
  --accent-2:  #2EC9A1;   /* deep aquamarine */
  --accent-3:  #7FFFD4;   /* aquamarine */
  --danger:    #FF6347;   /* tomato */
  --good:      #228B22;
  --warn:      #E1A11A;
  --shadow-sm: 0 2px 10px rgba(34, 139, 34, 0.08);
  --shadow-md: 0 6px 22px rgba(34, 139, 34, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

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

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms;
  font-family: inherit;
}
button:hover { background: var(--accent-2); }
button.link {
  background: transparent;
  color: var(--accent-2);
  padding: 0;
  font-size: 13px;
}
button.link:hover { background: transparent; text-decoration: underline; }
.inline { display: inline; }

.error {
  background: rgba(224, 108, 108, 0.12);
  color: var(--danger);
  border: 1px solid rgba(224, 108, 108, 0.35);
  padding: 10px 14px;
  border-radius: 6px;
  margin: 12px 0;
}

/* ---- Login page ---- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-md);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; color: var(--accent-2); }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.login-card input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 15px;
}
.login-card input:focus { outline: none; border-color: var(--accent-2); }

/* ---- Topbar ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 600; color: var(--accent-2); }
.topbar .brand a { color: inherit; }
.topbar nav { display: flex; gap: 16px; align-items: center; }

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.container h1 { margin: 0 0 6px; }

.section-title {
  margin: 28px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Main computer card ---- */
.main-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.main-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.main-card-head h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}
.main-card p { margin: 6px 0 16px; }
.main-card-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .main-card-meta { grid-template-columns: 1fr; }
}

.recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  color: var(--text);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-good { background: rgba(34,139,34,0.12); color: var(--good); }
.badge-warn { background: rgba(225,161,26,0.15); color: var(--warn); }
.badge-bad  { background: rgba(255,99,71,0.12); color: var(--danger); }

/* ---- Setup grid (mirrors instrument grid on kronospulse) ---- */
.inst-grid {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.inst-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms, transform 120ms, box-shadow 120ms;
}
.inst-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.inst-card h2 { margin: 0 0 6px; font-size: 17px; color: var(--accent-2); }
.inst-card p  { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.inst-card .open { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ---- Setup detail ---- */
.back { font-size: 13px; }

.timestamp-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  margin: 18px 0 22px;
}
.timestamp-bar .label { color: var(--muted); margin-right: 6px; font-size: 13px; }
.timestamp-bar #age { margin-left: 10px; font-size: 13px; }
.timestamp-bar .actions { display: flex; align-items: center; gap: 16px; }

/* ---- Tile grid ---- */
.tiles-root { display: flex; flex-direction: column; gap: 22px; }

.tile-heading {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  color: inherit;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
  width: 100%;
}
.tile.non-clickable { cursor: default; opacity: 0.9; }

.tile-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tile-value {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  word-break: break-word;
}
.tile-value .unit {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
  font-weight: 400;
}
.tile-open {
  margin-top: auto;
  font-size: 11.5px;
  color: var(--accent-2);
  opacity: 0.75;
}
.tile-open.text-only { color: var(--muted); }
