*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #04070f;
  --surface: #0a0f1e;
  --surface2: #0f1628;
  --border: #1a2540;
  --border2: #1e2d4a;
  --text: #e8f0ff;
  --text2: #7a96c0;
  --text3: #3d5478;
  --accent: #4f8ef7;
  --accent-glow: rgba(79, 142, 247, 0.15);
  --purple: #7c3aed;
  --purple-lt: #a78bfa;
  --teal: #0d9488;
  --teal-lt: #5eead4;
  --amber: #d97706;
  --amber-lt: #fcd34d;
  --red: #dc2626;
  --red-lt: #fca5a5;
  --green: #16a34a;
  --green-lt: #86efac;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-w: 220px;
  --font: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   LOGIN — CENTERED FLOATING CARD
══════════════════════════════════════════════════════ */

#login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04070f;
  z-index: 1000;
  overflow: auto;
  padding: 48px 32px;
}

#login-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
  z-index: 0;
}

/* ── Main card — floating, centered, never touching edges ── */
.login-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  background: rgba(8, 12, 24, 0.75);
  border: 1px solid rgba(120, 160, 255, 0.13);
  border-radius: 24px;
  backdrop-filter: blur(48px) saturate(1.5);
  -webkit-backdrop-filter: blur(48px) saturate(1.5);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 48px 120px rgba(0, 0, 0, 0.75),
    0 0 200px rgba(59, 130, 246, 0.05),
    0 0 60px rgba(124, 58, 237, 0.04);
  overflow: hidden;
  width: 100%;
  max-width: 880px;
  min-height: 560px;
  margin: auto;
  animation: cardIn 0.55s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(24px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── Left branding panel ── */
.login-left {
  flex: 1;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(100, 140, 255, 0.08);
  background: linear-gradient(
    145deg,
    rgba(59, 130, 246, 0.03) 0%,
    rgba(124, 58, 237, 0.04) 50%,
    rgba(13, 148, 136, 0.02) 100%
  );
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.07),
    transparent 65%
  );
  pointer-events: none;
}

.login-left::after {
  content: "";
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.05),
    transparent 65%
  );
  pointer-events: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.login-brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #7c3aed 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow:
    0 0 30px rgba(99, 102, 241, 0.45),
    0 0 8px rgba(59, 130, 246, 0.3) inset;
  flex-shrink: 0;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.login-brand-icon:hover {
  transform: scale(1.08) rotate(-5deg);
  box-shadow:
    0 0 48px rgba(99, 102, 241, 0.6),
    0 0 12px rgba(59, 130, 246, 0.4) inset;
}

.login-brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #e8f0ff 30%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  margin-bottom: 36px;
}

.login-tagline h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.12;
  margin-bottom: 14px;
  color: var(--text);
}

.gradient-text {
  background: linear-gradient(90deg, #4f8ef7, #a78bfa, #5eead4, #4f8ef7);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradFlow 5s linear infinite;
}

@keyframes gradFlow {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 300% center;
  }
}

.login-tagline p {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.8;
  max-width: 300px;
}

/* Features */
.login-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  cursor: default;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
  backdrop-filter: blur(8px);
}

.feature-item:hover {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(99, 102, 241, 0.22);
  transform: translateX(5px);
}

.feature-icon {
  width: 32px;
  height: 32px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.feature-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1px;
}
.feature-desc {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.4;
}

/* Stack chips */
.login-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.stack-chip {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 4px 10px;
  border-radius: 20px;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.stack-chip:hover {
  color: var(--accent);
  border-color: rgba(79, 142, 247, 0.4);
}
.stack-sep {
  color: var(--text3);
  font-size: 12px;
}

/* ── Vertical divider ── */
.login-divider-v {
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(100, 140, 255, 0.15) 25%,
    rgba(100, 140, 255, 0.15) 75%,
    transparent 100%
  );
  flex-shrink: 0;
}

/* ── Right auth panel ── */
.login-right {
  width: 370px;
  flex-shrink: 0;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  background: rgba(4, 7, 18, 0.45);
  overflow-y: auto;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 28px;
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(122, 150, 192, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.auth-tab:hover:not(.active) {
  color: var(--text2);
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab.active {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.9),
    rgba(99, 102, 241, 0.9)
  );
  color: white;
  box-shadow:
    0 3px 14px rgba(59, 130, 246, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

/* Auth header */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.auth-header {
  margin-bottom: 22px;
}

.auth-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, #e8f0ff 50%, #7a96c0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-sub {
  font-size: 13px;
  color: var(--text3);
}

/* Google button */
.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.22s;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
  margin-bottom: 4px;
}

.google-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.google-btn:active {
  transform: translateY(0);
}

/* Or divider */
.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--text3);
  font-size: 12px;
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(30, 45, 74, 0.8),
    transparent
  );
}

/* Field groups */
.field-group {
  margin-bottom: 12px;
}

.field-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text3);
  pointer-events: none;
  flex-shrink: 0;
  transition: color 0.2s;
}

.input-wrap input {
  width: 100%;
  background: rgba(4, 7, 18, 0.65);
  border: 1px solid rgba(100, 140, 255, 0.12);
  border-radius: var(--radius);
  padding: 10px 40px 10px 36px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: all 0.2s;
  backdrop-filter: blur(12px);
}

.input-wrap input:focus {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(4, 7, 18, 0.9);
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.1),
    0 0 24px rgba(59, 130, 246, 0.07);
}

.input-wrap:focus-within .input-icon {
  color: rgba(99, 102, 241, 0.8);
}
.input-wrap input::placeholder {
  color: rgba(61, 84, 120, 0.8);
}

/* Eye toggle */
.eye-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  opacity: 0.6;
}

.eye-btn:hover {
  color: var(--text2);
  background: rgba(255, 255, 255, 0.05);
  opacity: 1;
}

.eye-icon {
  transition: opacity 0.15s;
}

/* Forgot */
.forgot-row {
  text-align: right;
  margin-bottom: 14px;
  margin-top: -4px;
}

.forgot-btn {
  background: none;
  border: none;
  color: rgba(79, 142, 247, 0.8);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  padding: 2px 0;
  transition: color 0.15s;
}

.forgot-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Submit */
.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 55%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.22s;
  box-shadow:
    0 4px 20px rgba(99, 102, 241, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.2s;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 36px rgba(99, 102, 241, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.submit-btn:hover::before {
  opacity: 1;
}
.submit-btn:active {
  transform: translateY(0);
}

/* Auth error */
.auth-error {
  color: var(--red-lt);
  font-size: 12px;
  text-align: center;
  min-height: 18px;
  margin-top: 8px;
}

/* Guest */
.guest-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  color: rgba(122, 150, 192, 0.8);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.guest-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
  transform: translateY(-1px);
}

.guest-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 20px;
  color: var(--text3);
  margin-left: auto;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(79, 142, 247, 0.3);
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 8px;
  overflow-y: auto;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.08em;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  text-decoration: none;
  font-size: 13px;
  user-select: none;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}
.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text3);
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

.nav-badge.warning {
  background: rgba(217, 119, 6, 0.15);
  color: var(--amber-lt);
}
.nav-badge.success {
  background: rgba(22, 163, 74, 0.15);
  color: var(--green-lt);
}
.nav-badge.danger {
  background: rgba(220, 38, 38, 0.15);
  color: var(--red-lt);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.logout-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--red);
  color: var(--red-lt);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green-lt);
  font-size: 11px;
  margin-bottom: 5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-lt);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

.powered-by {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
}

/* ══════════════════════════════════════════════════════
   APP
══════════════════════════════════════════════════════ */

#app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 16px;
}

.page-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.page-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.metric-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  min-width: 80px;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.metric-pill:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
}
.metric-pill.success {
  border-color: rgba(22, 163, 74, 0.3);
}
.metric-pill.warning {
  border-color: rgba(217, 119, 6, 0.3);
}

.metric-val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1.2;
  color: var(--text);
}

.metric-pill.success .metric-val {
  color: var(--green-lt);
}
.metric-pill.warning .metric-val {
  color: var(--amber-lt);
}

.metric-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  transition: all 0.15s;
}

.refresh-btn:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--accent);
}

/* ── Content grid ── */
.content-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 250px;
  overflow: hidden;
  min-height: 0;
}

.ticket-panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
}

.panel-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  flex: 1;
  max-width: 160px;
}

.search-box svg {
  color: var(--text3);
  flex-shrink: 0;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  width: 100%;
  font-family: var(--font);
}

.search-box input::placeholder {
  color: var(--text3);
}

#tickets-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
#tickets-list::-webkit-scrollbar {
  width: 3px;
}
#tickets-list::-webkit-scrollbar-track {
  background: transparent;
}
#tickets-list::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

/* ── Ticket card ── */
.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 13px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 7px;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ticket-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateX(2px);
}
.ticket-card.active {
  border-color: var(--accent);
  background: rgba(79, 142, 247, 0.06);
}

.ticket-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.ticket-card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}

.status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.status-received {
  background: rgba(79, 142, 247, 0.12);
  color: #7fb3ff;
}
.status-processing {
  background: rgba(217, 119, 6, 0.12);
  color: var(--amber-lt);
}
.status-resolved {
  background: rgba(22, 163, 74, 0.12);
  color: var(--green-lt);
}
.status-escalated {
  background: rgba(220, 38, 38, 0.12);
  color: var(--red-lt);
}

.ticket-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text3);
}

.sev-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}
.sev-low {
  background: rgba(22, 163, 74, 0.1);
  color: var(--green-lt);
}
.sev-medium {
  background: rgba(217, 119, 6, 0.1);
  color: var(--amber-lt);
}
.sev-high {
  background: rgba(234, 88, 12, 0.1);
  color: #fb923c;
}
.sev-critical {
  background: rgba(220, 38, 38, 0.1);
  color: var(--red-lt);
}

/* ── Detail panel ── */
.detail-panel {
  overflow-y: auto;
  padding: 20px 24px;
  border-right: 1px solid var(--border);
}

.detail-panel::-webkit-scrollbar {
  width: 3px;
}
.detail-panel::-webkit-scrollbar-track {
  background: transparent;
}
.detail-panel::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

.detail-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.detail-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  line-height: 1.3;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 20px;
  font-family: var(--mono);
}

.detail-section {
  margin-bottom: 18px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-value {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
}

.ai-summary {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 15px;
}

.ai-summary-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.ai-summary-sub {
  font-size: 12px;
  color: var(--text3);
}

.chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  color: var(--text2);
  font-family: var(--mono);
}

.fix-script-box {
  background: rgba(2, 4, 10, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fix-script-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.fix-script-label {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}

.copy-btn:hover {
  background: #2563eb;
}

.fix-script-code {
  padding: 13px 15px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal-lt);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.7;
}

.escalation-box {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius);
  padding: 13px 15px;
  display: flex;
  gap: 12px;
}

.escalation-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--red-lt);
  margin-bottom: 3px;
}
.escalation-reason {
  font-size: 12px;
  color: var(--text3);
}
.approval-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-approve {
  padding: 6px 16px;
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid var(--green);
  color: var(--green-lt);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  transition: all 0.15s;
}
.btn-approve:hover {
  background: rgba(22, 163, 74, 0.25);
}

.btn-reject {
  padding: 6px 16px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--red);
  color: var(--red-lt);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  transition: all 0.15s;
}
.btn-reject:hover {
  background: rgba(220, 38, 38, 0.2);
}

/* ── Activity panel ── */
.activity-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.activity-count {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

#activity-feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
#activity-feed::-webkit-scrollbar {
  width: 3px;
}
#activity-feed::-webkit-scrollbar-track {
  background: transparent;
}
#activity-feed::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.2s ease;
}

.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.activity-dot.blue {
  background: var(--accent);
}
.activity-dot.green {
  background: var(--green-lt);
}
.activity-dot.red {
  background: var(--red-lt);
}
.activity-dot.amber {
  background: var(--amber-lt);
}

.activity-body {
  flex: 1;
}
.activity-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}
.activity-time {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
  margin-top: 2px;
}

/* ── Empty states ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text3);
  text-align: center;
  gap: 10px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text2);
}
.empty-state span {
  font-size: 12px;
}
.empty-state.tall {
  min-height: 280px;
}
.empty-state.small {
  padding: 20px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  z-index: 999;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s ease;
  text-align: center;
}

.toast.hidden {
  display: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ── Analytics row ── */
.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  height: 200px;
}

.analytics-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.analytics-panel:first-child {
  border-right: 1px solid var(--border);
}

.heatmap-wrap {
  flex: 1;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.heatmap-hours {
  display: grid;
  grid-template-columns: 36px repeat(6, 1fr);
  gap: 3px;
}

.heatmap-hours span {
  font-size: 9px;
  color: var(--text3);
  font-family: var(--mono);
  text-align: center;
}

.heatmap-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 36px repeat(6, 1fr);
  gap: 3px;
  flex: 1;
}

.heatmap-day-label {
  font-size: 9px;
  color: var(--text3);
  font-family: var(--mono);
  display: flex;
  align-items: center;
}

.heatmap-cell {
  border-radius: 3px;
  background: #080c18;
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    transform 0.1s,
    border-color 0.1s;
  position: relative;
}

.heatmap-cell:hover {
  transform: scale(1.2);
  border-color: var(--accent);
  z-index: 10;
}

.heatmap-cell::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  font-family: var(--mono);
  z-index: 20;
}

.heatmap-cell:hover::after {
  opacity: 1;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.legend-scale {
  display: flex;
  gap: 3px;
}
.legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

#timeline-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
}
#timeline-wrap::-webkit-scrollbar {
  width: 3px;
}
#timeline-wrap::-webkit-scrollbar-track {
  background: transparent;
}
#timeline-wrap::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border2);
}

.timeline-step {
  position: relative;
  margin-bottom: 14px;
  animation: slideDown 0.3s ease;
}
.timeline-step:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -17px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.timeline-dot.done {
  background: var(--green-lt);
}
.timeline-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.timeline-dot.pending {
  background: var(--border2);
}
.timeline-dot.error {
  background: var(--red-lt);
}

.timeline-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}
.timeline-sub {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
  margin-top: 2px;
}

.timeline-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  margin-top: 3px;
  font-weight: 500;
}

.timeline-badge.done {
  background: rgba(22, 163, 74, 0.12);
  color: var(--green-lt);
}
.timeline-badge.active {
  background: rgba(79, 142, 247, 0.12);
  color: #7fb3ff;
}
.timeline-badge.pending {
  background: var(--surface2);
  color: var(--text3);
}
.timeline-badge.error {
  background: rgba(220, 38, 38, 0.12);
  color: var(--red-lt);
}

/* ══════════════════════════════════════════════════════
   CHAT
══════════════════════════════════════════════════════ */

.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  box-shadow:
    0 4px 24px rgba(79, 142, 247, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  z-index: 998;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow:
    0 10px 36px rgba(79, 142, 247, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--red);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.chat-window {
  position: fixed;
  bottom: 92px;
  right: 28px;
  width: 380px;
  height: 540px;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid rgba(100, 140, 255, 0.15);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  z-index: 997;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(24px);
  animation: chatOpen 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.chat-window.hidden {
  display: none;
}

@keyframes chatOpen {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(100, 140, 255, 0.1);
  background: rgba(8, 12, 24, 0.6);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(79, 142, 247, 0.3);
}

.chat-title {
  font-size: 13px;
  font-weight: 600;
}
.chat-subtitle {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
}
.chat-header-actions {
  display: flex;
  gap: 4px;
}

.chat-action-btn {
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.chat-context-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: rgba(79, 142, 247, 0.07);
  border-bottom: 1px solid rgba(79, 142, 247, 0.15);
  font-size: 11px;
  color: #7fb3ff;
  flex-shrink: 0;
}

.context-clear-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s;
}

.context-clear-btn:hover {
  color: var(--red-lt);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.chat-messages::-webkit-scrollbar {
  width: 3px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  animation: msgIn 0.2s ease;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.user {
  flex-direction: row-reverse;
}

.chat-bubble {
  max-width: 84%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.chat-msg.assistant .chat-bubble {
  background: rgba(15, 22, 40, 0.8);
  border: 1px solid rgba(100, 140, 255, 0.1);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(79, 142, 247, 0.3);
}

.chat-msg.assistant .chat-bubble code {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text3);
  border-radius: 50%;
  animation: typing 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.chat-suggestions {
  display: flex;
  gap: 6px;
  padding: 0 11px 9px;
  overflow-x: auto;
  flex-shrink: 0;
}

.chat-suggestions::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  white-space: nowrap;
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(100, 140, 255, 0.15);
  background: rgba(79, 142, 247, 0.05);
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  flex-shrink: 0;
}

.suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 11px 13px;
  border-top: 1px solid rgba(100, 140, 255, 0.1);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: rgba(4, 7, 18, 0.7);
  border: 1px solid rgba(100, 140, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
  backdrop-filter: blur(8px);
}

.chat-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
}
.chat-input::placeholder {
  color: var(--text3);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  box-shadow: 0 2px 10px rgba(79, 142, 247, 0.35);
}

.chat-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(79, 142, 247, 0.5);
}
.chat-send-btn:disabled {
  background: var(--border2);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */

@media (max-width: 860px) {
  .login-container {
    flex-direction: column;
    max-width: 440px;
    min-height: auto;
  }
  .login-left {
    border-right: none;
    border-bottom: 1px solid rgba(100, 140, 255, 0.08);
    padding: 32px 28px;
  }
  .login-divider-v {
    display: none;
  }
  .login-right {
    width: 100%;
    padding: 32px 28px;
  }
  .login-tagline h1 {
    font-size: 28px;
  }
}

@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 300px 1fr;
  }
  .activity-panel {
    display: none;
  }
  .analytics-row {
    height: 180px;
  }
}

@media (max-width: 768px) {
  #login-screen {
    padding: 20px 16px;
  }
  .sidebar {
    width: 60px;
  }
  .logo-text,
  .nav-label,
  .sidebar-footer {
    display: none;
  }
  .nav-item span:not(.nav-badge) {
    display: none;
  }
  .main-wrapper {
    margin-left: 60px;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .ticket-panel {
    display: none;
  }
  .chat-window {
    width: calc(100vw - 20px);
    right: 10px;
  }
  .analytics-row {
    grid-template-columns: 1fr;
    height: auto;
  }
}
/* ══════════════════════════════════════════════════════
   NEW TICKET MODAL
══════════════════════════════════════════════════════ */

.new-ticket-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.2s;
  box-shadow: 0 3px 12px rgba(79, 142, 247, 0.35);
}

.new-ticket-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 142, 247, 0.5);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 12, 0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-ticket {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 520px;
  background: rgba(8, 12, 24, 0.95);
  border: 1px solid rgba(100, 140, 255, 0.18);
  border-radius: 18px;
  backdrop-filter: blur(32px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 80px rgba(59, 130, 246, 0.06);
  z-index: 501;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-ticket.hidden,
.modal-overlay.hidden {
  display: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(100, 140, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.modal-title svg {
  color: var(--accent);
}

.modal-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--red-lt);
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.required {
  color: var(--red-lt);
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  background: rgba(4, 7, 18, 0.7);
  border: 1px solid rgba(100, 140, 255, 0.12);
  border-radius: var(--radius);
  padding: 10px 13px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: all 0.2s;
  resize: none;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(4, 7, 18, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-field input::placeholder,
.modal-field textarea::placeholder {
  color: var(--text3);
}

.modal-field select option {
  background: #0a0f1e;
}

.modal-ai-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: rgba(79, 142, 247, 0.06);
  border: 1px solid rgba(79, 142, 247, 0.15);
  border-radius: var(--radius);
  font-size: 12px;
  color: rgba(127, 179, 255, 0.8);
}

.modal-ai-hint svg {
  color: var(--accent);
  flex-shrink: 0;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid rgba(100, 140, 255, 0.08);
  background: rgba(255, 255, 255, 0.01);
}

.modal-cancel {
  padding: 9px 18px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: all 0.15s;
}

.modal-cancel:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.modal-submit {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.2s;
  box-shadow: 0 3px 12px rgba(79, 142, 247, 0.35);
}

.modal-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 142, 247, 0.5);
}

.modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modal-submit.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
/* ══════════════════════════════════════════════════════
   ANALYTICS PANEL
══════════════════════════════════════════════════════ */

.analytics-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 300;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

.analytics-overlay.hidden {
  display: none;
}

.analytics-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.analytics-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.analytics-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.analytics-sub {
  font-size: 13px;
  color: var(--text3);
}

.analytics-close {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: all 0.15s;
}

.analytics-close:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text3);
}

/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.kpi-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-val {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
}

.kpi-lbl {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Charts grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s;
}

.chart-card:hover {
  border-color: var(--border2);
}
.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.chart-sub {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

.chart-wrap {
  position: relative;
  height: 200px;
}

.chart-card.wide .chart-wrap {
  height: 160px;
}

@media (max-width: 900px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-card.wide {
    grid-column: 1;
  }
}
/* ── Notification button ── */
.notif-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.notif-btn:hover {
  background: rgba(79, 142, 247, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.notif-btn.active {
  background: rgba(79, 142, 247, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}
/* ── Export button ── */
.export-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.export-btn:hover {
  background: rgba(22, 163, 74, 0.1);
  border-color: var(--green);
  color: var(--green-lt);
}
