/* AGN City Reports — same navy + AGN blue system as the Central Command Center */
:root {
  --bg: #030817;
  --bg2: #06102a;
  --panel: rgba(8, 20, 48, .82);
  --panel-solid: #081430;
  --line: rgba(64, 140, 255, .32);
  --line-soft: rgba(64, 140, 255, .14);
  --line-hi: rgba(90, 170, 255, .75);
  --glow: 0 0 0 1px rgba(64, 140, 255, .18), 0 0 18px rgba(30, 110, 255, .18), inset 0 0 24px rgba(30, 110, 255, .06);
  --glow-hi: 0 0 0 1px rgba(110, 180, 255, .55), 0 0 26px rgba(40, 130, 255, .45), inset 0 0 30px rgba(40, 130, 255, .12);
  --text: #e8efff;
  --muted: #93a6cc;
  --dim: #6177a3;
  --accent: #2f7bff;
  --accent-hi: #5aa8ff;
  --ok: #33e07a;
  --warn: #ffb020;
  --bad: #ff4d5e;
  --critical: #f53d6b;
  --important: #ffa500;
  --normal: #4caf50;
  --low: #7f8fb3;
  --radius: 10px;
  --font: 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Orbitron', 'Exo 2', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(40, 110, 255, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(40, 90, 255, .16), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  padding: 12px;
  max-width: 1720px;
  margin: 0 auto;
}
a { color: var(--accent-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  backdrop-filter: blur(6px);
}

/* ── top bar ─────────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 16px; padding: 8px 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { height: 38px; width: auto; }
.brand span {
  font: 900 20px var(--display); letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 0 14px rgba(90, 160, 255, .55);
}
.servers { flex: 1; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.srv { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: rgba(3, 10, 28, .6); }
.srv b { color: var(--text); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.me { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }

/* ── KPIs ────────────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.kpi { padding: 10px 14px; }
.kpi .label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .value { font: 800 26px/1.15 var(--display); margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--dim); }
.kpi.hot .value { color: var(--critical); text-shadow: 0 0 12px rgba(245, 61, 107, .5); }

/* ── work area ───────────────────────────────────────────────────────── */
.work { display: grid; grid-template-columns: minmax(360px, 520px) minmax(0, 1fr); gap: 12px; align-items: start; }
.listpane { display: flex; flex-direction: column; max-height: calc(100vh - 190px); min-height: 420px; }
.filters { padding: 12px; display: grid; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.filters input[type=search], select, textarea, .input {
  padding: 8px 11px; border-radius: 7px; border: 1px solid var(--line); background: rgba(3, 10, 28, .85); width: 100%; font-size: 14px;
}
.filters input:focus, select:focus, textarea:focus { outline: none; border-color: var(--line-hi); box-shadow: var(--glow-hi); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: rgba(10, 26, 60, .6); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip[aria-selected=true] { background: linear-gradient(180deg, #2b7bff, #1d5fe0); color: #fff; border-color: var(--line-hi); }
.chip .n { opacity: .75; margin-left: 4px; font-variant-numeric: tabular-nums; }
.selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.selects select { font-size: 13px; padding: 6px 8px; }

.list { overflow: auto; flex: 1; }
.item { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; text-decoration: none; color: inherit; }
.item:hover { background: rgba(40, 110, 255, .08); }
.item.on { background: rgba(40, 110, 255, .18); }
.item .bar { border-radius: 0 3px 3px 0; background: var(--normal); }
.item .bar.critical { background: var(--critical); box-shadow: 0 0 10px var(--critical); }
.item .bar.important { background: var(--important); }
.item .bar.low { background: var(--low); }
.item h3 { margin: 0; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 3px; }
.item .right { text-align: right; font-size: 12px; color: var(--dim); display: grid; gap: 4px; justify-items: end; align-content: start; }
.item.done h3 { color: var(--muted); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line); color: var(--muted); }
.tag.open { color: #9cd0ff; border-color: rgba(90, 168, 255, .6); }
.tag.claimed { color: var(--warn); border-color: rgba(255, 176, 32, .55); }
.tag.resolved { color: var(--ok); border-color: rgba(51, 224, 122, .5); }
.tag.closed { color: var(--dim); }
.tag.critical { color: #fff; background: var(--critical); border-color: var(--critical); }
.tag.important { color: #1b1200; background: var(--important); border-color: var(--important); }
.tag.src { text-transform: none; letter-spacing: 0; font-weight: 600; }

.empty { padding: 40px 28px; color: var(--muted); text-align: center; }
.empty h2 { font: 800 16px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }

/* ── detail ──────────────────────────────────────────────────────────── */
.detail { min-height: 420px; max-height: calc(100vh - 190px); overflow: auto; }
.dhead { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--panel-solid); z-index: 2; border-radius: var(--radius) var(--radius) 0 0; }
.dhead .ref { font: 800 13px var(--display); color: var(--accent-hi); letter-spacing: .1em; }
.dhead h2 { margin: 4px 0 8px; font-size: 20px; line-height: 1.25; }
.dhead .tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dbody { padding: 16px 18px; display: grid; gap: 16px; }
.section h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.details-text { white-space: pre-wrap; background: rgba(3, 10, 28, .6); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; font-size: 14.5px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.fact { background: rgba(3, 10, 28, .6); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.fact .k { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.fact .v { font-size: 13.5px; overflow-wrap: anywhere; }
.fact .v code { font-size: 12px; }
.fact button { background: none; border: 0; color: var(--accent-hi); cursor: pointer; padding: 0; font-size: 12px; margin-left: 6px; }
.shot img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.media { display: flex; gap: 8px; flex-wrap: wrap; }
.media a { font-size: 13px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; }
.timeline .pip { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--dim); }
.timeline .pip.created { background: var(--accent-hi); }
.timeline .pip.message { background: #9b8bff; }
.timeline .pip.claimed { background: var(--warn); }
.timeline .pip.resolved { background: var(--ok); }
.timeline .pip.note { background: #36c3ff; }
.timeline .pip.closed { background: var(--bad); }
.timeline .who { font-size: 12.5px; color: var(--muted); }
.timeline .who b { color: var(--text); font-weight: 600; }
.timeline .body { white-space: pre-wrap; font-size: 14px; margin-top: 2px; }
.timeline details { font-size: 12px; color: var(--dim); }
.timeline pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; max-height: 220px; overflow: auto; }

.composer { display: grid; gap: 8px; }
.composer textarea { min-height: 72px; resize: vertical; }
.composer .row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.composer .row .grow { flex: 1; font-size: 12.5px; color: var(--dim); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line-hi); background: linear-gradient(180deg, #2b7bff, #1d5fe0); color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 0 14px rgba(50, 130, 255, .4); text-decoration: none; font-size: 13.5px;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.ghost { background: rgba(10, 26, 60, .6); box-shadow: none; border-color: var(--line); color: var(--text); }
.btn.ok { background: linear-gradient(180deg, #25c46a, #178f4c); border-color: #59f09a; box-shadow: 0 0 12px rgba(51, 224, 122, .3); }
.btn.danger { background: linear-gradient(180deg, #e8384b, #b91f31); border-color: #ff7784; box-shadow: 0 0 12px rgba(255, 77, 94, .35); }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 8px; background: var(--panel-solid); border: 1px solid var(--line-hi); box-shadow: var(--glow-hi); font-weight: 600; }
.toast.bad { border-color: var(--bad); }

/* ── login ───────────────────────────────────────────────────────────── */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(420px, 100%); padding: 24px; text-align: center; }
.login-card img { width: 220px; max-width: 70%; }
.login-card h1 { font: 900 24px var(--display); letter-spacing: .06em; text-transform: uppercase; margin: 10px 0 4px; text-shadow: 0 0 18px rgba(90, 160, 255, .55); }
.tagline { text-transform: uppercase; color: var(--accent-hi); letter-spacing: .3em; font-weight: 600; font-size: 10.5px; margin-bottom: 20px; }
.tagline i { font-style: normal; margin: 0 .5em; color: var(--dim); }
.form { display: grid; gap: 12px; text-align: left; }
.form label { display: grid; gap: 5px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.form input { padding: 9px 11px; border-radius: 7px; border: 1px solid var(--line); background: rgba(3, 10, 28, .85); font-size: 14px; text-transform: none; letter-spacing: 0; }
.form input:focus { outline: none; border-color: var(--line-hi); box-shadow: var(--glow-hi); }
.login-card .btn { width: 100%; padding: 11px; font-size: 14px; }
.login-card .hint { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }
.error { color: #ffb3bb; background: rgba(255, 77, 94, .12); border: 1px solid rgba(255, 77, 94, .4); padding: 9px 12px; border-radius: 7px; font-size: 13.5px; }

/* back link only shows in the one-pane phone layout */
.back { display: none !important; }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  body { padding: 8px 16px; }
  .work { grid-template-columns: 1fr; }
  .listpane, .detail { max-height: none; }
  body.has-detail .listpane { display: none; }
  body:not(.has-detail) .detail { display: none; }
  .top { flex-wrap: wrap; }
  .servers { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .back { display: inline-flex !important; margin-bottom: 8px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer .row .grow { flex-basis: 100%; }
}
