/* =====================================================================
  Work Hero Engineering Dashboard — shared theme
  Used across all pages (active orders, completed, developers, capacity).
  Page-specific component CSS lives inline in each .html.
  ===================================================================== */

:root {
  --bg: #07090f;
  --bg-panel: #0c1220;
  --bg-row: #0d1426;
  --bg-row-hover: #131c33;
  --border: #1a2440;
  --border-strong: #243057;
  --text: #e4e7ee;
  --text-dim: #6b7a99;
  --text-muted: #44516e;
  --accent: #00d9ff;
  --bull: #00d68f;
  --bull-bg: rgba(0, 214, 143, 0.08);
  --bear: #ff3d71;
  --bear-bg: rgba(255, 61, 113, 0.08);
  --warn: #ffb000;
  --warn-bg: rgba(255, 176, 0, 0.10);
  --today: #ffd700;
  --today-bg: rgba(255, 215, 0, 0.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 20% 0%, rgba(0, 217, 255, 0.04) 0%, transparent 50%),
    radial-gradient(at 80% 100%, rgba(255, 61, 113, 0.04) 0%, transparent 50%);
}
.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
::selection { background: rgba(0, 217, 255, 0.25); color: var(--text); }

/* ----------------------- HEADER (topbar) ----------------------- */
header.topbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12, 18, 32, 0.95) 0%, rgba(7, 9, 15, 0.85) 100%);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
header.topbar .topbar-right { margin-left: auto; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: 0.96; }
.brand .logo { width: 36px; height: 36px; display: block; object-fit: contain; }
.brand .title { font-size: 14px; line-height: 1.1; }
.brand .title .sub { color: var(--text-dim); font-weight: 500; margin-left: 6px; }

nav.topnav {
  display: flex; gap: 4px;
  margin-left: 28px;
  font-family: 'JetBrains Mono', monospace;
}
nav.topnav a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.12s, background 0.12s;
}
nav.topnav a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
nav.topnav a.active {
  color: var(--accent);
  background: rgba(0, 217, 255, 0.08);
}

.topbar-right { display: flex; align-items: center; gap: 22px; }
.session-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-dim); text-align: right;
}
.session-meta .clock {
  color: var(--text); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
}
.session-meta.last-update {
  padding-right: 14px; margin-right: -8px;
  border-right: 1px solid var(--border);
}
.session-meta.last-update .lbl {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.session-meta.last-update .val-row {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}
.session-meta.last-update .val {
  color: var(--text); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  white-space: nowrap;
}
.session-meta.last-update .val .tz { color: var(--text-dim); font-weight: 500; margin-left: 4px; }
.info-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  line-height: 1;
  transition: all 0.12s ease;
}
.info-trigger:hover {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--warn-bg);
}
.live-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--bull);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--bull);
  background: var(--bull-bg);
}
.live-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bull);
  box-shadow: 0 0 8px var(--bull);
  animation: pulse 1.6s ease-in-out infinite;
}
.live-pill.demo { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
.live-pill.demo .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ----------------------- PAGE INFO MODAL ----------------------- */
.page-info-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 8, 14, 0.8);
  backdrop-filter: blur(6px);
  z-index: 60;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.page-info-overlay.show { display: flex; }
.page-info-modal {
  width: min(760px, 100%);
  max-height: min(82vh, 900px);
  overflow: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  padding: 18px 20px 18px;
}
.page-info-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 14px;
}
.page-info-title {
  font: 700 18px/1.3 'Inter', sans-serif;
  color: var(--text);
}
.page-info-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font: 11px/1.4 'JetBrains Mono', monospace;
}
.page-info-close {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font: 600 11px 'JetBrains Mono', monospace;
}
.page-info-body {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.65;
}
.page-info-body p { margin-bottom: 12px; }
.page-info-body h4 {
  margin: 14px 0 8px;
  color: var(--text);
  font: 700 12px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-info-body ul {
  margin: 0 0 10px 18px;
  padding: 0;
}
.page-info-body li { margin: 0 0 6px; }
.page-info-body b { color: var(--text); }

/* ----------------------- LAYOUT / PANELS ----------------------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  padding: 14px 22px;
  max-width: 1600px;
  margin: 0 auto;
}
@media (max-width: 1080px) {
  .grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}
.panel-head .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
}
.panel-head .label strong { color: var(--text); }

/* ----------------------- FOOTER (status bar) ----------------------- */
footer.statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 22px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.06em;
}
footer .right { display: flex; gap: 18px; }
footer .right span b { color: var(--text-dim); }

/* ----------------------- LOCAL-PREVIEW AUTH GATE ----------------------- */
#auth-overlay {
  position: fixed; inset: 0;
  background: rgba(7, 9, 15, 0.97);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
}
#auth-overlay.show { display: flex; }
#auth-overlay .box {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 28px 30px; width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
#auth-overlay h2 {
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
  letter-spacing: 0.12em; margin-bottom: 6px;
}
#auth-overlay p { color: var(--text-dim); font-size: 11px; margin-bottom: 18px; }
#auth-overlay label {
  display: block; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; color: var(--text-muted); margin: 10px 0 4px;
}
#auth-overlay input {
  width: 100%; padding: 9px 10px;
  background: var(--bg-row); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
#auth-overlay input:focus { outline: none; border-color: var(--accent); }
#auth-overlay button {
  width: 100%; margin-top: 16px; padding: 10px;
  background: var(--accent); color: #07090f;
  border: none; border-radius: 4px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  letter-spacing: 0.1em; font-size: 12px;
}
#auth-overlay .err { color: var(--bear); font-size: 11px; margin-top: 10px; min-height: 14px; }

/* ----------------------- COMMON UTILITIES ----------------------- */
.empty-section {
  padding: 14px 16px; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); font-style: italic;
  letter-spacing: 0.05em;
}
.tag-chip {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
