/* ========================================================
   ĐÀI QUAN SÁT QUẢN TRỊ (ADMIN OBSERVATORY) - STYLES
   Phong cách Nocturnal Dark Glassmorphism sang trọng
======================================================== */

@font-face {
  font-family: Cormorant;
  src: url('assets/fonts/cormorant-garamond/CormorantGaramond-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Cormorant;
  src: url('assets/fonts/cormorant-garamond/CormorantGaramond-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('assets/fonts/cormorant-garamond/CormorantGaramond-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('assets/fonts/cormorant-garamond/CormorantGaramond-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: BeVietnam;
  src: url('assets/fonts/be-vietnam-pro/BeVietnamPro-Regular.ttf');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: BeVietnam;
  src: url('assets/fonts/be-vietnam-pro/BeVietnamPro-SemiBold.ttf');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: BeVietnam;
  src: url('assets/fonts/be-vietnam-pro/BeVietnamPro-Bold.ttf');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  src: url('assets/fonts/be-vietnam-pro/BeVietnamPro-Regular.ttf');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  src: url('assets/fonts/be-vietnam-pro/BeVietnamPro-SemiBold.ttf');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  src: url('assets/fonts/be-vietnam-pro/BeVietnamPro-Bold.ttf');
  font-weight: 700;
  font-display: swap;
}

:root {
  --admin-bg: #06090e;
  --admin-surface: rgba(13, 20, 28, 0.75);
  --admin-surface-card: rgba(16, 26, 38, 0.65);
  --admin-surface-hover: rgba(24, 38, 54, 0.85);
  --admin-border: rgba(212, 175, 55, 0.18);
  --admin-border-subtle: rgba(255, 255, 255, 0.08);
  --admin-text-main: #f1f5f9;
  --admin-text-muted: #94a3b8;
  --admin-text-dim: #64748b;
  --admin-gold: #d4af37;
  --admin-gold-glow: rgba(212, 175, 55, 0.35);
  --admin-emerald: #10b981;
  --admin-sky: #38bdf8;
  --admin-purple: #c084fc;
  --admin-danger: #ef4444;
  --admin-radius-sm: 8px;
  --admin-radius-md: 14px;
  --admin-radius-lg: 20px;
}

html {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto !important;
}

body.admin-body {
  margin: 0;
  padding: 0;
  background-color: var(--admin-bg);
  background-image: 
    radial-gradient(ellipse at 15% 10%, rgba(212, 175, 55, 0.06), transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(16, 185, 129, 0.04), transparent 50%),
    linear-gradient(180deg, #06090e 0%, #0a0f16 100%);
  background-attachment: fixed;
  color: var(--admin-text-main);
  font-family: 'BeVietnam', 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #06090e;
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
}

*, *::before, *::after {
  box-sizing: inherit;
}

.hidden {
  display: none !important;
}

/* ----------------------------------------------------
   1. CỔNG ĐĂNG NHẬP BÍ MẬT (LOGIN OVERLAY)
---------------------------------------------------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px var(--admin-gold-glow);
  text-align: center;
  animation: modalFadeIn 0.4s ease-out forwards;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--admin-border);
  color: var(--admin-gold);
  margin-bottom: 1.25rem;
  box-shadow: 0 0 15px var(--admin-gold-glow);
}

.login-title {
  margin: 0 0 0.5rem 0;
  font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}

.login-desc {
  margin: 0 0 2rem 0;
  font-size: 0.88rem;
  color: var(--admin-text-muted);
  line-height: 1.5;
}

.login-form .input-group {
  text-align: left;
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-muted);
  margin-bottom: 0.5rem;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input,
.input-group input[type="number"],
.input-group input[type="text"] {
  width: 100%;
  background: rgba(8, 14, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--admin-radius-sm);
  padding: 0.85rem 1rem;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.password-wrapper input:focus,
.input-group input:focus {
  border-color: var(--admin-gold);
  box-shadow: 0 0 10px var(--admin-gold-glow);
}

.toggle-pw-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  padding: 0.35rem;
  font-size: 1rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.75rem;
  border-radius: var(--admin-radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: left;
}

.login-env-box {
  margin-bottom: 1.25rem;
  text-align: left;
}

.login-env-box .env-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-muted);
  margin-bottom: 0.5rem;
}

.login-env-box .admin-env-select {
  width: 100%;
}

.login-status-msg {
  margin-top: 0.85rem;
  padding: 0.6rem 0.85rem;
  background: rgba(212, 163, 89, 0.12);
  border: 1px solid rgba(212, 163, 89, 0.3);
  border-radius: var(--admin-radius-sm);
  font-size: 0.85rem;
  color: var(--admin-gold);
  text-align: center;
  line-height: 1.4;
  animation: adminPulse 1.8s infinite alternate ease-in-out;
}

@keyframes adminPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.login-footer {
  margin-top: 1.75rem;
}

.back-link {
  color: var(--admin-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--admin-gold);
}

/* ----------------------------------------------------
   2. BUTTONS & CHIPS
---------------------------------------------------- */
.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.7rem 1.25rem;
  border-radius: var(--admin-radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #d4af37 0%, #aa8524 100%);
  color: #06090e;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.admin-btn-primary:hover {
  background: linear-gradient(135deg, #e3c048 0%, #bd952a 100%);
  transform: translateY(-1px);
}

.admin-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-text-main);
  border: 1px solid var(--admin-border-subtle);
}

.admin-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.admin-btn-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.admin-btn-warning:hover {
  background: rgba(245, 158, 11, 0.26);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.admin-btn-success {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.admin-btn-success:hover {
  background: rgba(16, 185, 129, 0.26);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.admin-btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
}

/* ----------------------------------------------------
   3. BẢNG ĐIỀU KHIỂN CHÍNH (LAYOUT & HEADER)
---------------------------------------------------- */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  height: 64px;
  background: rgba(8, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
}

.brand-glyph {
  font-size: 1.25rem;
}

.brand-title {
  font-family: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.divider {
  color: var(--admin-text-dim);
}

.badge-station {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  color: var(--admin-gold);
}

.header-env-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--admin-border-subtle);
}

.env-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-muted);
}

.admin-env-select {
  background: transparent;
  color: var(--admin-gold);
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.admin-env-select option {
  background: #091018;
  color: #fff;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--admin-emerald);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-emerald);
  box-shadow: 0 0 8px var(--admin-emerald);
  animation: pulseDot 2s infinite;
}

.status-pulse-dot.is-maintenance {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseDotMaintenance 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseDotMaintenance {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.header-status.is-maintenance .status-text {
  color: #fbbf24;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ----------------------------------------------------
   4. KPI CARDS GRID
---------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  padding: 1.25rem 1.25rem 1.1rem 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

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

.kpi-highlight {
  border-color: var(--admin-border);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.08);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-text-muted);
}

.kpi-icon {
  font-size: 1.2rem;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--admin-text-dim);
}

.kpi-sub strong {
  color: var(--admin-text-main);
}

.text-gold { color: var(--admin-gold) !important; }
.text-emerald { color: var(--admin-emerald) !important; }
.text-sky { color: var(--admin-sky) !important; }
.text-purple { color: var(--admin-purple) !important; }

/* ----------------------------------------------------
   5. VISUALS & CHARTS SECTION
---------------------------------------------------- */
.visuals-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
}

.panel-box {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.panel-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.82rem;
  color: var(--admin-text-muted);
}

.panel-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border-subtle);
  border-radius: 4px;
  color: var(--admin-text-muted);
}

/* SVG Chart */
.chart-container {
  position: relative;
  width: 100%;
  height: 220px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-tooltip {
  position: absolute;
  padding: 0.5rem 0.75rem;
  background: rgba(10, 16, 24, 0.95);
  border: 1px solid var(--admin-gold);
  border-radius: 6px;
  color: #fff;
  font-size: 0.75rem;
  pointer-events: none;
  transform: translate(-50%, -120%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  z-index: 10;
}

/* Conversion Funnel */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.funnel-step {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.funnel-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

.funnel-label strong {
  color: #fff;
}

.progress-bar-bg {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #fff;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-sky { background: var(--admin-sky); }
.fill-purple { background: var(--admin-purple); }
.fill-gold { background: var(--admin-gold); }
.fill-emerald { background: var(--admin-emerald, #10b981); }

#refreshBtn.is-spinning svg {
  animation: adminSpin 0.7s linear infinite;
}

@keyframes adminSpin {
  100% { transform: rotate(360deg); }
}

/* Sources List */
.sources-title {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-text-muted);
}

.sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

.source-item .source-badge {
  font-weight: 600;
  color: var(--admin-gold);
}

/* ----------------------------------------------------
   6. LIVE ORDERS LEDGER
---------------------------------------------------- */
.ledger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ledger-filters {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border-subtle);
  color: var(--admin-text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--admin-border);
  color: var(--admin-gold);
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table th {
  padding: 0.75rem 1rem;
  color: var(--admin-text-muted);
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--admin-text-main);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.paid {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.pending {
  background: rgba(212, 175, 55, 0.12);
  color: #f3d882;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.status-badge.failed, .status-badge.expired {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.text-right {
  text-align: right;
}

/* ----------------------------------------------------
   7. FEEDBACK GRID
---------------------------------------------------- */
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.feedback-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-date {
  font-size: 0.72rem;
  color: var(--admin-text-dim);
}

.feedback-stars {
  color: var(--admin-gold);
  font-size: 0.85rem;
}

.feedback-category {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--admin-sky);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.feedback-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--admin-text-main);
  line-height: 1.45;
  font-style: italic;
}

.empty-state {
  color: var(--admin-text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem;
  margin: 0;
}

/* ----------------------------------------------------
   8. CONFIG DIALOG (MODAL)
---------------------------------------------------- */
.admin-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 480px;
  width: 90%;
  border-radius: var(--admin-radius-lg);
}

.admin-dialog::backdrop {
  background: rgba(4, 7, 12, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dialog-content {
  background: #0d1520;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-lg);
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dialog-title {
  margin: 0;
  font-size: 1.25rem;
  color: #fff;
}

.close-dialog-btn {
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--admin-text-dim);
  margin-top: 0.35rem;
}

.toggle-group {
  display: flex;
  align-items: center;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.switch-label input {
  display: none;
}

.switch-slider {
  width: 42px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  position: relative;
  transition: background 0.3s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.switch-label input:checked + .switch-slider {
  background: var(--admin-emerald);
}

.switch-label input:checked + .switch-slider::before {
  transform: translateX(18px);
}

.switch-text {
  font-size: 0.88rem;
  color: var(--admin-text-main);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 0.6rem 0.85rem;
  border-radius: var(--admin-radius-sm);
  font-size: 0.82rem;
}

/* ----------------------------------------------------
   9. RESPONSIVE BREAKPOINTS
---------------------------------------------------- */
@media (max-width: 900px) {
  .visuals-grid {
    grid-template-columns: 1fr;
  }
  .admin-header {
    padding: 0 1rem;
  }
  .btn-text {
    display: none;
  }
}

@media (max-width: 600px) {
  .dashboard-main {
    padding: 1rem;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .header-brand .brand-title {
    display: none;
  }
  .badge-station {
    font-size: 0.7rem;
  }
}

/* ----------------------------------------------------
   10. SUPPORT DESK & TOAST NOTIFICATION
---------------------------------------------------- */
.support-panel {
  margin-top: 1.5rem;
}

.text-danger {
  color: var(--admin-danger) !important;
}

.ticket-type-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.ticket-type-payment {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.ticket-type-refund {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.ticket-type-feedback {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.ticket-type-general {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.badge-status-in_progress {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.badge-status-resolved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-status-refunded {
  background: rgba(192, 132, 252, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.ticket-msg-cell {
  max-width: 280px;
  line-height: 1.4;
}
.ticket-msg-text {
  font-size: 0.85rem;
  color: var(--admin-text-main);
  margin-bottom: 0.25rem;
  word-break: break-word;
}
.ticket-bank-info {
  display: block;
  font-size: 0.78rem;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}
.ticket-reply-preview {
  display: block;
  font-size: 0.78rem;
  color: #34d399;
  margin-top: 0.25rem;
  font-style: italic;
}

.support-actions-cell {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-action-unlock {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.76rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-action-unlock:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
}

.btn-action-refund {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.76rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-action-refund:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.btn-action-reply {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #d4af37;
  font-size: 0.76rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-action-reply:hover {
  background: rgba(212, 175, 55, 0.3);
  color: #fff;
}

/* Toast Thông Báo Trong Admin */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 20px;
  background: rgba(13, 20, 28, 0.95);
  border: 1px solid var(--admin-gold);
  border-radius: var(--admin-radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  color: var(--admin-text-main);
  font-size: 0.88rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastFadeIn 0.25s ease-out;
}
.admin-toast.toast-success {
  border-color: var(--admin-emerald);
  color: #a7f3d0;
}
.admin-toast.toast-error {
  border-color: var(--admin-danger);
  color: #fca5a5;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

