/* ATS Dashboard — final design (Oct 26, 2026)
   Black background, dark grey cards, muted ATS accents used only
   as small pills, severity dots, and key numbers. No gradients,
   no shadows, no neon, no glow. */

:root {
  --bg: #000000;
  --card: #1a1a1c;
  --card-2: #222226;
  --border: #2e2e33;
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --green: #93c64a;
  --orange: #ef792e;
  --yellow: #eeb32c;
  --red: #f26d6d;
  --radius: 16px;
}

* { box-sizing: border-box; }

/* hidden must win over display:flex on .app / .login-view, or the
   sign-in card never hides after a successful login. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input { font: inherit; color: inherit; }

.icon { width: 18px; height: 18px; flex: none; }

/* ---------- App shell: header + viewport-filling grid ---------- */
.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 0 4px;
}

.header-logo { height: 64px; width: auto; display: block; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.signed-in {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.signed-in .icon { color: var(--muted); }

/* Heartbeat: small, unobtrusive */
.heartbeat {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.heartbeat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
.heartbeat.is-stale .heartbeat-dot { background: var(--yellow); }
.heartbeat.is-error .heartbeat-dot { background: var(--red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.btn:hover { background: #2a2a2e; }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn-primary { width: 100%; padding: 11px 16px; }

/* ---------- Grid: 3 columns on wide screens ---------- */
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.col-right {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: none;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
}
.card-title .icon { color: var(--muted); }

.count {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  min-width: 22px;
  text-align: right;
}

.card-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px;
}

.empty {
  color: var(--muted);
  padding: 16px 10px;
  font-size: 14px;
}

/* ---------- Rows (shared) ---------- */
.row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }

.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: break-word; }
.row-meta { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: break-word; }
.row-time { color: var(--muted); font-size: 13px; white-space: nowrap; margin-top: 2px; }

/* Small icon-only action buttons (check-off / dismiss).
   The icon is accompanied by visually hidden label text. */
.row-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: -2px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.row-action:hover { color: var(--text); background: var(--card-2); }
.row-action:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.row-action:disabled { opacity: 0.4; cursor: default; }
.row-action .icon { width: 16px; height: 16px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Priority pills & severity dots ---------- */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}
.pill-urgent { color: var(--red);    background: rgba(242, 109, 109, 0.14); border-color: rgba(242, 109, 109, 0.4); }
.pill-high   { color: var(--orange); background: rgba(239, 121, 46, 0.14);  border-color: rgba(239, 121, 46, 0.4); }
.pill-medium { color: var(--yellow); background: rgba(238, 179, 44, 0.14);  border-color: rgba(238, 179, 44, 0.4); }
.pill-low    { color: var(--green);  background: rgba(147, 198, 74, 0.14);  border-color: rgba(147, 198, 74, 0.4); }

.sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  margin-top: 6px;
}
.sev-urgent { background: var(--red); }
.sev-high   { background: var(--orange); }
.sev-medium { background: var(--yellow); }
.sev-low    { background: var(--green); }

/* ---------- To-Do rows ---------- */
.todo-line { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.todo-line .row-title { flex: 1; min-width: 0; }
.todo-owner { color: var(--muted); font-size: 13px; white-space: nowrap; }
.todo-due { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- Shipments ---------- */
.ship-link { display: block; }
.ship-link:hover .row-title { text-decoration: underline; }
.ship-eta { color: var(--yellow); font-size: 13px; font-weight: 600; white-space: nowrap; margin-top: 2px; }

/* ---------- Login view ---------- */
.login-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo { height: 64px; width: auto; margin-bottom: 16px; }

.login-hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
  text-align: center;
}

.user-picker {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
}
.picker-btn {
  flex: 1;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 4px;
  font-weight: 600;
  cursor: pointer;
}
.picker-btn:hover { background: #2a2a2e; }
.picker-btn.is-selected {
  border-color: var(--green);
  color: var(--green);
}
.picker-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.login-card form { width: 100%; display: flex; flex-direction: column; }

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}
.login-card input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 14px;
  outline: none;
}
.login-card input[type="password"]:focus { border-color: var(--green); }

.form-error {
  color: var(--red);
  font-size: 14px;
  margin: 0 0 14px;
}

/* ---------- Phone layout: single column, stacked ---------- */
@media (max-width: 1023px) {
  .app { height: auto; min-height: 100vh; min-height: 100dvh; }
  .grid { display: flex; flex-direction: column; }
  .col-right { display: contents; }
  .card { min-height: 0; }
  .card-body { overflow-y: visible; }
  .grid > .card, .col-right > .card { flex: none; }

  .topbar { flex-wrap: wrap; }
  .header-logo { height: 56px; }
  .topbar-right { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

  .row-action { width: 40px; height: 40px; }
  .btn { padding: 11px 16px; }
}
