/* Band Tracker — manufacturing-optimised palette: readable at distance,
   strong status signal, sufficient contrast under varied lighting */

:root {
  --bg:        #f4f3ef;      /* warm off-white page background */
  --surface:   #ffffff;
  --ink:       #111827;      /* near-black — stronger than #18181b at distance */
  --muted:     #4b5563;      /* was #6b7280 — darker so secondary text is still readable */
  --border:    #d1d0cb;      /* slightly stronger border */
  --rule:      #c4c2ba;

  --pass:      #166534;      /* slightly deeper green for legibility */
  --fail:      #991b1b;      /* slightly deeper red */
  --pending:   #92400e;      /* amber */
  --ready:     #1e40af;
  --accent:    #1e293b;

  --shadow:    0 1px 0 rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
  --radius:    4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 2rem;
  background: var(--accent);
  color: #f4f3ee;
  border-bottom: 3px solid #0f172a;
  width: 100%;
  box-sizing: border-box;
}
header.bar .brand {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.88rem;       /* was 0.85 */
}
header.bar nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  margin-right: 1rem;
}
header.bar nav a:hover { color: #ffffff; }
header.bar .user {
  margin-left: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;       /* was 0.8 */
  color: #94a3b8;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}
h1 .meta { color: var(--muted); font-weight: 400; font-size: 1rem; }
h2 {
  font-size: 0.82rem;        /* was 0.78 */
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #374151;            /* was var(--muted) — darker, more visible section label */
  margin: 2rem 0 0.75rem;
  font-weight: 600;          /* was 500 */
}
.subtitle { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.92rem; }

.mono { font-family: "IBM Plex Mono", monospace; }

/* ── Toast notifications ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
  pointer-events: none;   /* let clicks pass through the gap between toasts */
}
.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.10);
  font-size: 0.88rem;
  max-width: 360px;
  min-width: 220px;
  line-height: 1.45;
  border-left: 4px solid transparent;
  animation: toast-in 0.2s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.toast-ok      { background: #f0fdf4; border-color: #16a34a; color: #14532d; }
.toast.toast-error   { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }
.toast.toast-warning { background: #fefce8; border-color: #ca8a04; color: #713f12; }
.toast.toast-info    { background: #eef2ff; border-color: #1e40af; color: #1e3a8a; }
.toast .toast-msg    { flex: 1; }
.toast .toast-close  {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.55;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  font-weight: 400;
}
.toast .toast-close:hover { opacity: 1; background: transparent; }
.toast.toast-hiding {
  opacity: 0;
  transform: translateX(1rem);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(1rem); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Compact pill variant used in tracker table status cells */
.pill-tracker {
  font-size: 0.62rem;
}
.flash {
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--ready);
  background: #eef2ff;
  font-size: 0.92rem;
}
.flash.error   { background: #fef2f2; border-color: var(--fail); color: #7f1d1d; }
.flash.ok      { background: #f0fdf4; border-color: var(--pass); color: #14532d; }
.flash.warning { background: #fefce8; border-color: #ca8a04;     color: #713f12; }

/* ── Cards / counts ──────────────────────────────────────────────────────── */
.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.count {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
.count .label {
  font-size: 0.78rem;        /* was 0.72 — raised floor */
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.count .value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.7rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td {
  text-align: left;
  padding: 0.55rem 0.85rem;  /* td row height slightly increased */
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  background: #eeedea;       /* stronger header tint than #fafaf7 */
  font-weight: 700;
  font-size: 0.78rem;        /* was 0.72 — raised floor */
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #374151;            /* was var(--muted) — darker for legibility */
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f0efe8; }

td.serial, td.sector, .mono-cell {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;         /* was 0.88 */
}

/* Sector group rule */
tr.sector-group-start td {
  border-top: 2px solid var(--rule);
}

/* ── Status pills ────────────────────────────────────────────────────────── */
/* Solid background pills — more readable at distance and under bright light */
.status {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  font-size: 0.78rem;        /* was 0.72 */
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
}
.status.pass     { background: #dcfce7; color: #14532d; }
.status.fail     { background: #fee2e2; color: #7f1d1d; }
.status.ready    { background: #dbeafe; color: #1e3a8a; }
.status.assigned { background: #e2e8f0; color: #1e293b; }
.status.untested,
.status.empty    { background: #f3f4f6; color: #4b5563; }
.status.failed   { background: #fee2e2; color: #7f1d1d; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
form.stack { display: flex; flex-direction: column; gap: 0.9rem; max-width: 480px; }
form.inline { display: inline-flex; gap: 0.35rem; align-items: center; }
label {
  display: block;
  font-size: 0.78rem;        /* was 0.75 */
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
  font-weight: 600;
}
input[type="text"], input[type="search"], select, textarea {
  font-family: inherit;
  font-size: 0.92rem;        /* was 0.9 */
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
input.mono { font-family: "IBM Plex Mono", monospace; }
textarea { min-height: 80px; resize: vertical; }
button, .btn {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.88rem;        /* was 0.85 */
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: #0f172a; }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;        /* was 0.78 */
  font-weight: 500;
}
button.ghost:hover { background: #eeedea; color: var(--ink); }
button.danger { background: var(--fail); }

/* Inline assign form inside table cells */
td .inline input { width: 130px; padding: 0.3rem 0.4rem; font-size: 0.88rem; }
td .inline button { padding: 0.3rem 0.6rem; font-size: 0.82rem; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}
.toolbar .search { flex: 1; max-width: 360px; }

/* Progress dot for batch fill */
.progress {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;        /* was 0.78 */
  color: var(--muted);
  margin-left: 0.5rem;
}

.empty-row td {
  color: var(--muted);
  font-style: italic;
}

/* Small divider line above sector type groups */
.sector-label {
  display: inline-block;
  padding: 0 0.4rem;
  background: #dbeafe;
  color: #1e3a8a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;        /* was 0.72 */
  font-weight: 600;
  border-radius: 2px;
}
