/* ==========================================================================
   NUSAFARA EXECUTIVE CMS & ADMIN CONSOLE STYLES (ULTRA-RESPONSIVE V3)
   ========================================================================== */
:root {
  --admin-bg: #03120C;
  --admin-card-bg: rgba(7, 28, 20, 0.92);
  --admin-border: rgba(194, 159, 93, 0.28);
  --admin-gold: #C29F5D;
  --admin-gold-light: #E5C378;
  --admin-text-main: #F4F6F4;
  --admin-text-muted: #8FA69B;
  --admin-accent: #174D38;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body.admin-sidebar-open {
  overflow: hidden;
}

/* ==========================================================================
   TOP EXECUTIVE BAR (RESPONSIVE)
   ========================================================================== */
.admin-topbar {
  background: rgba(4, 18, 13, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--admin-border);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-sidebar-toggle {
  display: none;
  background: rgba(194, 159, 93, 0.12);
  border: 1px solid var(--admin-border);
  color: var(--admin-gold-light);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.admin-sidebar-toggle:hover {
  background: rgba(194, 159, 93, 0.25);
  color: #FFFFFF;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.admin-brand img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.admin-brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--admin-gold-light);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.admin-brand-title span {
  color: var(--admin-text-main);
  font-size: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.08em;
  font-weight: 800;
  background: rgba(194, 159, 93, 0.2);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(194, 159, 93, 0.4);
  margin-left: 4px;
}

.admin-brand-badge {
  background: rgba(194, 159, 93, 0.15);
  border: 1px solid var(--admin-gold);
  color: var(--admin-gold-light);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--admin-text-main);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  background: rgba(194, 159, 93, 0.1);
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  max-width: 240px;
  white-space: nowrap;
}

.admin-user-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   LAYOUT GRID & SIDEBAR (DRAWER ON MOBILE)
   ========================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 245px 1fr;
  min-height: calc(100vh - 58px);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 7, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2400;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.admin-sidebar {
  background: rgba(4, 20, 14, 0.98);
  border-right: 1px solid var(--admin-border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.admin-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 10px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(194, 159, 93, 0.15);
}

.admin-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: var(--admin-gold-light);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--admin-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
}

.admin-nav-item:hover {
  background: rgba(194, 159, 93, 0.08);
  color: var(--admin-gold-light);
}

.admin-nav-item.active {
  background: linear-gradient(135deg, rgba(194, 159, 93, 0.2) 0%, rgba(6, 26, 19, 0.9) 100%);
  border-color: rgba(194, 159, 93, 0.4);
  color: var(--admin-text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.admin-nav-item svg {
  stroke: currentColor;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   CONTENT AREA & MOBILE TABS
   ========================================================================== */
.admin-content {
  padding: 24px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

.admin-tab-pane {
  display: none;
  width: 100%;
  animation: adminFadeIn 0.2s ease;
}

@keyframes adminFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-tab-pane.active {
  display: block;
}

/* Mobile Quick Tabs Strip */
.admin-mobile-tabs {
  display: none;
}

/* Header Row in Tab Panes */
.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

.admin-header-title-wrap {
  flex: 1;
  min-width: 0;
}

.admin-header-row h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--admin-text-main);
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.admin-header-row p {
  color: var(--admin-text-muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.45;
}

.admin-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.admin-header-actions .btn-admin {
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  gap: 6px;
}

.admin-header-actions .btn-admin svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   METRIC CARDS (COMPACT & SLEEK)
   ========================================================================== */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  width: 100%;
}

.admin-metric-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.admin-metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(194, 159, 93, 0.15);
  border: 1px solid var(--admin-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-gold-light);
  flex-shrink: 0;
}

.admin-metric-icon svg {
  width: 18px;
  height: 18px;
}

.admin-metric-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--admin-text-main);
  line-height: 1.1;
}

.admin-metric-label {
  font-size: 11px;
  color: var(--admin-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   TABLES & CARDS (RESPONSIVE HORIZONTAL SCROLL)
   ========================================================================== */
.admin-table-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.admin-table-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(4, 18, 13, 0.5);
  flex-wrap: wrap;
  gap: 10px;
}

.admin-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 580px;
}

.admin-table th {
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-gold-light);
  background: rgba(4, 18, 13, 0.6);
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(194, 159, 93, 0.12);
  color: var(--admin-text-main);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(194, 159, 93, 0.04);
}

/* Badges */
.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.published {
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid #25D366;
  color: #25D366;
}

.status-badge.draft {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid #FFC107;
  color: #FFC107;
}

/* Action Buttons */
.btn-admin {
  background: var(--admin-gold);
  color: #061A13;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-admin:hover {
  background: var(--admin-gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194, 159, 93, 0.3);
}

.btn-admin-sm {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-admin-outline {
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
}

.btn-admin-outline:hover {
  border-color: var(--admin-gold);
  color: var(--admin-gold-light);
}

.btn-admin-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #EF4444;
}

.btn-admin-danger:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.desktop-text { display: inline; }
.mobile-text { display: none; }

/* Filter Bar in Inbox */
.admin-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Section Manager Toggle Cards */
.admin-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.section-item-card {
  background: rgba(6, 26, 19, 0.7);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.section-item-card:hover {
  border-color: var(--admin-gold);
}

.section-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-text-main);
  margin-bottom: 3px;
}

.section-item-desc {
  font-size: 12px;
  color: var(--admin-text-muted);
}

.admin-color-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Switch Toggle */
.admin-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  transition: .25s;
  border-radius: 34px;
  border: 1px solid rgba(194, 159, 93, 0.3);
}

.admin-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--admin-gold-light);
  transition: .25s;
  border-radius: 50%;
}

input:checked + .admin-slider {
  background-color: var(--admin-accent);
  border-color: var(--admin-gold);
}

input:checked + .admin-slider:before {
  transform: translateX(20px);
}

/* Form Styles in Modals and Settings */
.admin-form-group {
  margin-bottom: 14px;
}

.admin-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin-bottom: 5px;
}

.admin-form-control {
  width: 100%;
  padding: 9px 13px;
  background: rgba(4, 18, 13, 0.8);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  color: var(--admin-text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.admin-form-control:focus {
  border-color: var(--admin-gold);
}

/* Modal Backdrops & Dialogs */
.admin-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.admin-modal-backdrop.is-active {
  display: flex;
}

.admin-modal-dialog {
  background: #04140E;
  border: 1px solid var(--admin-gold);
  border-radius: 14px;
  max-width: 580px;
  width: 100%;
  padding: 22px 24px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--admin-gold-light);
  margin: 0;
}

/* ==========================================================================
   MULTI-FORMAT FILE UPLOAD (IMAGE, VIDEO, PDF)
   ========================================================================== */
.admin-upload-dropzone {
  border: 1.5px dashed rgba(194, 159, 93, 0.45);
  background: rgba(6, 26, 19, 0.55);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.admin-upload-dropzone:hover,
.admin-upload-dropzone.dragover {
  border-color: var(--admin-gold);
  background: rgba(194, 159, 93, 0.1);
}

.admin-upload-icon {
  color: var(--admin-gold-light);
  margin-bottom: 4px;
}

.admin-upload-text {
  font-size: 12px;
  color: var(--admin-text-main);
  line-height: 1.35;
}

.admin-upload-text b {
  color: var(--admin-gold-light);
}

.admin-upload-formats {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.upload-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(194, 159, 93, 0.15);
  color: var(--admin-gold-light);
  border: 1px solid rgba(194, 159, 93, 0.35);
  letter-spacing: 0.03em;
}

.admin-upload-preview {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(4, 18, 13, 0.85);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  animation: adminFadeIn 0.2s ease;
}

.admin-upload-preview-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.3);
}

.admin-upload-preview-video {
  width: 120px;
  max-height: 70px;
  border-radius: 6px;
  background: #000;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.admin-upload-preview-pdf {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EF4444;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
}

.admin-upload-preview-info {
  flex: 1;
  min-width: 0;
}

.admin-upload-preview-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-upload-preview-meta {
  font-size: 10.5px;
  color: var(--admin-text-muted);
  margin-top: 2px;
}

.admin-upload-preview-remove {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #EF4444;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.admin-upload-preview-remove:hover {
  background: #EF4444;
  color: #FFF;
}

/* ==========================================================================
   MCP SERVER & AI AGENT SUITE
   ========================================================================== */
.mcp-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25D366;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  animation: mcpPulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes mcpPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.mcp-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mcp-tool-card {
  background: rgba(6, 26, 19, 0.7);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.mcp-tool-card:hover {
  border-color: var(--admin-gold);
  transform: translateY(-2px);
}

.mcp-tool-name {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-gold-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mcp-tool-desc {
  font-size: 11.5px;
  color: var(--admin-text-muted);
  line-height: 1.4;
  flex: 1;
}

.mcp-tool-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(194, 159, 93, 0.15);
  color: var(--admin-gold-light);
  border: 1px solid rgba(194, 159, 93, 0.3);
}

.mcp-console-wrapper {
  background: #020b07;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}

.mcp-console-header {
  padding: 10px 14px;
  background: rgba(4, 18, 13, 0.9);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mcp-console-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--admin-gold-light);
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mcp-console-output {
  padding: 14px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #7ef1b4;
  background: #020c08;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==========================================================================
   BREAKPOINTS & RESPONSIVE RULES (TABLET & MOBILE)
   ========================================================================== */

/* TABLET & LAPTOP (<= 1024px) */
@media (max-width: 1024px) {
  .admin-sidebar-toggle {
    display: inline-flex;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  /* Off-canvas Mobile Drawer */
  .admin-sidebar-backdrop {
    display: block;
  }
  .admin-sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    max-width: 82vw;
    z-index: 2500;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 15px 0 50px rgba(0, 0, 0, 0.85);
    background: #04140e;
    overflow-y: auto;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-sidebar-close {
    display: block;
  }

  /* Show horizontal mobile quick tabs */
  .admin-mobile-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 10px 2px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--admin-border);
    scrollbar-width: none;
  }
  .admin-mobile-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tab-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(6, 26, 19, 0.7);
    border: 1px solid var(--admin-border);
    color: var(--admin-text-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
    user-select: none;
  }
  .admin-tab-chip svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
  }
  .admin-tab-chip:hover {
    color: var(--admin-gold-light);
    border-color: var(--admin-gold);
  }
  .admin-tab-chip.active {
    background: linear-gradient(135deg, rgba(194, 159, 93, 0.25) 0%, rgba(6, 26, 19, 0.95) 100%);
    border-color: var(--admin-gold);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .admin-sections-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* PHABLET & SMALL TABLET (<= 860px) */
@media (max-width: 860px) {
  .admin-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }

  .admin-header-actions {
    width: 100%;
    gap: 6px;
  }

  .admin-header-actions .btn-admin {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    font-size: 11.5px;
    padding: 7px 12px;
    border-radius: 7px;
  }

  .admin-content {
    padding: 18px 16px;
  }
}

/* SMARTPHONE (<= 640px) */
@media (max-width: 640px) {
  .admin-topbar {
    padding: 8px 12px;
  }

  .admin-brand-badge {
    display: none;
  }

  .admin-user-pill {
    max-width: 120px;
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .desktop-text { display: none; }
  .mobile-text { display: inline; }

  .admin-content {
    padding: 14px 12px;
  }

  /* Compact 2x2 grid so cards never stack into tall giant blocks */
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    margin-bottom: 16px;
  }

  .admin-metric-card {
    padding: 9px 10px;
    border-radius: 8px;
    gap: 8px;
  }

  .admin-metric-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .admin-metric-icon svg {
    width: 15px;
    height: 15px;
  }

  .admin-metric-num {
    font-size: 17px;
  }

  .admin-metric-label {
    font-size: 10px;
  }

  .admin-modal-dialog {
    padding: 18px 14px;
    border-radius: 12px;
    max-height: 94vh;
  }
}

/* SMALL SMARTPHONE (<= 480px) */
@media (max-width: 480px) {
  .admin-brand-title span {
    display: none;
  }

  .admin-user-pill {
    display: none;
  }

  .admin-topbar-actions {
    gap: 5px;
  }

  .admin-topbar-actions .btn-admin {
    padding: 5px 8px;
    font-size: 11px;
  }

  .admin-header-actions .btn-admin {
    flex: 1 1 auto;
    width: auto;
    padding: 6px 10px;
    font-size: 11px;
  }

  .admin-color-picker-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .section-item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-item-card .admin-switch {
    align-self: flex-end;
  }
}

/* ==========================================================================
   V4 ENHANCEMENTS: DRAG-AND-DROP, ANALYTICS, 2FA & SECURITY SHIELD
   ========================================================================== */

/* Drag and Drop Section Items */
.section-item-card {
  cursor: grab;
  user-select: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.section-item-card:active {
  cursor: grabbing;
}

.section-item-card.dragging {
  opacity: 0.45;
  border-color: var(--admin-gold-light) !important;
  transform: scale(0.98);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.section-item-card.drag-over {
  border-color: #25D366 !important;
  background: rgba(37, 211, 102, 0.12) !important;
  box-shadow: 0 0 15px rgba(37, 211, 102, 0.35);
  transform: translateY(-2px);
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-gold);
  padding: 4px;
  margin-right: 8px;
  cursor: grab;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  font-size: 16px;
  letter-spacing: -2px;
}

.drag-handle:hover {
  opacity: 1;
  color: var(--admin-gold-light);
}

.section-order-badge {
  display: inline-block;
  background: rgba(194, 159, 93, 0.2);
  border: 1px solid rgba(194, 159, 93, 0.4);
  color: var(--admin-gold-light);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

/* Simple 1-Connection MCP Gateway */
.mcp-simple-gateway {
  background: linear-gradient(135deg, rgba(6, 26, 19, 0.95) 0%, rgba(2, 12, 8, 0.98) 100%);
  border: 1px solid var(--admin-gold);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mcp-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(194, 159, 93, 0.15);
  color: var(--admin-gold-light);
  border: 1px solid rgba(194, 159, 93, 0.4);
}

.mcp-universal-code {
  background: #020906;
  border: 1px solid rgba(194, 159, 93, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: #7ef1b4;
  word-break: break-all;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Hosting Traffic & Visit Analytics */
.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 860px) {
  .analytics-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.analytics-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 14px 16px;
  box-sizing: border-box;
}

.analytics-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--admin-text-main);
  line-height: 1.1;
  margin: 4px 0;
}

.analytics-change {
  font-size: 11px;
  font-weight: 700;
}
.analytics-change.pos { color: #25D366; }
.analytics-change.neutral { color: var(--admin-gold-light); }

.analytics-chart-wrap {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.analytics-bar-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 130px;
  gap: 8px;
  padding: 14px 4px 4px 4px;
  border-bottom: 1px solid var(--admin-border);
}

.analytics-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.analytics-bar-fill {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, var(--admin-gold-light) 0%, var(--admin-accent) 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.4s ease;
  position: relative;
}

.analytics-bar-fill:hover {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--admin-gold) 100%);
  box-shadow: 0 0 12px rgba(194, 159, 93, 0.5);
}

.analytics-bar-label {
  font-size: 10px;
  color: var(--admin-text-muted);
  text-align: center;
  white-space: nowrap;
}

.analytics-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .analytics-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.analytics-panel {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 16px 18px;
}

.analytics-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-gold-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.analytics-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(194, 159, 93, 0.1);
  font-size: 12px;
}

.analytics-list-item:last-child {
  border-bottom: none;
}

.analytics-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}

.analytics-progress-fill {
  height: 100%;
  background: var(--admin-gold);
  border-radius: 999px;
}

/* Google Authenticator 2FA Modal & TOTP Box */
.totp-input-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
}

.totp-digit-input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  font-family: monospace;
  background: rgba(4, 18, 13, 0.9);
  border: 1.5px solid var(--admin-border);
  border-radius: 10px;
  color: var(--admin-gold-light);
  outline: none;
  transition: all 0.2s ease;
}

.totp-digit-input:focus {
  border-color: var(--admin-gold);
  box-shadow: 0 0 12px rgba(194, 159, 93, 0.4);
}

.auth-qr-frame {
  width: 140px;
  height: 140px;
  background: #FFFFFF;
  padding: 8px;
  border-radius: 12px;
  margin: 0 auto 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.security-lockout-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #FCA5A5;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   COMPACT ADMIN USER MANAGER (+) AND (-) BUTTONS & RECOVERY CHANNELS
   ========================================================================== */
.btn-admin-circle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  line-height: 1;
  text-decoration: none;
}

.btn-admin-circle.add {
  background: linear-gradient(135deg, #E2CE9B 0%, #C29F5D 100%);
  color: #061A13;
  box-shadow: 0 3px 10px rgba(194, 159, 93, 0.35);
}

.btn-admin-circle.add:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.btn-admin-circle.del {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #EF4444;
}

.btn-admin-circle.del:hover {
  background: #EF4444;
  color: #FFFFFF;
  transform: scale(1.1);
}

.btn-admin-circle.del.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Password Recovery Channel Tiles */
.recovery-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 18px 0;
}

.recovery-channel-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--admin-border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.recovery-channel-card:hover,
.recovery-channel-card.active {
  border-color: var(--admin-gold-light);
  background: rgba(194, 159, 93, 0.15);
  transform: translateY(-2px);
}

.recovery-channel-card.active {
  box-shadow: 0 0 15px rgba(194, 159, 93, 0.25);
}

.recovery-channel-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.recovery-channel-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--admin-gold-light);
}

.recovery-channel-desc {
  font-size: 9.5px;
  color: var(--admin-text-muted);
  margin-top: 2px;
}

/* Friendly MCP Agent Action Cards */
.mcp-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mcp-action-card {
  background: rgba(4, 18, 13, 0.85);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mcp-action-card:hover {
  border-color: var(--admin-gold);
}

.mcp-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--admin-gold-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mcp-card-desc {
  font-size: 11px;
  color: var(--admin-text-muted);
  line-height: 1.4;
}

