@font-face {
  font-family: "Mont";
  src: url("../_next/static/media/Mont_SemiBold-s.p.16amqj5m57x8i.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Onder";
  src: url("../_next/static/media/Onder-s.p.03f~ufnqeu9k8.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #4a89ff;
  --accent-soft: rgba(74, 137, 255, 0.12);
  --accent-glow: rgba(74, 137, 255, 0.25);
  --bg: #07080d;
  --surface: rgba(18, 20, 30, 0.72);
  --surface-2: rgba(26, 29, 43, 0.9);
  --border: rgba(74, 137, 255, 0.1);
  --text: #fff;
  --muted: #8c8ba5;
  --green: #8fffab;
  --gold: #ffd56a;
  --red: #ff7b7b;
  --font: "Mont", system-ui, sans-serif;
  --font-display: "Onder", sans-serif;
  --radius: 14px;
}

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

body {
  font-family: var(--font);
  background: radial-gradient(circle at 50% -20%, #1f375f 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Language switcher — top right */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(74, 137, 255, 0.25);
  background: rgba(18, 20, 30, 0.88);
  backdrop-filter: blur(12px);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.lang-trigger:hover,
.lang-trigger[aria-expanded="true"] {
  border-color: rgba(74, 137, 255, 0.45);
  background: rgba(26, 29, 43, 0.95);
  box-shadow: 0 6px 24px rgba(74, 137, 255, 0.15);
}

.lang-trigger-flag {
  font-size: 18px;
  line-height: 1;
}

.lang-trigger-label {
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--muted);
}

.lang-trigger-chevron {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 0.2s;
}

.lang-trigger[aria-expanded="true"] .lang-trigger-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(74, 137, 255, 0.2);
  background: rgba(18, 20, 30, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  animation: langMenuIn 0.18s ease;
}

.lang-menu[hidden] {
  display: none !important;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-option:hover {
  background: rgba(74, 137, 255, 0.1);
}

.lang-option.active {
  background: rgba(74, 137, 255, 0.16);
}

.lang-option-flag {
  font-size: 20px;
  line-height: 1;
  width: 24px;
  text-align: center;
}

.lang-option-label {
  flex: 1;
}

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

.lang-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(74, 137, 255, 0.25);
}

.detail-lang {
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.view-toggle {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.view-toggle button {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.view-toggle button.active {
  background: #fff;
  color: #1a3a7a;
  font-weight: 600;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.bg-orb.a {
  width: 400px;
  height: 400px;
  background: rgba(74, 137, 255, 0.08);
  top: -100px;
  right: -80px;
}

.bg-orb.b {
  width: 300px;
  height: 300px;
  background: rgba(74, 137, 255, 0.05);
  bottom: 10%;
  left: -60px;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* ── Customer header ── */
.support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  animation: fadeUp 0.5s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
}

.brand-text span { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.user-chip-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-chip-meta strong {
  font-size: 13px;
}

.user-chip-meta span {
  font-size: 11px;
  color: var(--muted);
}

.avatar {
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface-2);
}

.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
}

.avatar-customer {
  background: linear-gradient(145deg, #2a3f6a 0%, #4a89ff 100%);
  color: #fff;
  border: 2px solid rgba(74, 137, 255, 0.35);
  box-shadow: 0 2px 12px rgba(74, 137, 255, 0.2);
}

.avatar-sm.avatar-initials { font-size: 11px; }
.avatar-md.avatar-initials { font-size: 13px; }
.avatar-lg.avatar-initials { font-size: 15px; }
.avatar-chat.avatar-initials { font-size: 12px; }

.avatar-staff,
.msg-staff .avatar-chat {
  border: 2px solid rgba(74, 137, 255, 0.5);
  background: rgba(74, 137, 255, 0.1);
  padding: 4px;
  object-fit: contain;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 38px; height: 38px; }
.avatar-lg { width: 44px; height: 44px; }
.avatar-chat { width: 36px; height: 36px; }

.btn-icon {
  padding: 10px 12px;
  min-width: 44px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(12px);
}

.btn:hover {
  border-color: rgba(74, 137, 255, 0.35);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #4a89ff, #1a62ff);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(74, 137, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(74, 137, 255, 0.45);
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.hero-mini {
  margin-bottom: 24px;
  animation: fadeUp 0.55s ease 0.05s both;
}

.hero-mini h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 400;
  margin-bottom: 8px;
}

.hero-mini h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-mini p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 520px;
}

/* ── Layout ── */
.support-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  min-height: 520px;
  animation: fadeUp 0.6s ease 0.1s both;
}

.ticket-sidebar,
.chat-panel,
.admin-inbox,
.admin-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.sidebar-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-head h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ticket-list { list-style: none; }

.ticket-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.ticket-item:hover { background: rgba(74, 137, 255, 0.06); }

.ticket-item.active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: 15px;
}

.ticket-item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ticket-item-body {
  min-width: 0;
  flex: 1;
}

.ticket-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ticket-id {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.ticket-subject {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-meta {
  font-size: 11px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-open { background: rgba(74, 137, 255, 0.2); color: #7eb8ff; }
.badge-reply { background: rgba(255, 213, 106, 0.15); color: var(--gold); }
.badge-resolved { background: rgba(143, 255, 171, 0.12); color: var(--green); }
.badge-waiting { background: rgba(255, 123, 123, 0.12); color: var(--red); }

/* ── Chat ── */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: calc(100vh - 260px);
}

.chat-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.chat-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-agent-name { color: var(--accent); }

.chat-head h3 { font-size: 16px; margin-bottom: 4px; }

.chat-head-meta {
  font-size: 12px;
  color: var(--muted);
}

.chat-head-meta code {
  color: var(--accent);
  font-size: 11px;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100px;
  min-width: 0;
}

.msg {
  max-width: 88%;
  animation: msgIn 0.35s ease both;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

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

.msg-content {
  min-width: 0;
  max-width: 100%;
}

.msg-user { align-self: flex-end; }
.msg-staff { align-self: flex-start; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
}

.msg-user .msg-bubble {
  background: linear-gradient(135deg, #4a89ff, #2d6ae0);
  border-bottom-right-radius: 4px;
}

.msg-staff .msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-system .msg-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.msg-sender {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  padding: 0 4px;
}

.msg-user .msg-sender { text-align: right; }

.msg-staff .msg-sender strong { color: var(--accent); }

.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.msg-image {
  display: block;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
  max-width: 220px;
  transition: transform 0.15s, border-color 0.2s;
}

.msg-image:hover {
  transform: scale(1.02);
  border-color: rgba(74, 137, 255, 0.45);
}

.msg-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
}

.msg-image-name {
  display: block;
  padding: 6px 8px;
  font-size: 10px;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(920px, 100%);
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.upload-preview.hidden { display: none; }

.upload-preview-img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.upload-preview-meta {
  flex: 1;
  min-width: 0;
}

.upload-preview-meta strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.upload-preview-meta span {
  font-size: 11px;
  color: var(--muted);
}

.upload-preview-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.msg-time {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  padding: 0 4px;
}

.msg-user .msg-time { text-align: right; }

.msg-key-box {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--green);
  word-break: break-all;
}

.chat-compose {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.compose-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.compose-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  resize: none;
  line-height: 1.4;
}

.compose-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.compose-input::placeholder { color: #5c5b72; }

/* ── New ticket modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: modalIn 0.3s ease;
}

.modal-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 { font-size: 16px; }

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-body { padding: 20px; }

.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

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

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-foot {
  padding: 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Admin view ── */
.admin-view { display: none; }

.admin-view.active { display: block; }

.customer-view.active { display: block; }

.customer-view:not(.active) { display: none; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeUp 0.5s ease;
}

.admin-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
}

.admin-stat span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.admin-stat strong {
  font-size: 26px;
  font-weight: 600;
}

.admin-stat strong.gold { color: var(--gold); }
.admin-stat strong.green { color: var(--green); }

.admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr 240px;
  gap: 14px;
  min-height: 540px;
  animation: fadeUp 0.55s ease 0.08s both;
}

.admin-inbox .ticket-item { padding: 12px 16px; }

.admin-detail {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-detail h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-row {
  font-size: 13px;
  line-height: 1.5;
}

.detail-row strong {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
}

.admin-reply-bar {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.admin-reply-bar .select {
  margin-bottom: 10px;
  font-size: 12px;
  padding: 8px 12px;
}

.template-panel {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.template-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.template-panel-head h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.template-hint {
  font-size: 10px;
  color: var(--muted);
}

.template-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.template-card:hover {
  border-color: rgba(74, 137, 255, 0.45);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.template-card strong {
  font-size: 12px;
}

.template-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(74, 137, 255, 0.12);
  padding: 2px 6px;
  border-radius: 999px;
}

.template-preview {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-customer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.detail-customer-head strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.detail-customer-head span {
  font-size: 11px;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.admin-actions .btn { flex: 1; justify-content: center; font-size: 12px; padding: 9px 12px; }

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 20px 8px;
}

.typing-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing 1.2s infinite;
}

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

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

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

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

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

#support-gate[hidden],
#support-app[hidden],
#chat-placeholder[hidden],
#chat-head[hidden],
#chat-messages[hidden],
#chat-compose[hidden],
#ticket-empty[hidden] {
  display: none !important;
}

.support-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 24px;
  animation: fadeUp 0.45s ease;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  backdrop-filter: blur(12px);
  text-align: center;
}

.gate-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 14px;
}

.gate-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 8px;
}

.gate-card > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.gate-card .field { text-align: left; margin-bottom: 16px; }
.gate-btn { width: 100%; margin-top: 4px; }
.gate-hint { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.5; }

.chat-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  padding: 40px;
}

.sidebar-empty {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.support-status {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  z-index: 50;
  pointer-events: none;
}

.support-status.ok { border-color: rgba(143, 255, 171, 0.3); color: var(--green); }
.support-status.err { border-color: rgba(255, 123, 123, 0.3); color: var(--red); }

.badge-waiting {
  background: rgba(255, 213, 106, 0.12);
  color: var(--gold);
  border: 1px solid rgba(255, 213, 106, 0.2);
}

@media (max-width: 900px) {
  .support-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .template-list {
    grid-template-columns: 1fr;
  }

  .ticket-sidebar { max-height: 220px; overflow-y: auto; }

  .admin-detail { order: -1; }
}

@media (max-width: 520px) {
  .lang-switcher { top: 12px; right: 12px; }
  .lang-trigger { padding: 7px 10px 7px 8px; gap: 6px; }
  .lang-trigger-label { display: none; }
  .support-header { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; justify-content: center; }
  .user-chip { width: 100%; }
  .user-chip-meta { flex: 1; }
  .chat-head-main { align-items: flex-start; }
}
