:root {
  --bg-dark: #07090f;
  --bg-sidebar: #0c101b;
  --bg-card: rgba(18, 24, 39, 0.85);
  --bg-input: rgba(10, 14, 24, 0.9);
  --primary: #10b981;
  --primary-hover: #059669;
  --accent-purple: #8b5cf6;
  --accent-blue: #38bdf8;
  --accent-gold: #fbbf24;
  --accent-red: #f43f5e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --radius-lg: 16px;
  --radius-md: 12px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.ambient-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
}

.glow-purple {
  top: -150px;
  left: -100px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
}

.glow-emerald {
  bottom: -150px;
  right: -100px;
  background: radial-gradient(circle, #10b981, transparent 70%);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
}

/* ================= LOGIN SCREEN ================= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  max-width: 440px;
  width: 100%;
  padding: 36px 32px;
  border-color: rgba(139, 92, 246, 0.3);
}

.login-brand {
  text-align: center;
  margin-bottom: 26px;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  image-rendering: pixelated;
  border: 2px solid var(--primary);
  margin-bottom: 12px;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.security-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 10px auto;
  font-size: 0.7rem;
  font-weight: 800;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.8px;
}

.login-brand h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-brand p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 7px;
  color: #cbd5e1;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-icon-wrap input {
  padding-left: 42px !important;
  padding-right: 42px !important;
}

.toggle-pass-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

input[type="text"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.login-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-login-submit {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
  transition: var(--transition);
}

.btn-login-submit:hover {
  transform: translateY(-2px);
}

.login-footer-hint {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ================= ADMIN LAYOUT ================= */
.admin-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

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

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

@media (max-width: 960px) {
  .sidebar {
    position: relative;
    height: auto;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  image-rendering: pixelated;
  border: 2px solid var(--primary);
}

.sidebar-brand strong {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.sidebar-brand span {
  font-size: 0.68rem;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 1.4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  padding: 10px 12px 4px 12px;
  letter-spacing: 1px;
}

.side-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: var(--transition);
}

.side-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.side-btn.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.side-badge {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
.badge-gold { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

.sidebar-quick-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.sidebar-quick-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-quick-links a:hover {
  color: var(--accent-blue);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.sidebar-user img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  image-rendering: pixelated;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.admin-user-info strong {
  font-size: 0.88rem;
  color: #fff;
}

.admin-user-info span {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
}

.btn-logout {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
}

/* ================= TOPBAR & CONTENT ================= */
.main-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: rgba(12, 16, 27, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.topbar-left h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.sync-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.topbar-right {
  display: flex;
  gap: 10px;
}

.btn-top-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-top-action.primary {
  background: var(--primary);
  color: #042f2e;
  border-color: var(--primary);
}

.content-area {
  padding: 26px 28px;
  flex: 1;
}

.admin-pane {
  display: none;
}

.admin-pane.active {
  display: block;
  animation: fadeSlide 0.35s ease forwards;
}

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

/* STATS CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.icon-red { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.icon-gold { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }

.stat-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-info h3 {
  font-size: 1.55rem;
  font-weight: 800;
  margin: 2px 0;
}

.stat-info small {
  font-size: 0.74rem;
  color: #64748b;
}

/* PANELS & DUAL GRID */
.dashboard-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
}

.panel-box {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.panel-header h3 {
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.84rem;
}

.compact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-item {
  background: rgba(10, 14, 24, 0.75);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.compact-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

/* TICKETS GRID */
.filter-group {
  display: flex;
  gap: 10px;
}

.filter-group select, .filter-group input {
  width: auto;
  min-width: 190px;
}

.ticket-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.adm-ticket-card {
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.adm-ticket-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-blue);
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-pending { background: rgba(251, 191, 36, 0.16); color: #fbbf24; }
.status-processing { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }
.status-resolved { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.status-rejected { background: rgba(244, 63, 94, 0.16); color: #fb7185; }

/* DEPOSITS LIST */
.deposit-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deposit-row-card {
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.dep-user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dep-user-box img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  image-rendering: pixelated;
}

.dep-cmd-box {
  background: #05070c;
  border: 1px dashed rgba(16, 185, 129, 0.35);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dep-actions {
  display: flex;
  gap: 8px;
}

/* SWITCH TOGGLE & FORMS */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 14, 24, 0.65);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  border-radius: 12px;
}

.toggle-row.warn-box {
  border-color: rgba(251, 191, 36, 0.28);
}

.toggle-row strong {
  display: block;
  font-size: 0.9rem;
}

.toggle-row small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.switch-toggle {
  width: 46px;
  height: 24px;
  appearance: none;
  background: #334155;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.switch-toggle::after {
  content: "";
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: var(--transition);
}

.switch-toggle:checked {
  background: var(--primary);
}

.switch-toggle:checked::after {
  left: 25px;
}

.panel-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 18px 0;
}

.form-row-2, .price-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.full-col {
  grid-column: 1 / -1;
}

.button-row-flex {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary-glow {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-discord-send {
  background: #5865f2;
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger-outline {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.full-w {
  width: 100%;
}

/* MODAL CHI TIẾT KHIẾU NẠI */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #111728;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  padding: 26px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.14);
  padding: 4px 12px;
  border-radius: 999px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.adm-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.adm-ticket-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.evidence-bar {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
}

.evidence-bar a {
  color: var(--accent-blue);
  word-break: break-all;
}

.conversation-box {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 6px;
}

.msg-bubble {
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.msg-player {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
}

.msg-admin {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.msg-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.adm-reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.right-btns {
  display: flex;
  gap: 8px;
}

.btn-quick-resolve {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-item {
  background: rgba(17, 23, 38, 0.96);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 14px 18px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  }
