/* ===================================================================
   VIETNAMRB.COM - ADMIN DASHBOARD STYLESHEET
   Style: Dark Cyber-Red Executive Admin Dashboard
   Author: HESCO
   =================================================================== */

:root {
  --admin-bg: #0f172a;
  --admin-sidebar: #090e1a;
  --admin-card: #1e293b;
  --admin-card-hover: #273549;
  --admin-border: #334155;
  --admin-text: #f8fafc;
  --admin-text-muted: #94a3b8;
  
  --admin-red: #e62327;
  --admin-red-glow: rgba(230, 35, 39, 0.35);
  --admin-green: #10b981;
  --admin-amber: #f59e0b;
  --admin-blue: #3b82f6;
  --admin-purple: #8b5cf6;

  --font-main: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;
}

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

body.admin-body {
  font-family: var(--font-main);
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
}

/* Layout Wrapper */
.admin-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.admin-sidebar {
  width: 270px;
  background-color: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

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

.admin-logo-box {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.admin-logo-badge {
  background: linear-gradient(135deg, #e62327, #991b1b);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 15px var(--admin-red-glow);
}

.admin-logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
}

.admin-logo-text span {
  color: var(--admin-red);
}

.sidebar-tag {
  font-size: 0.65rem;
  background: rgba(230, 35, 39, 0.2);
  color: #f87171;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 2px;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-category-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 14px 4px;
}

.sidebar-item-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.sidebar-item-btn i {
  font-size: 1.25rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.sidebar-item-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar-item-btn:hover i {
  color: #fff;
}

.sidebar-item-btn.active {
  background: linear-gradient(90deg, rgba(230, 35, 39, 0.2), rgba(230, 35, 39, 0.05));
  color: #fff;
  border-left: 3px solid var(--admin-red);
}

.sidebar-item-btn.active i {
  color: var(--admin-red);
}

.badge-counter {
  margin-left: auto;
  background: var(--admin-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 100px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--admin-border);
  background: rgba(0, 0, 0, 0.2);
}

.admin-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e62327, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 0 10px rgba(230, 35, 39, 0.4);
}

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

.admin-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 0.72rem;
  color: #f59e0b;
  font-weight: 600;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.admin-main {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navbar */
.admin-topbar {
  height: 68px;
  background: var(--admin-sidebar);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.server-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulseDot 1.8s 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); }
}

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

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

.btn-admin-red {
  background: var(--admin-red);
  color: #fff;
  box-shadow: 0 4px 12px var(--admin-red-glow);
}

.btn-admin-red:hover {
  background: #c0151a;
  transform: translateY(-1px);
}

.btn-admin-outline {
  background: transparent;
  color: #94a3b8;
  border: 1px solid var(--admin-border);
}

.btn-admin-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-admin-green {
  background: var(--admin-green);
  color: #fff;
}

.btn-admin-green:hover {
  background: #059669;
}

/* Page Body */
.admin-page-container {
  padding: 28px;
  flex: 1;
}

/* Tab Sections */
.admin-tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.admin-tab-pane.active {
  display: block;
}

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

/* ==========================================
   KPI OVERVIEW CARDS
   ========================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 35, 39, 0.4);
}

.kpi-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.kpi-red { background: rgba(230, 35, 39, 0.15); color: #f87171; }
.kpi-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.kpi-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.kpi-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.kpi-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.kpi-info {
  flex: 1;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.kpi-meta {
  font-size: 0.72rem;
  color: #34d399;
  font-weight: 600;
  margin-top: 4px;
}

/* ==========================================
   CONTENT CARD BOXES
   ========================================== */
.admin-card-box {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-box-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-box-title i {
  color: var(--admin-red);
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-admin {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--admin-border);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
  min-width: 240px;
}

.search-input-admin:focus {
  border-color: var(--admin-red);
}

.select-filter-admin {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--admin-border);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}

/* ==========================================
   DATA TABLES
   ========================================== */
.table-responsive-admin {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
}

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

.admin-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 14px 16px;
  color: var(--admin-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  vertical-align: middle;
  color: #cbd5e1;
}

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

.admin-table tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-active { background: rgba(230, 35, 39, 0.15); color: #f87171; border: 1px solid rgba(230, 35, 39, 0.3); }
.badge-completed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Progress bar inside table */
.table-progress-wrap {
  width: 110px;
}

.table-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.table-progress-bar {
  height: 6px;
  background: #334155;
  border-radius: 10px;
  overflow: hidden;
}

.table-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e62327, #f59e0b);
  border-radius: 10px;
}

/* Action Buttons inside Table */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--admin-red);
  color: #fff;
  border-color: var(--admin-red);
}

.btn-icon-green:hover {
  background: var(--admin-green);
  border-color: var(--admin-green);
}

/* ==========================================
   FORMS & INPUTS
   ========================================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group-admin label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.input-admin, .select-admin, .textarea-admin {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--admin-border);
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.input-admin:focus, .select-admin:focus, .textarea-admin:focus {
  border-color: var(--admin-red);
}

/* ==========================================
   MODAL DIALOG
   ========================================== */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-overlay.open {
  display: flex;
}

.admin-modal-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.admin-modal-header {
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
}

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

.admin-modal-close:hover {
  color: #fff;
}

.admin-modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

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

.admin-toast {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: slideInRight 0.3s ease;
}

.admin-toast.success { border-left: 4px solid var(--admin-green); }
.admin-toast.error { border-left: 4px solid var(--admin-red); }
.admin-toast.info { border-left: 4px solid var(--admin-blue); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
}

/* Photo Picker Palette for Admin */
.palette-tabs-admin {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.palette-tab-admin {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.palette-tab-admin:hover {
  background: #475569;
  color: #fff;
}

.palette-tab-admin.active {
  background: #e62327;
  color: #fff;
  border-color: #f87171;
}

.palette-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  background: #0f172a;
  border-radius: 6px;
  border: 1px solid #334155;
}

.palette-card-admin {
  border: 2px solid #334155;
  border-radius: 6px;
  overflow: hidden;
  background: #1e293b;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
  padding: 4px;
}

.palette-card-admin:hover {
  transform: scale(1.05);
  border-color: #f87171;
}

.palette-card-admin.selected {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  background: #064e3b;
}

.palette-card-admin.selected::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 3px;
  background: #10b981;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.palette-img-admin {
  width: 100%;
  height: 52px;
  object-fit: contain;
  display: block;
}

.palette-name-admin {
  font-size: 0.68rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 4px;
  font-weight: 600;
}

/* ==========================================
   ADMIN SECURITY GATE (FULL SCREEN LOCK)
   ========================================== */
.admin-security-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gate-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-top: 4px solid #dc2626;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 36px 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.gate-icon {
  width: 68px;
  height: 68px;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #ef4444;
  font-size: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: pulseGlowBtn 2.2s infinite;
}

.gate-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.gate-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 22px;
}

.gate-input-group {
  text-align: left;
  margin-bottom: 14px;
}

.gate-input-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  display: block;
  margin-bottom: 6px;
}

.gate-back-link {
  font-size: 0.8rem;
  color: #94a3b8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.gate-back-link:hover {
  color: #f87171;
}

/* Ticket Badges in Admin */
.badge-ticket-pending {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-ticket-delivered {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-ticket-completed {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

