/* Granite GWP admin console — plain internal-tool styling.
   Deliberately NOT the customer Macy's/brand theme: neutral slate + one accent. */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --err: #b91c1c;
  --warn-bg: #fef3c7;
  --warn-ink: #92400e;
}
* { box-sizing: border-box; }
/* Make the [hidden] attribute authoritative — otherwise `display:flex/grid`
   rules (e.g. .login-wrap) override it and show()/hide() silently fails. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  background: var(--surface);
  width: 100%;
  max-width: 380px;
  padding: 28px 26px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.login-card h1 { font-size: 20px; margin: 0 0 6px; }

/* ---------- Top bar / tabs ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  height: 56px;
}
.brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand-sub { color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.tab:hover { background: var(--bg); color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); background: #eff6ff; }
.account { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 13px; }

/* ---------- Banner ---------- */
.banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 10px 20px;
  font-size: 13px;
  border-bottom: 1px solid #fde68a;
}
.banner code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 3px; }

/* ---------- Content / panels ---------- */
.content { max-width: 820px; margin: 0 auto; padding: 24px 20px 60px; }
.panel h2 { font-size: 18px; margin: 0 0 4px; }
.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 16px;
}
.block h3 { font-size: 14px; margin: 0 0 12px; }

/* ---------- Forms ---------- */
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 180px; }
.grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 12px; align-items: center; }
.grid .btn, .grid .check, .grid .field-inline { grid-column: 2; justify-self: stretch; }
.grid textarea { grid-column: 2; }
.grid .btn { justify-self: start; }
.field-inline { display: flex; gap: 8px; align-items: center; }
.field-inline input { flex: 1; }
.field-inline .btn-secondary { white-space: nowrap; }
label { font-size: 13px; font-weight: 600; color: var(--ink); }
.login-card label { display: block; margin: 14px 0 5px; }
input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* ---------- Work queue list ---------- */
.queue { list-style: none; margin: 12px 0 0; padding: 0; }
.queue:empty { display: none; }
.queue-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  background: #fff;
  font-size: 13px;
}
.queue-item:hover, .queue-item:focus {
  background: #eff6ff;
  border-color: var(--accent);
  outline: none;
}

/* ---------- Duplicate warning ---------- */
.dupe-warn {
  color: var(--warn-ink);
  background: var(--warn-bg);
  border: 1px solid #fde68a;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.dupe-warn[hidden] { display: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }

/* ---------- Buttons ---------- */
.btn, .btn-secondary, .login-card button {
  appearance: none;
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn, .login-card button { background: var(--accent); color: var(--accent-ink); }
.login-card button { width: 100%; margin-top: 22px; }
.btn:hover, .login-card button:hover { filter: brightness(0.95); }
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--bg); }
button:disabled { opacity: 0.55; cursor: default; filter: none; }

.denoms { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Output ---------- */
.out {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 6px;
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 12px 0 0;
  max-height: 320px;
  overflow: auto;
}
.out:empty { display: none; }
.out.inline { margin: 0; max-height: 160px; }
.summary { margin-top: 12px; }
.summary dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.summary dt { color: var(--muted); font-weight: 600; }
.summary dd { margin: 0; }

/* ---------- CS search results ---------- */
.cs-results { margin-top: 12px; max-height: 260px; overflow-y: auto; border: 1px solid #e0e3e8; border-radius: 6px; }
.cs-results table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cs-results th, .cs-results td { border-bottom: 1px solid #eef0f3; padding: 6px 10px; text-align: left; }
.cs-results th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: #fff; }
.cs-results .cs-hit { cursor: pointer; }
.cs-results .cs-hit:hover { background: #f4f6f9; }
.cs-results .cs-hit.selected { background: #e8f0fe; }
.cs-results .cs-pending { font-size: 11.5px; font-weight: 700; color: #856404; background: #fff3cd; border-radius: 10px; padding: 2px 9px; }
.cs-results .hint { color: var(--muted); font-size: 12px; margin: 6px 10px; }
input[readonly] { background: #f4f6f9; color: var(--muted); cursor: default; }

/* ---------- Messages ---------- */
.lead { color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.fine { color: var(--muted); font-size: 12px; margin-top: 10px; }
.message { font-size: 13px; margin-top: 12px; min-height: 18px; }
.message.error { color: var(--err); }
.message.ok { color: var(--ok); }

/* ---------- MFA: login step-cards + Security modal ---------- */
/* QR image is a self-contained data-URI GIF from vendor/qrcode-generator.js. */
.mfa-qr { display: flex; justify-content: center; margin: 6px 0 10px; }
.mfa-qr img {
  display: block;
  width: 180px;
  height: 180px;
  image-rendering: pixelated; /* keep the QR modules crisp when scaled */
  border: 1px solid var(--line);
  border-radius: 6px;
}
.mfa-secret {
  display: block;
  user-select: all; /* one click selects the whole key for copying */
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 13px;
  letter-spacing: 1px;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0;
  color: var(--ink);
}
.mfa-on { color: var(--ok); font-weight: 600; margin: 0 0 6px; }
/* Secondary "Back to sign in" control inside a login card. Scoped selector so it
   beats the `.login-card button` primary-button rules (specificity). */
.login-card .linklike {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  width: auto;
  display: block;
  margin: 12px auto 0;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.login-card .linklike:hover { text-decoration: underline; filter: none; background: transparent; }

/* ---------- Modal (Security enrollment) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.modal-card {
  position: relative;
  background: var(--surface);
  width: 100%;
  max-width: 380px;
  padding: 20px 22px 22px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.25);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.modal-close:hover { color: var(--ink); }
.modal-card label { display: block; margin: 12px 0 5px; }
.modal-card .btn { width: 100%; margin-top: 12px; }
