/* ZAK admin panel — brand: orange #ee8a4f, pink #ec4f9a, dark #0e0b0a */
:root {
  --bg: #0e0b0a;
  --bg2: #141010;
  --panel: #1a1412;
  --panel2: #221a16;
  --line: #2e2420;
  --text: #f2ece8;
  --muted: #a0948c;
  --faint: #6e635c;
  --orange: #ee8a4f;
  --pink: #ec4f9a;
  --green: #34c273;
  --red: #f0524f;
  --amber: #e8b64c;
  --radius: 14px;
  --sidebar-w: 232px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  overflow: hidden;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
#app { display: flex; height: 100vh; }
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px;
  gap: 4px;
  overflow-y: auto;
}
#brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
#brand .mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px; color: #1a0d08; letter-spacing: -0.5px;
}
#brand .word { line-height: 1.15; }
#brand .word b { font-size: 15px; letter-spacing: 0.5px; }
#brand .word span { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  color: var(--muted); cursor: pointer; user-select: none;
  font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: linear-gradient(135deg, rgba(238,138,79,0.16), rgba(236,79,154,0.10)); color: var(--orange); border-color: rgba(238,138,79,0.25); }
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
#sidebar .spacer { flex: 1; }
#side-foot { padding: 10px 8px; font-size: 11px; color: var(--faint); }

#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: rgba(20,16,16,0.7); backdrop-filter: blur(8px);
}
#topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
#topbar .sub { color: var(--muted); font-size: 12px; }
#conn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-left: auto; }
#conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
#conn.off .dot { background: var(--red); box-shadow: 0 0 6px var(--red); }
#logout {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 6px 14px; border-radius: 9px; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
#logout:hover { color: var(--text); border-color: var(--faint); }

#content { flex: 1; overflow-y: auto; padding: 26px; }

/* ---------- shared ---------- */
.page { max-width: 1060px; margin: 0 auto; animation: fadein 0.18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin: 26px 0 12px; font-weight: 700; }
.section-title:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.stat { text-align: left; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 600; }
.stat.accent .v { color: var(--orange); }
.stat.pink .v { color: var(--pink); }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
td { padding: 11px 12px; border-bottom: 1px solid rgba(46,36,32,0.55); font-size: 13.5px; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(238,138,79,0.04); }
.tbl-wrap { overflow-x: auto; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 10px; border-radius: 99px; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.up, .pill.open, .pill.added, .pill.fixed, .pill.approved { color: var(--green); background: rgba(52,194,115,0.12); }
.pill.down, .pill.denied, .pill.wont-fix, .pill.new { color: var(--red); background: rgba(240,82,79,0.12); }
.pill.paused, .pill.progress, .pill.in-progress { color: var(--amber); background: rgba(232,182,76,0.12); }

.btn {
  background: linear-gradient(135deg, var(--orange), #f0763c);
  color: #1c0e06; border: none; font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  transition: filter 0.12s, transform 0.05s;
  letter-spacing: 0.2px;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.ghost {
  background: none; border: 1px solid var(--line); color: var(--text);
}
.btn.ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn.pink { background: linear-gradient(135deg, var(--pink), #d63d86); color: #fff; }
.btn.danger { background: none; border: 1px solid rgba(240,82,79,0.4); color: var(--red); }
.btn.danger:hover { background: rgba(240,82,79,0.1); }
.btn:disabled { opacity: 0.5; cursor: wait; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select.inp, input.inp, textarea.inp {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 11px; font-size: 13px; font-family: inherit;
  outline: none; width: 100%;
}
select.inp:focus, input.inp:focus, textarea.inp:focus { border-color: var(--orange); }
textarea.inp { resize: vertical; min-height: 90px; line-height: 1.55; }
label.lbl { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin: 12px 0 5px; letter-spacing: 0.4px; }
.hint { color: var(--faint); font-size: 12px; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.link { color: var(--orange); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast {
  background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--orange);
  border-radius: 10px; padding: 11px 16px; font-size: 13px; max-width: 380px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  animation: toastin 0.22s ease;
}
.toast.err { border-left-color: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; } }

/* ---------- modal ---------- */
#modal-back {
  position: fixed; inset: 0; background: rgba(8,5,4,0.72); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; z-index: 200;
  padding: 5vh 16px; overflow-y: auto;
}
#modal-back.open { display: flex; }
#modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  width: 640px; max-width: 100%; padding: 24px;
  animation: fadein 0.16s ease;
}
#modal h3 { font-size: 16px; margin-bottom: 4px; }
#modal .x { float: right; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }

/* ---------- login ---------- */
#login {
  position: fixed; inset: 0; background:
    radial-gradient(900px 420px at 75% -10%, rgba(236,79,154,0.14), transparent 60%),
    radial-gradient(700px 420px at 15% 110%, rgba(238,138,79,0.12), transparent 60%),
    var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 400;
}
#login .box { width: 360px; max-width: 90vw; text-align: center; }
#login .mark {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 30px; color: #1a0d08;
}
#login h2 { font-size: 21px; letter-spacing: 0.3px; }
#login .tag { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
#login input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 11px; padding: 12px 14px; font-size: 14px; text-align: center; outline: none;
}
#login input:focus { border-color: var(--orange); }
#login .btn { width: 100%; margin-top: 12px; padding: 12px; }
#login .err { color: var(--red); font-size: 12.5px; margin-top: 10px; min-height: 16px; }

/* ---------- overview extras ---------- */
.qa { display: flex; gap: 10px; margin-top: 4px; }
.qa input { flex: 1; }
.pre {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-word; color: #d8cfc9;
}
.tagchip {
  display: inline-block; background: rgba(238,138,79,0.12); color: var(--orange);
  border-radius: 7px; padding: 1px 8px; font-size: 11.5px; margin: 1px 3px 1px 0; font-weight: 600;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  #sidebar { position: fixed; z-index: 100; height: 100vh; transform: translateX(-100%); transition: transform 0.18s; }
  #sidebar.open { transform: none; }
  #burger { display: flex !important; }
  #content { padding: 16px; }
}
#burger {
  display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; width: 38px; height: 34px; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px;
}
.empty { color: var(--faint); text-align: center; padding: 26px 10px; font-size: 13px; }

.tagchip.green { background: rgba(52,194,115,0.12); color: var(--green); }
.tagchip.red { background: rgba(240,82,79,0.12); color: var(--red); }
