/* AGN Bug Tracker — dark midnight-navy theme (matches the AGN app family). */
:root {
  --bg: #040a1c;
  --bg2: #071230;
  --panel: rgba(10, 22, 52, 0.72);
  --panel-solid: #0a1634;
  --panel-2: #0c1a3d;
  --line: rgba(79, 148, 255, 0.28);
  --line-soft: rgba(79, 148, 255, 0.14);
  --text: #eaf2ff;
  --muted: #9fb2d6;
  --dim: #6f82a8;
  --blue: #2f7df6;
  --blue-2: #1e5fd6;
  --cyan: #5fd4ff;
  --violet: #8b6cff;
  --amber: #f5b53d;
  --green: #34d27b;
  --red: #ff5a67;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Rajdhani', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 70% -10%, rgba(47, 125, 246, 0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(95, 212, 255, 0.08), transparent 55%), var(--bg);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 22px;
  background: rgba(4, 10, 28, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 18px rgba(95, 212, 255, 0.55);
}
.brand-sub {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--cyan);
  text-transform: uppercase;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
}
.nav a:hover { color: var(--text); background: var(--line-soft); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(47, 125, 246, 0.22); }
.top-right { display: flex; align-items: center; gap: 12px; }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.who b { font-size: 13px; }
.who small { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

/* ---- layout ---- */
.app { max-width: 1180px; margin: 0 auto; padding: 26px 22px 80px; }
.loading { color: var(--dim); padding: 60px; text-align: center; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 700; font-size: 30px; margin: 0; letter-spacing: 0.5px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.panel + .panel { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1.6fr 1fr; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---- forms ---- */
label.field { display: block; margin-bottom: 16px; }
label.field > .lab { display: block; font-weight: 600; margin-bottom: 6px; }
label.field > .help { display: block; color: var(--dim); font-size: 13px; margin: -2px 0 7px; }
input[type='text'], input[type='number'], input[type='search'], textarea, select {
  width: 100%;
  background: rgba(4, 10, 28, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 13px;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 125, 246, 0.2); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.err-text { color: var(--red); font-size: 13px; margin-top: 5px; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--red); }

/* radio / choice chips */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(4, 10, 28, 0.4);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.12s;
  user-select: none;
}
.choice:hover { border-color: var(--blue); color: var(--text); }
.choice.sel { background: rgba(47, 125, 246, 0.25); border-color: var(--blue); color: #fff; }
.choice input { display: none; }

/* severity widget */
.sev { display: flex; gap: 8px; }
.sev .choice.sel[data-v='low'] { background: rgba(52, 210, 123, 0.22); border-color: var(--green); }
.sev .choice.sel[data-v='medium'] { background: rgba(245, 181, 61, 0.2); border-color: var(--amber); }
.sev .choice.sel[data-v='high'] { background: rgba(255, 138, 76, 0.2); border-color: #ff8a4c; }
.sev .choice.sel[data-v='critical'] { background: rgba(255, 90, 103, 0.24); border-color: var(--red); }

/* ---- buttons ---- */
.btn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(47, 125, 246, 0.14);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.14s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: rgba(47, 125, 246, 0.26); border-color: var(--blue); }
.btn.primary { background: linear-gradient(180deg, var(--blue), var(--blue-2)); border-color: var(--blue-2); color: #fff; box-shadow: 0 6px 18px rgba(47, 125, 246, 0.35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: rgba(255, 90, 103, 0.16); border-color: rgba(255, 90, 103, 0.5); }
.btn.danger:hover { background: rgba(255, 90, 103, 0.3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

/* ---- badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(4, 10, 28, 0.5);
  color: var(--muted);
  text-transform: capitalize;
}
.badge.sev-low { color: var(--green); border-color: rgba(52, 210, 123, 0.5); }
.badge.sev-medium { color: var(--amber); border-color: rgba(245, 181, 61, 0.5); }
.badge.sev-high { color: #ff8a4c; border-color: rgba(255, 138, 76, 0.5); }
.badge.sev-critical { color: var(--red); border-color: rgba(255, 90, 103, 0.6); background: rgba(255, 90, 103, 0.12); }
.badge.st-new { color: var(--cyan); border-color: rgba(95, 212, 255, 0.5); }
.badge.st-triaged { color: var(--violet); border-color: rgba(139, 108, 255, 0.5); }
.badge.st-in_progress { color: var(--blue); border-color: rgba(47, 125, 246, 0.6); }
.badge.st-need_info { color: var(--amber); border-color: rgba(245, 181, 61, 0.5); }
.badge.st-resolved { color: var(--green); border-color: rgba(52, 210, 123, 0.5); }
.badge.st-closed { color: var(--dim); }
.badge.st-duplicate { color: var(--dim); }
.badge.st-wont_fix { color: var(--dim); }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- report list ---- */
.rlist { display: flex; flex-direction: column; gap: 10px; }
.rcard {
  display: block;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.14s, transform 0.06s;
}
.rcard:hover { border-color: var(--blue); text-decoration: none; transform: translateY(-1px); }
.rcard .rc-top { display: flex; align-items: center; gap: 10px; }
.rcard .rc-ref { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.rcard .rc-title { font-weight: 600; color: var(--text); margin: 4px 0 6px; }
.rcard .rc-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--dim); font-size: 12px; }

/* ---- stats strip ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--panel); }
.stat .n { font-family: var(--display); font-size: 28px; font-weight: 700; }
.stat .k { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* ---- timeline ---- */
.timeline { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.tl { border-left: 2px solid var(--line); padding: 2px 0 2px 16px; position: relative; }
.tl::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.tl.event::before { background: var(--dim); }
.tl.answer::before { background: var(--green); }
.tl .tl-head { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.tl .tl-head b { color: var(--text); }
.tl .tl-time { color: var(--dim); font-size: 12px; }
.tl .tl-body { margin-top: 4px; white-space: pre-wrap; }
.tl.internal { background: rgba(245, 181, 61, 0.06); border-left-color: var(--amber); border-radius: 0 8px 8px 0; padding-right: 10px; }
.tl.internal .tag { color: var(--amber); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

/* ---- system picker ---- */
.picker { position: relative; }
.picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; margin-top: 8px; padding-right: 4px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.picker-item:hover { background: var(--line-soft); }
.picker-item.sel { border-color: var(--blue); background: rgba(47, 125, 246, 0.18); }
.picker-item .pi-name { font-weight: 600; }
.picker-item .pi-cat { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.picker-item .pi-open { margin-left: auto; color: var(--amber); font-size: 12px; }

/* ---- AI assist box ---- */
.ai-box { border: 1px solid rgba(139, 108, 255, 0.4); background: rgba(139, 108, 255, 0.08); border-radius: var(--radius); padding: 18px; }
.ai-box .ai-title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; letter-spacing: 1px; color: var(--violet); margin-bottom: 8px; }
.ai-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.ai-pill.on { color: var(--green); border-color: rgba(52, 210, 123, 0.5); }
.ai-pill.off { color: var(--dim); border-color: var(--line); }
.ai-detected { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: rgba(52, 210, 123, 0.1); border: 1px solid rgba(52, 210, 123, 0.35); font-size: 13px; }

/* ---- table ---- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
table.tbl th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
table.tbl tr:hover td { background: var(--line-soft); }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.active { color: #fff; border-bottom-color: var(--blue); }
.tabs a:hover { color: var(--text); text-decoration: none; }

/* ---- toast ---- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(30px); background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 20px; opacity: 0; transition: all 0.25s; z-index: 60; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); color: #ffd9dc; }
.toast.ok { border-color: var(--green); }

/* ---- misc ---- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14px; }
.kv .k { color: var(--dim); }
.chip-count { font-size: 11px; background: var(--line-soft); padding: 1px 7px; border-radius: 999px; color: var(--muted); }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.center-narrow { max-width: 460px; margin: 8vh auto 0; }
.hidden { display: none !important; }
.hero-line { color: var(--cyan); font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.big-ref { font-family: var(--mono); font-size: 26px; color: var(--cyan); }

@media (max-width: 820px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .top { flex-wrap: wrap; }
}
