/* ===================================================
   NGUONX - ADMIN CMS DASHBOARD STYLING
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --admin-sidebar-bg: #0b132b;
  --admin-sidebar-active: #0284c7;
  --admin-bg: #f0f7ff;
  --admin-card: #ffffff;
  --admin-border: #dbeafe;
  --admin-text: #0f172a;
  --admin-muted: #64748b;
  --admin-primary: #0284c7;
  --admin-success: #059669;
  --admin-warning: #f59e0b;
  --admin-danger: #ef4444;
  --admin-radius: 10px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 15px rgba(0,0,0,0.15);
}

.admin-brand {
  padding: 18px 16px 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.admin-brand-img {
  width: 100%;
  max-width: 228px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  object-fit: contain;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
  margin: 0 auto;
}

.admin-brand-img:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.admin-brand h3 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.3px;
  margin: 0;
}

.admin-brand span {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.admin-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--admin-radius);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 4px;
  transition: all 0.2s;
  cursor: pointer;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-nav-item.active {
  background: var(--admin-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.admin-nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* Admin Main */
.admin-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: var(--admin-card);
  border-bottom: 1px solid var(--admin-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-topbar h2 {
  font-size: 18px;
  font-weight: 800;
}

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

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--admin-card);
  padding: 20px;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon-wrapper.indigo { background: #e0f2fe; color: #0284c7; }
.stat-icon-wrapper.green { background: #d1fae5; color: #059669; }
.stat-icon-wrapper.amber { background: #fef3c7; color: #d97706; }
.stat-icon-wrapper.purple { background: #ccfbf1; color: #0d9488; }

.stat-info h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--admin-text);
  margin-top: 4px;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Admin Card Container */
.panel-card {
  background: var(--admin-card);
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Admin Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: #f1f5f9;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #f8fafc;
}

/* Badges */
.badge-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-status.active, .badge-status.completed { background: #d1fae5; color: #065f46; }
.badge-status.banned, .badge-status.failed, .badge-status.refunded { background: #fee2e2; color: #991b1b; }
.badge-status.admin { background: #ede9fe; color: #5b21b6; }
.badge-status.user { background: #e0e7ff; color: #3730a3; }

/* Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-admin.primary { background: var(--admin-primary); color: #fff; }
.btn-admin.primary:hover { background: #0369a1; }
.btn-admin.success { background: var(--admin-success); color: #fff; }
.btn-admin.danger { background: var(--admin-danger); color: #fff; }
.btn-admin.sm { padding: 4px 10px; font-size: 12px; }

/* Bulk stock textarea */
.stock-bulk-textarea {
  width: 100%;
  height: 220px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 14px;
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid #334155;
  border-radius: 8px;
  resize: vertical;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--admin-card);
  border-radius: 12px;
  width: 520px;
  max-width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--admin-border);
  animation: adminModalFadeIn 0.2s ease-out;
}

@keyframes adminModalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Admin Live Chat Monitor Layout */
.admin-chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 680px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
}

.admin-chat-sidebar {
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.admin-chat-search-bar {
  padding: 12px;
  border-bottom: 1px solid var(--admin-border);
  background: #ffffff;
}

.admin-chat-session-list {
  flex: 1;
  overflow-y: auto;
}

.admin-chat-session-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-chat-session-item:hover {
  background: #f1f5f9;
}

.admin-chat-session-item.active {
  background: #e0f2fe;
  border-left: 4px solid var(--admin-primary);
}

.admin-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.admin-chat-item-content {
  flex: 1;
  min-width: 0;
}

.admin-chat-item-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-chat-item-time {
  font-size: 11px;
  color: var(--admin-muted);
  font-weight: 400;
}

.admin-chat-item-msg {
  font-size: 12px;
  color: var(--admin-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.admin-chat-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Admin Chat Main Window */
.admin-chat-window {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.admin-chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.admin-chat-messages-area {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-chat-input-area {
  padding: 14px 18px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  gap: 10px;
  background: #ffffff;
}

.admin-chat-textarea {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.admin-chat-textarea:focus {
  border-color: var(--admin-primary);
}

/* Activity Logs specific styling */
.log-action-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.log-action-tag.auth { background: #e0f2fe; color: #0369a1; }
.log-action-tag.order { background: #dcfce7; color: #15803d; }
.log-action-tag.wallet { background: #fef9c3; color: #a16207; }
.log-action-tag.product { background: #f3e8ff; color: #7e22ce; }
.log-action-tag.settings { background: #fee2e2; color: #b91c1c; }
.log-action-tag.system { background: #f1f5f9; color: #475569; }

/* Language Switcher Dropdown (Admin Topbar) */
.lang-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.lang-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  padding: 0 10px;
  height: 36px;
  border-radius: 8px;
  color: var(--admin-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.lang-dropdown-trigger:hover {
  background: #f8fafc;
  border-color: var(--admin-primary);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2);
}

.lang-current-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-flag-svg {
  display: block;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  object-fit: cover;
}

.lang-current-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--admin-text);
}

.lang-chevron {
  font-size: 11px;
  color: var(--admin-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 2px;
}

.lang-dropdown-wrapper.open .lang-chevron {
  transform: rotate(180deg);
  color: var(--admin-primary);
}

.lang-dropdown-wrapper.open .lang-dropdown-trigger {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.04);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.lang-dropdown-wrapper.open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--admin-text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.lang-dropdown-item:hover {
  background: #f0f9ff;
  color: var(--admin-primary);
}

.lang-dropdown-item.active {
  background: rgba(2, 132, 199, 0.12);
  color: var(--admin-primary);
  font-weight: 700;
}

.lang-item-name {
  flex: 1;
  white-space: nowrap;
}

.lang-item-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--admin-muted);
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 4px;
}

.lang-check-icon {
  font-size: 11px;
  color: var(--admin-primary);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.lang-dropdown-item.active .lang-check-icon {
  opacity: 1;
}

