/* FormCoach Operations. Deliberately plain: this is a diagnostic tool, and
   every pixel spent on decoration is one not spent on density. */

:root {
  --ink: #0f1a15;
  --muted: #6a7873;
  --line: #dbe5df;
  --paper: #f4f7f5;
  --white: #fff;
  --green: #18c95a;
  --green-dark: #07863d;
  --red: #b6392a;
  --red-soft: #fdf2f0;
  --amber: #a76a08;
}

* { box-sizing: border-box; }

/* The `hidden` attribute is only a UA-stylesheet `display: none`, so any class
   here that sets `display` silently defeats it — the sign-in panel and the job
   drawer both did, and the drawer rendered over the page on load. Every screen
   in this app is toggled with `hidden`, so it has to win. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.boot { padding: 48px; color: var(--muted); }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .14em; font-size: 13px; }
.brand em { font-style: normal; color: var(--green-dark); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--green);
  color: #06140b; display: grid; place-items: center; font-size: 11px; letter-spacing: 0;
}

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-card {
  width: min(420px, 100%); background: var(--white); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px; display: flex; flex-direction: column; gap: 14px;
}
.signin-card h1 { font-size: 28px; letter-spacing: -.03em; margin: 8px 0 0; }
.signin-card > p { color: var(--muted); margin: 0; }
.signin-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.signin-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; }
.signin-card input {
  height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--paper);
}
details summary { cursor: pointer; color: var(--green-dark); font-weight: 700; font-size: 13px; }

.primary, .secondary {
  border: 0; border-radius: 11px; height: 46px; font-weight: 800;
}
.primary { background: var(--green); color: #06130a; }
.secondary { background: var(--ink); color: #fff; }
.ghost { border: 1px solid var(--line); background: var(--white); border-radius: 9px; padding: 7px 11px; font-weight: 700; }

.error { color: var(--red); font-size: 13px; margin: 0; }
.error.banner {
  background: var(--red-soft); border: 1px solid #f3ccc4; border-radius: 10px;
  padding: 11px 14px; margin: 0 20px 14px;
}

/* Shell */
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--white); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.tabs { display: flex; gap: 4px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 13px; border-radius: 9px; font-weight: 700;
}
.tabs button.active { background: #e8f7ee; color: var(--green-dark); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.topbar-right select { height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; background: var(--white); }
.who { font-size: 12px; color: var(--muted); }

.tab { padding: 20px; }
h2 { font-size: 15px; letter-spacing: -.01em; margin: 26px 0 10px; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.tile span { font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.tile strong { display: block; font-size: 27px; letter-spacing: -.03em; margin-top: 9px; }
.tile p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.tile.warn strong { color: var(--amber); }
.tile.bad strong { color: var(--red); }

/* Tables */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid #eef2ef; white-space: nowrap; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: #fafbfa; border-top: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f7fbf8; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.pill { font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em; }
.pill.completed { background: #e7f8ed; color: var(--green-dark); }
.pill.failed, .pill.cancelled { background: var(--red-soft); color: var(--red); }
.pill.processing, .pill.queued, .pill.awaiting_upload { background: #fff6e6; color: var(--amber); }
.pill.invalid { background: #fff6e6; color: var(--amber); }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 20; background: rgba(6, 18, 12, .45); display: flex; justify-content: flex-end; }
.drawer-panel { width: min(760px, 100%); background: var(--paper); height: 100%; overflow-y: auto; padding: 20px; }
.drawer-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-panel h2 { margin: 0; font-size: 17px; }
.drawer-panel pre {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; overflow-x: auto; font-size: 12px; line-height: 1.5;
}

@media (max-width: 720px) {
  .topbar { gap: 10px; }
  .topbar-right { width: 100%; }
  .tab { padding: 14px; }
}
