/* ── Project Nova Ticket Portal ─────────────────────────────────
   Same design tokens as the CJM Studios Admin Portal, for a
   consistent look across the whole Nova platform. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #050607;
  --panel: rgba(255,255,255,0.03);
  --panel-hover: rgba(255,255,255,0.055);
  --border: rgba(255,255,255,0.09);
  --border-soft: rgba(255,255,255,0.06);
  --text: #f6f8f9;
  --muted: rgba(255,255,255,0.62);
  --faint: rgba(255,255,255,0.42);
  --cyan: #06b6d4;
  --cyan-bright: #22d3ee;
  --cyan-soft: rgba(6,182,212,0.1);
  --cyan-border: rgba(6,182,212,0.25);
  --purple: #7c3aed;
  --purple-bright: #a78bfa;
  --red: #f87171;
  --green: #34d399;
  --amber: #fbbf24;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    radial-gradient(ellipse 70% 40% at 15% -10%, rgba(6,182,212,0.14) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 10%, rgba(124,58,237,0.1) 0%, transparent 60%);
  background-size: 64px 64px, 64px 64px, auto, auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(6,182,212,0.4); }
:focus-visible { outline: 2px solid var(--cyan-border); outline-offset: 2px; border-radius: 6px; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
a { color: var(--cyan-bright); }

/* ── Brand ──────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; display: block;
  box-shadow: 0 0 24px rgba(6,182,212,0.45);
  flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan); margin-top: 1px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 13px 22px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.18s ease;
  border: 1px solid transparent;
}
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff;
  box-shadow: 0 4px 24px rgba(6,182,212,0.3);
}
.btn-primary:hover { filter: brightness(1.15); box-shadow: 0 4px 32px rgba(6,182,212,0.5); transform: translateY(-1px); }
.btn-primary:disabled { transform: none; filter: none; box-shadow: none; }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: rgba(255,255,255,0.7);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.btn-link {
  background: none; border: none; color: var(--cyan-bright);
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; padding: 0;
}
.btn-link:hover { text-decoration: underline; }
.btn:disabled { opacity: 0.5; cursor: wait; }

input, textarea, select {
  width: 100%; padding: 13px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: #fff;
  font-size: 14px; font-weight: 500; font-family: inherit;
  outline: none; transition: border-color 0.2s, background 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--cyan-border); background: rgba(255,255,255,0.06); }
input::placeholder, textarea::placeholder { color: rgba(255,255,255,0.32); }
textarea { resize: vertical; line-height: 1.6; font-weight: 400; }
select option { background: #0d0f11; }
label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin: 0 0 7px 2px; }
.field { margin-bottom: 16px; }

.error {
  color: var(--red); font-size: 13px; background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25); border-radius: 10px; padding: 11px 14px;
  margin-top: 4px; line-height: 1.5;
}
.success-note {
  color: var(--green); font-size: 13px; background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.25); border-radius: 10px; padding: 11px 14px;
  margin-top: 4px; line-height: 1.5;
}

/* ── Full-bleed auth screen (login + setup share this) ────────────
   Deliberately not a centered modal -- content sits lower-left with a lot
   of negative space, matching the reference layout the client wanted. */
.auth-screen {
  min-height: 100vh; width: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 60px 130px;
  position: relative; overflow: hidden;
  background-image:
    linear-gradient(100deg, rgba(5,6,7,0.97) 0%, rgba(5,6,7,0.9) 30%, rgba(5,6,7,0.55) 58%, rgba(5,6,7,0.35) 100%),
    linear-gradient(to top, rgba(5,6,7,1) 0%, rgba(5,6,7,0.15) 40%, rgba(5,6,7,0.35) 100%),
    url('/auth-bg.jpg');
  background-size: cover, cover, cover;
  background-position: center, center, center 65%;
}
.auth-content { max-width: 420px; position: relative; animation: authIn 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes authIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.auth-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-bright); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.auth-eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan-bright); box-shadow: 0 0 10px rgba(34,211,238,0.8);
}
.auth-heading { font-size: 36px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 30px; color: var(--text); }
.accent {
  background: linear-gradient(135deg, #06b6d4 0%, #67e8f9 45%, #22d3ee 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.auth-field { margin-bottom: 14px; }
.auth-field input { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 15px 16px; }
.auth-field input:focus { border-color: var(--cyan-border); background: rgba(255,255,255,0.05); }
.auth-field.has-error input { border-color: rgba(239,68,68,0.55); }
.field-error { color: var(--red); font-size: 11.5px; font-weight: 600; margin-top: 6px; }

.auth-actions { display: flex; gap: 12px; margin-top: 22px; }
.btn-outline {
  background: transparent; border: 1px solid var(--border); color: rgba(255,255,255,0.75);
  padding: 14px 22px; border-radius: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
}
.btn-outline:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.btn-solid {
  background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff;
  padding: 14px 30px; border-radius: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(6,182,212,0.25);
}
.btn-solid:hover { filter: brightness(1.12); box-shadow: 0 4px 28px rgba(6,182,212,0.4); }
.btn-solid:disabled, .btn-outline:disabled { opacity: 0.5; cursor: wait; }

.auth-error { color: var(--red); font-size: 13px; margin-top: 14px; line-height: 1.5; }
.auth-lead { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.65); margin-bottom: 26px; }
.auth-success { color: var(--green); font-size: 13.5px; line-height: 1.6; margin-top: 4px; }

.auth-fineprint { font-size: 11.5px; color: var(--faint); line-height: 1.7; margin-top: 34px; }
.auth-fineprint a { color: var(--muted); text-decoration: underline; }

.auth-note {
  position: absolute; left: 60px; bottom: 44px;
  display: flex; gap: 12px; align-items: flex-start; max-width: 340px;
}
.auth-note-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
  background: var(--purple-bright); box-shadow: 0 0 10px rgba(167,139,250,0.6);
}
.auth-note strong { font-size: 12.5px; color: var(--purple-bright); display: block; margin-bottom: 3px; }
.auth-note p { font-size: 11.5px; color: var(--faint); line-height: 1.5; }

.step-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(6,182,212,0.18), rgba(124,58,237,0.14));
  border: 1px solid var(--cyan-border);
  box-shadow: 0 0 30px rgba(6,182,212,0.12);
}
.step-icon svg { width: 24px; height: 24px; color: var(--cyan-bright); }
.step-icon.warn { background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(124,58,237,0.1)); border-color: rgba(239,68,68,0.3); box-shadow: 0 0 30px rgba(239,68,68,0.1); }
.step-icon.warn svg { color: #f87171; }
.step-icon.ok { background: linear-gradient(135deg, rgba(52,211,153,0.2), rgba(6,182,212,0.12)); border-color: rgba(52,211,153,0.35); box-shadow: 0 0 30px rgba(52,211,153,0.12); }
.step-icon.ok svg { color: var(--green); }

@media (max-width: 640px) {
  .auth-screen { padding: 40px 24px 110px; }
  .auth-note { left: 24px; right: 24px; bottom: 24px; max-width: none; }
  .auth-heading { font-size: 27px; }
}

/* ── App shell (post-login) ────────────────────────────────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 32px; border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: rgba(5,6,7,0.85); backdrop-filter: blur(10px); z-index: 10;
}
.topnav { display: flex; align-items: center; gap: 26px; }
.topnav-link {
  background: none; border: none; font-family: inherit; cursor: pointer;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.03em; color: var(--muted);
  text-decoration: none; padding: 0;
}
.topnav-link:hover { color: #fff; }
.topnav-link.accent-link { color: var(--cyan-bright); }
.topnav-link.accent-link:hover { color: var(--cyan); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.account-chip { font-size: 12.5px; color: var(--muted); }
.account-chip strong { color: var(--text); }

@media (max-width: 820px) {
  .topnav { display: none; }
}

.main { flex: 1; padding: 40px 32px 60px; max-width: 1080px; margin: 0 auto; width: 100%; }
.main-head { margin-bottom: 30px; }
.main-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.main-head p { color: var(--muted); font-size: 14px; }

.section-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint); margin: 34px 0 14px;
}
.section-label:first-child { margin-top: 0; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 34px 0 14px; flex-wrap: wrap; }
.section-label-row .section-label { margin: 0; }

/* ── Dashboard hero + actions ──────────────────────────────────── */
.dash-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.dash-avatar {
  width: 58px; height: 58px; border-radius: 16px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); box-shadow: 0 0 24px rgba(6,182,212,0.25);
}
.dash-hero h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.dash-sub { font-size: 13px; color: var(--muted); }

.dash-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.btn-icon { display: inline-flex; width: 15px; height: 15px; }
.btn-icon svg { width: 100%; height: 100%; }
.btn-primary .btn-icon, .btn-ghost .btn-icon { margin-right: 2px; }

/* ── Category picker (search + recent + full grid) ────────────────── */
.cat-head { margin-bottom: 22px; }
.cat-search { position: relative; max-width: 640px; margin-bottom: 30px; }
.cat-search .btn-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.cat-search input { padding-left: 44px; }

.cat-subtle-label { font-size: 11.5px; font-weight: 700; color: var(--faint); margin-bottom: 12px; }
.recent-cats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.recent-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 16px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit; transition: all 0.15s ease;
}
.recent-chip:hover { border-color: var(--cyan-border); color: #fff; background: var(--panel-hover); }
.recent-chip .chip-icon { display: inline-flex; width: 14px; height: 14px; color: var(--cyan-bright); }
.recent-chip .chip-icon svg { width: 100%; height: 100%; }

.cat-all-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cat-note {
  display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--faint);
  margin: 34px 0 14px;
}
.cat-note .btn-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Category grid ──────────────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.category-card {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s cubic-bezier(.22,1,.36,1), box-shadow 0.3s ease;
  font-family: inherit;
}
.category-card:hover { background: var(--panel-hover); transform: translateY(-3px); box-shadow: 0 12px 34px rgba(0,0,0,0.25); }
.category-card .cat-icon {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.category-card .cat-icon svg { width: 20px; height: 20px; }
.category-card .cat-title { font-weight: 700; font-size: 14.5px; margin-bottom: 8px; color: var(--text); }
.category-card .service-tag { margin-bottom: 10px; }
.category-card .cat-desc { font-size: 12px; color: var(--muted); line-height: 1.55; }

.service-tag {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 4px 10px;
}

/* Per-department colour system: red = Player Reports, green = Community & RP,
   cyan = Account & Store, purple = General Support. */
.cat-icon.dept-red { background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.tag-red { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.category-card:has(.dept-red):hover { border-color: rgba(239,68,68,0.4); box-shadow: 0 12px 34px rgba(239,68,68,0.12); }

.cat-icon.dept-green { background: rgba(52,211,153,0.14); border: 1px solid rgba(52,211,153,0.3); color: var(--green); }
.tag-green { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.3); color: var(--green); }
.category-card:has(.dept-green):hover { border-color: rgba(52,211,153,0.4); box-shadow: 0 12px 34px rgba(52,211,153,0.12); }

.cat-icon.dept-cyan { background: var(--cyan-soft); border: 1px solid var(--cyan-border); color: var(--cyan-bright); }
.tag-cyan { background: var(--cyan-soft); border: 1px solid var(--cyan-border); color: var(--cyan-bright); }
.category-card:has(.dept-cyan):hover { border-color: var(--cyan-border); box-shadow: 0 12px 34px rgba(6,182,212,0.12); }

.cat-icon.dept-purple { background: rgba(124,58,237,0.14); border: 1px solid rgba(124,58,237,0.3); color: var(--purple-bright); }
.tag-purple { background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.3); color: var(--purple-bright); }
.category-card:has(.dept-purple):hover { border-color: rgba(124,58,237,0.4); box-shadow: 0 12px 34px rgba(124,58,237,0.12); }

/* ── Ticket list ────────────────────────────────────────────────── */
.ticket-summary-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-summary {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 20px; cursor: pointer; transition: all 0.15s ease;
  display: flex; align-items: center; gap: 16px;
}
.ticket-summary:hover { background: var(--panel-hover); border-color: var(--cyan-border); }
.ticket-summary.unread { border-color: rgba(6,182,212,0.4); background: rgba(6,182,212,0.045); }
.ticket-summary .ts-icon {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--cyan-bright);
}
.ticket-summary .ts-icon svg { width: 18px; height: 18px; }
.ticket-summary .ts-body { flex: 1; min-width: 0; }
.ticket-summary .ts-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ticket-summary .ts-title { font-weight: 600; font-size: 14px; color: var(--text); }
.ticket-summary .ts-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-summary .ts-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ticket-summary .ts-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.unread-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--cyan-bright); box-shadow: 0 0 10px rgba(34,211,238,0.8);
}

.pill {
  display: inline-flex; align-items: center; flex-shrink: 0;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px; padding: 5px 12px;
}
.pill.open { background: var(--cyan-soft); border: 1px solid var(--cyan-border); color: var(--cyan-bright); }
.pill.closed { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.empty-note { padding: 30px 10px; text-align: center; color: var(--faint); font-size: 13.5px; line-height: 1.8; }

/* ── Archived tickets table ─────────────────────────────────────── */
.table-filter { position: relative; width: 280px; max-width: 100%; }
.table-filter .btn-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.table-filter input { padding: 10px 14px 10px 38px; font-size: 12.5px; }

.ticket-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.ticket-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.ticket-table thead th {
  text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); padding: 14px 18px; border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.ticket-table tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; white-space: nowrap; }
.ticket-table tbody tr { cursor: pointer; transition: background 0.15s ease; }
.ticket-table tbody tr:hover { background: var(--panel-hover); }
.ticket-table tbody tr:last-child td { border-bottom: none; }
.tt-title { font-weight: 600; color: var(--text); }
.tt-id { color: var(--faint); font-size: 11.5px; margin-left: 4px; }
.tt-date { color: var(--muted); font-size: 12px; }
.ticket-table-wrap .empty-note { border-top: none; }

.table-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; font-size: 12px; color: var(--muted);
}
.pg-rows { display: flex; align-items: center; gap: 10px; }
.pg-rows select { width: auto; padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.pg-nav { display: flex; gap: 6px; }
.pg-btn {
  width: 30px; height: 30px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pg-btn:hover:not(:disabled) { background: var(--panel-hover); border-color: var(--cyan-border); }
.pg-btn:disabled { opacity: 0.35; cursor: default; }

@media (max-width: 640px) {
  .table-filter { width: 100%; }
}

/* ── Type chip ────────────────────────────────────────────────── */
.type-chip {
  display: inline-flex; align-items: center; flex-shrink: 0;
  font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 3px 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--muted);
}

.thread-head-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
#thread-meta { display: inline-flex; align-items: center; gap: 8px; }

/* ── Ticket thread panel ───────────────────────────────────────── */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 28px; max-width: 640px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 20px; cursor: pointer; background: none; border: none; font-family: inherit; }
.back-link:hover { color: #fff; }

/* ── New ticket: structured form ──────────────────────────────────── */
.nt-head { text-align: center; max-width: 640px; margin: 10px auto 0; }
.nt-icon {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
}
.nt-icon svg { width: 36px; height: 36px; }
.nt-icon.dept-red { background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.nt-icon.dept-green { background: rgba(52,211,153,0.14); border: 1px solid rgba(52,211,153,0.3); color: var(--green); }
.nt-icon.dept-cyan { background: var(--cyan-soft); border: 1px solid var(--cyan-border); color: var(--cyan-bright); }
.nt-icon.dept-purple { background: rgba(124,58,237,0.14); border: 1px solid rgba(124,58,237,0.3); color: var(--purple-bright); }
.nt-head h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.nt-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.nt-change { font-size: 12.5px; }
.nt-change .btn-link { font-size: 12.5px; }

.nt-banner {
  display: flex; align-items: flex-start; gap: 10px; max-width: 720px; margin: 26px auto 30px;
  background: var(--cyan-soft); border: 1px solid var(--cyan-border); border-radius: 14px;
  padding: 16px 18px; font-size: 13px; line-height: 1.6; color: var(--cyan-bright);
}
.nt-banner .btn-icon { width: 17px; height: 17px; margin-top: 1px; flex-shrink: 0; }

.nt-form { max-width: 720px; margin: 0 auto; }
.field-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px 12px; margin-bottom: 16px;
}
.field-box label { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.field-box input, .field-box textarea {
  background: transparent; border: none; padding: 0; font-size: 14.5px; font-weight: 500;
}
.field-box input:focus, .field-box textarea:focus { background: transparent; border: none; }
.field-box textarea { resize: vertical; min-height: 90px; }
.field-box-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.field-help { font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.field-count { font-size: 11px; color: var(--faint); flex-shrink: 0; white-space: nowrap; }
.nt-form .btn-primary { display: block; margin: 6px auto 0; min-width: 200px; }
#new-ticket-error { max-width: 720px; margin: 14px auto 0; }

@media (max-width: 640px) {
  .nt-head, .nt-form, .nt-banner { max-width: none; }
}

/* ── Ticket thread ──────────────────────────────────────────────── */
.thread-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.thread-messages { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.msg {
  max-width: 82%; padding: 13px 16px; border-radius: 16px; font-size: 13.5px; line-height: 1.55;
  background: var(--panel); border: 1px solid var(--border);
}
.msg.player { align-self: flex-end; background: rgba(6,182,212,0.09); border-color: var(--cyan-border); border-bottom-right-radius: 4px; }
.msg.staff { align-self: flex-start; background: rgba(124,58,237,0.09); border-color: rgba(124,58,237,0.25); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: transparent; border: none; color: var(--faint); font-size: 11.5px; text-align: center; }
.msg .msg-meta { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 5px; }
.reply-row { display: flex; gap: 10px; }
.reply-row input { flex: 1; }

/* ── Toasts ─────────────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #0d0f11; border: 1px solid var(--cyan-border); border-radius: 14px;
  padding: 14px 18px; min-width: 260px; max-width: 340px; font-size: 13px; color: var(--text);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6); animation: toastIn 0.3s ease;
}
.toast::before {
  content: ''; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px rgba(52,211,153,0.7);
}
.toast.error-toast { border-color: rgba(239,68,68,0.35); }
.toast.error-toast::before { background: var(--red); box-shadow: 0 0 10px rgba(248,113,113,0.7); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── Loading spinner ────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .card { padding: 32px 24px; }
  .main { padding: 28px 18px 50px; }
  .topbar { padding: 14px 18px; }
  .category-grid { grid-template-columns: 1fr 1fr; }
}
