/* ══════════════════════════════════════════════════════
   GUNNER · Design System — Glass Edition
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --ink:    #06070f;
  --ink1:   #0c0d1a;
  --ink2:   #11121f;

  --glass:  rgba(255,255,255,0.042);
  --glass2: rgba(255,255,255,0.07);
  --glass3: rgba(255,255,255,0.11);
  --rim:    rgba(255,255,255,0.09);
  --rim2:   rgba(255,255,255,0.16);

  --v:   #8b5cf6;
  --v2:  #6d28d9;
  --b:   #3b82f6;
  --c:   #06b6d4;
  --g:   #10b981;
  --r:   #f43f5e;
  --o:   #f59e0b;

  --text:  #f5f7ff;
  --sub:   #a2a0c3;
  --dim:   #666381;

  --rad:  14px;
  --rad2: 20px;
  --f-head: 'Space Grotesk', sans-serif;
  --f-body: 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(139,92,246,.4) transparent; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,.4); border-radius: 4px; }

body {
  font-family: var(--f-body);
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Aurora Background ── */
.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.aurora-orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .14;
  animation: drift 22s ease-in-out infinite;
}
.aurora-orb:nth-child(1) {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--v), transparent 70%);
  top: -200px; left: -150px; animation-duration: 24s;
}
.aurora-orb:nth-child(2) {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--b), transparent 70%);
  top: 40%; right: -180px; animation-duration: 30s; animation-delay: -8s;
}
.aurora-orb:nth-child(3) {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--c), transparent 70%);
  bottom: -120px; left: 30%; animation-duration: 18s; animation-delay: -4s;
}
@keyframes drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%  { transform: translate(40px,-60px) scale(1.1); }
  66%  { transform: translate(-30px,40px) scale(.92); }
}

.dot-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black 0%, transparent 80%);
}

/* ── Nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: 66px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 56px);
  background: rgba(6,7,15,.75);
  backdrop-filter: blur(28px) saturate(1.4);
  border-bottom: 1px solid var(--rim);
}
nav::after {
  content: '';
  position: absolute; bottom: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,.5), rgba(59,130,246,.45), transparent);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-family: var(--f-head); font-size: 17px; font-weight: 700; letter-spacing: -.02em;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--v), var(--b));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(139,92,246,.38);
}
.logo-mark i { font-size: 12px; color: #fff; }

.nav-actions {
  display: flex; align-items: center; gap: 8px;
}

.nav-home {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  background: var(--glass2); border: 1px solid var(--rim);
  color: var(--sub); text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  transition: all .22s;
}
.nav-home i { font-size: 10px; }
.nav-home:hover { color: var(--text); background: var(--glass3); border-color: var(--rim2); }

.nav-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 10px;
  background: var(--glass2); border: 1px solid var(--rim);
  font-size: 12px; font-weight: 600; color: var(--sub);
}
.nav-avatar {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--v), var(--b));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.nav-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(139,92,246,.18); color: #c4b5fd; border: 1px solid rgba(139,92,246,.25);
}
.nav-badge.admin { background: rgba(244,63,94,.15); color: #fb7185; border-color: rgba(244,63,94,.25); }

/* ── Page layout ── */
.page-wrap {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 96px clamp(16px, 4vw, 48px) 60px;
}
.page-center {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 90px 20px 40px;
}

/* ── Glass Card ── */
.card {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--rim);
  border-radius: var(--rad2);
  padding: 28px;
  position: relative; overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}

.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 {
  font-family: var(--f-head);
  font-size: 26px; font-weight: 700; letter-spacing: -.03em;
  margin-bottom: 6px;
}
.auth-card > p { font-size: 13px; color: var(--sub); margin-bottom: 28px; }

/* ── Section title ── */
.section-title {
  font-family: var(--f-head);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700; letter-spacing: -.025em;
  margin-bottom: 4px;
}
.section-sub { font-size: 13px; color: var(--sub); line-height: 1.7; }

/* ── Topbar ── */
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.topbar-left h1 {
  font-family: var(--f-head);
  font-size: clamp(20px, 3vw, 28px); font-weight: 700; letter-spacing: -.03em;
  margin-bottom: 4px;
}
.topbar-left p { font-size: 13px; color: var(--sub); }
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 11px;
  font-family: var(--f-body); font-size: 12px; font-weight: 700; letter-spacing: .04em;
  border: none; cursor: pointer; text-decoration: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden; flex-shrink: 0;
}
.btn i { font-size: 11px; }

.btn-primary {
  background: linear-gradient(135deg, var(--v), var(--b));
  color: #fff;
  box-shadow: 0 0 24px rgba(139,92,246,.28), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(139,92,246,.42), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:active { transform: translateY(0); }

.btn-glass {
  background: var(--glass2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--rim2);
  color: var(--sub);
}
.btn-glass:hover {
  background: var(--glass3); border-color: rgba(255,255,255,.22);
  color: var(--text); transform: translateY(-2px);
}

.btn-danger {
  background: rgba(244,63,94,.12);
  border: 1px solid rgba(244,63,94,.25);
  color: #fb7185;
}
.btn-danger:hover { background: rgba(244,63,94,.2); transform: translateY(-2px); }

.btn-sm { padding: 7px 13px; font-size: 11px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Form fields ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--sub);
}

input[type=text], input[type=email], input[type=password],
textarea, select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--rim2);
  background: rgba(0,0,0,.28);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 13px;
  transition: border-color .22s, box-shadow .22s;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(139,92,246,.5);
  box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

select option { background: #13142a; }

textarea {
  resize: vertical; min-height: 100px; line-height: 1.65;
}

/* ── Flash messages ── */
.flash {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: 11px; margin-bottom: 16px;
  font-size: 13px; font-weight: 500; border: 1px solid;
}
.flash i { font-size: 13px; flex-shrink: 0; }
.flash.ok    { background: rgba(16,185,129,.1);  border-color: rgba(16,185,129,.25);  color: #34d399; }
.flash.error { background: rgba(244,63,94,.1);   border-color: rgba(244,63,94,.25);   color: #fb7185; }
.flash.info  { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.25);  color: #93c5fd; }

/* ── Grid ── */
.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 16px;
}

/* ── Ticket row ── */
.ticket-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--rim);
  transition: background .18s;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-row strong { font-size: 13px; font-weight: 600; font-family: var(--f-head); }
.ticket-row small { font-size: 11px; color: var(--dim); display: block; margin-top: 3px; }

/* ── Status badges ── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid;
}
.status-open     { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.28); color: #93c5fd; }
.status-in_progress { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.28); color: #fbbf24; }
.status-closed   { background: rgba(100,116,139,.1);  border-color: rgba(100,116,139,.2); color: #94a3b8; }

/* ── Message bubble ── */
.message-bubble {
  padding: 14px 16px; border-radius: 14px; margin-bottom: 10px;
  background: rgba(0,0,0,.22); border: 1px solid var(--rim);
}
.message-bubble.is-admin {
  background: rgba(139,92,246,.07); border-color: rgba(139,92,246,.2);
}
.msg-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
}
.msg-author { font-size: 12px; font-weight: 700; font-family: var(--f-head); }
.msg-role {
  font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(139,92,246,.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,.25);
}
.msg-role.admin { background: rgba(244,63,94,.12); color: #fb7185; border-color: rgba(244,63,94,.25); }
.msg-time { font-size: 10px; color: var(--dim); margin-left: auto; }
.msg-body { font-size: 13px; color: var(--sub); line-height: 1.7; }

/* ── Reply box ── */
.reply-box {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--rim);
}
.reply-box h4 {
  font-family: var(--f-head); font-size: 13px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--sub);
  margin-bottom: 10px;
}
.reply-row { display: flex; gap: 8px; align-items: flex-end; }
.reply-row textarea { flex: 1; min-height: 64px; }

/* ── Detail panel ── */
.detail-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px;
}
.meta-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(255,255,255,.04); border: 1px solid var(--rim);
  font-size: 11px; color: var(--sub);
}
.meta-item strong { color: var(--text); font-weight: 600; }
.meta-item i { font-size: 10px; color: #a78bfa; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 32px 20px;
  color: var(--dim); font-size: 13px;
}
.empty-state i { font-size: 28px; margin-bottom: 10px; display: block; opacity: .5; }

/* ── Loading ── */
.loading { color: var(--dim); font-size: 13px; }

/* ── Divider ── */
.divider {
  height: 1px; margin: 18px 0;
  background: linear-gradient(90deg, transparent, var(--rim2), transparent);
}

/* ── Auth footer link ── */
.auth-link { font-size: 12px; color: var(--sub); text-align: center; margin-top: 16px; }
.auth-link a { color: #a78bfa; text-decoration: none; font-weight: 600; }
.auth-link a:hover { color: #c4b5fd; }

/* ── Ticket ref tag ── */
.ref-tag {
  font-family: 'Courier New', monospace;
  font-size: 11px; font-weight: 700;
  color: #a78bfa; background: rgba(139,92,246,.1);
  padding: 2px 7px; border-radius: 5px; border: 1px solid rgba(139,92,246,.2);
}

/* ── Admin note field ── */
.admin-area {
  margin-top: 16px; padding: 16px;
  border-radius: 14px;
  background: rgba(244,63,94,.05); border: 1px solid rgba(244,63,94,.15);
}
.admin-area h4 {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #fb7185; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.admin-area h4 i { font-size: 10px; }
.admin-row { display: flex; gap: 8px; margin-top: 10px; }

/* ── Responsive ── */
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .card { padding: 18px; }
  .topbar-right { gap: 6px; }
}
