/* ===== 4Inting Bug Reports dashboard =====
   To recolor the whole UI, change --accent (and --accent-2) below. */
:root {
  --bg: #0e1014;
  --bg-2: #12151b;
  --panel: #171b22;
  --card: #1b2029;
  --card-hover: #222834;
  --border: #2a303c;
  --border-soft: #232934;
  --text: #e9ebf0;
  --muted: #8a90a0;
  --muted-2: #6b7180;
  --accent: #7c5cff;
  --accent-2: #a07bff;
  --green: #43c463;
  --yellow: #f5b342;
  --red: #ed5565;
  --blue: #4aa8ff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, 0.10), transparent 60%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: linear-gradient(180deg, rgba(23, 27, 34, 0.95), rgba(23, 27, 34, 0.82));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px; border-radius: 11px;
  box-shadow: 0 0 0 1px var(--border), 0 4px 14px rgba(124, 92, 255, 0.25);
}
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub {
  font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--accent-2); font-weight: 600;
}
.me { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.me img { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.me a { color: var(--muted-2); text-decoration: none; margin-left: 4px; }
.me a:hover { color: var(--text); }

/* ---- Toolbar ---- */
.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 26px 6px;
  max-width: 1240px; margin: 0 auto; width: 100%;
}
.search {
  flex: 1; min-width: 200px;
  padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18); }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 12.5px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  cursor: pointer; transition: all .15s; user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3);
}

main { max-width: 1240px; margin: 0 auto; padding: 18px 26px 60px; }

/* ---- Card grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 17px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s ease, border-color .15s, box-shadow .15s;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--status-color, var(--muted-2));
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.card .title {
  font-weight: 600; font-size: 14.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.card .foot img { width: 22px; height: 22px; border-radius: 50%; }
.card .foot .who { font-size: 12px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .foot .count { font-size: 12px; color: var(--muted-2); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  width: fit-content;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-color, var(--muted-2)); }
.card.closed { opacity: 0.72; }
.card .closed-tag { font-size: 11px; color: var(--muted-2); }

.empty { color: var(--muted); text-align: center; padding: 60px 0; grid-column: 1 / -1; }

/* ---- Detail view ---- */
.detail { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.back {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  color: var(--muted); font-size: 13px; margin-bottom: 16px;
  background: none; border: none; padding: 0;
}
.back:hover { color: var(--text); }
.detail h1 { font-size: 22px; margin: 0 0 8px; line-height: 1.3; }
.detail .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.detail .sub a { color: var(--accent-2); text-decoration: none; }
.detail .sub a:hover { text-decoration: underline; }

.panel {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
}
.toolbar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
select, .btn, textarea, input.text {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; font-family: inherit; font-size: 13.5px; outline: none;
}
select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.16); }
.btn { cursor: pointer; transition: filter .15s, transform .1s; font-weight: 600; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.check { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

.messages { display: flex; flex-direction: column; }
.msg { display: flex; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border-soft); }
.msg:first-child { border-top: none; }
.msg img.avatar { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.msg .body { flex: 1; min-width: 0; }
.msg .name { font-weight: 600; font-size: 13.5px; }
.msg .name .when { color: var(--muted-2); font-weight: 400; font-size: 11px; margin-left: 8px; }
.msg.bot .name { color: var(--accent-2); }
.msg .content { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; margin-top: 3px; line-height: 1.5; }
.msg .att a { display: inline-block; margin-top: 7px; color: var(--accent-2); font-size: 12.5px; text-decoration: none; }
.msg .att img { max-width: 340px; max-height: 260px; border-radius: 10px; display: block; margin-top: 8px; border: 1px solid var(--border); }

.reply { display: flex; flex-direction: column; gap: 10px; }
.reply textarea { resize: vertical; min-height: 76px; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card-hover); border: 1px solid var(--border);
  padding: 11px 18px; border-radius: 10px; font-size: 13.5px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .topbar, .toolbar, main { padding-left: 14px; padding-right: 14px; }
  .grid { grid-template-columns: 1fr; }
}
