/* ═══════════════════════════════════════════════════════════════════════════
   NEOcargo Control Panel — Professional Desktop UI
   Version: 1.0.0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS — Professional Dark Theme
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Core Palette */
  --bg-body: #0d0d0d;
  --bg-sidebar: #121212;
  --bg-card: #1a1a1a;
  --bg-card-elevated: #222222;
  --bg-input: #1e1e1e;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(178, 254, 18, 0.08);
  
  /* Accent Colors */
  --accent-primary: #b2fe12;
  --accent-primary-dim: rgba(178, 254, 18, 0.15);
  --accent-primary-hover: #c4ff45;
  
  /* Text Hierarchy */
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --text-on-accent: #0d0d0d;
  
  /* Borders */
  --border-default: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-accent: rgba(178, 254, 18, 0.3);
  
  /* Semantic Colors */
  --color-success: #22c55e;
  --color-success-bg: rgba(34, 197, 94, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.12);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.12);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(178, 254, 18, 0.15);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  
  /* Sizing */
  --sidebar-width: 220px;
  --header-height: 56px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}


/* ─────────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}


/* ─────────────────────────────────────────────────────────────────────────────
   MATERIAL SYMBOLS ICON STYLING
   ───────────────────────────────────────────────────────────────────────────── */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-sm { font-size: 16px; }
.icon-md { font-size: 20px; }
.icon-lg { font-size: 24px; }
.icon-xl { font-size: 32px; }

.icon-accent { color: var(--accent-primary); }
.icon-success { color: var(--color-success); }
.icon-warning { color: var(--color-warning); }
.icon-error { color: var(--color-error); }
.icon-muted { color: var(--text-muted); }


/* ─────────────────────────────────────────────────────────────────────────────
   LAYOUT — Admin Shell
   ───────────────────────────────────────────────────────────────────────────── */
.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  min-height: 100vh;
}


/* ─────────────────────────────────────────────────────────────────────────────
   HEADER — Top Bar
   ───────────────────────────────────────────────────────────────────────────── */
.top-bar {
  grid-area: header;
  display: flex;
  align-items: center;
  padding: 30px 25px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-default);
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
}

.brand img {
  height: 24px;
  width: auto;
}

.divider {
  width: 1px;
  height: 24px;
  background: var(--border-default);
}

.top-bar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.top-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

#staff-name-display {
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SIDEBAR — Navigation
   ───────────────────────────────────────────────────────────────────────────── */
.admin-sidenav {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  margin: 0 8px;
  border-radius: var(--radius-sm);
}

.admin-tab .material-symbols-rounded {
  font-size: 20px;
  opacity: 0.7;
  transition: all var(--transition-fast);
}

.admin-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.admin-tab:hover .material-symbols-rounded {
  opacity: 1;
}

.admin-tab.active {
  background: var(--bg-active);
  color: var(--accent-primary);
}

.admin-tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 0 2px 2px 0;
}

.admin-tab.active .material-symbols-rounded {
  color: var(--accent-primary);
  opacity: 1;
}

.tab-badge {
  margin-left: auto;
  background: var(--color-error);
  color: white;
  font-size: 8px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.tab-badge.hidden {
  display: none;
}


/* ─────────────────────────────────────────────────────────────────────────────
   MAIN CONTENT AREA
   ───────────────────────────────────────────────────────────────────────────── */
.admin-main {
  grid-area: main;
  padding: 35px 24px;
  overflow-y: auto;
  background: var(--bg-body);
}

.admin-section {
  animation: fadeIn 0.2s ease;
}

.admin-section.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────────── */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .material-symbols-rounded {
  color: var(--accent-primary);
  font-size: 26px;
}

.lead {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
}

h3, h4 {
  color: var(--text-primary);
  font-weight: 600;
}


/* ─────────────────────────────────────────────────────────────────────────────
   CARDS — Dashboard Widgets
   ───────────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-subtle);
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   STAT TILES
   ───────────────────────────────────────────────────────────────────────────── */
.stat-tile {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: all var(--transition-fast);
}

.stat-tile:hover {
  border-color: var(--border-accent);
  background: rgba(178, 254, 18, 0.03);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn .material-symbols-rounded {
  font-size: 18px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary/Light Button */
.btn-light {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-light:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

/* Danger Button */
.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* Warning Button */
.btn-warning {
  background: var(--color-warning);
  color: var(--text-on-accent);
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
}

/* Success Button */
.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #16a34a;
}

/* Small Button */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Link Button */
.btn-link {
  background: none;
  border: none;
  color: var(--accent-primary);
  padding: 0;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--accent-primary-hover);
}


/* ─────────────────────────────────────────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  outline: none;
}

.input:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-muted);
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

.input:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Checkbox */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}


/* ─────────────────────────────────────────────────────────────────────────────
   TABLES — Professional Data Grids
   ───────────────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
}

table,
.data-table,
.handout-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 0px
}

thead {
  background: var(--bg-card-elevated);
  position: sticky;
  top: 0;
  z-index: 1;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* Zebra striping */
tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Row hover */
tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: rgba(178, 254, 18, 0.04);
}

/* Clickable rows */
tbody tr.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover {
  background: var(--bg-active);
}

/* Selected row */
tbody tr.selected {
  background: var(--bg-active);
  border-left: 3px solid var(--accent-primary);
}


/* ─────────────────────────────────────────────────────────────────────────────
   BADGES — Status Pills
   ───────────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-success,
.badge-green {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-warning,
.badge-yellow {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-error,
.badge-red {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge-info,
.badge-blue {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.badge-accent {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
}

/* Shelf badges */
.badge-shelf-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-shelf {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}


/* ─────────────────────────────────────────────────────────────────────────────
   MODALS
   ───────────────────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

.modal.hidden {
  display: none;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Dialog element styles (for native HTML dialog) */
dialog {
  border: none !important;
  padding: 0;
  background: transparent;
  display: none !important; /* CRITICAL: hide dialogs by default */
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 9999;
}

dialog[open] {
  display: block !important; /* Show when open attribute is present */
}

/* Logout confirmation modal - higher z-index to appear above profile modal */
#logout-confirm {
  z-index: 10000 !important;
}

dialog:not([open]) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

dialog.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 520px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(178, 254, 18, 0.1);
  animation: modalSlideIn 0.25s ease;
}

dialog.modal-dialog h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

dialog.modal-dialog .form-group {
  margin-bottom: 16px;
}

dialog.modal-dialog .form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

dialog.modal-dialog .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
}

dialog.modal-dialog .btn {
  min-width: 100px;
}

/* Specific modal sizes */
#promo-create-modal { width: 560px; }
#promo-analytics-modal { width: 650px; }
#referrer-percent-modal { width: 420px; }
#referrals-network-modal { width: 700px; padding: 0; }

/* Large modal variant */
dialog.modal-dialog-lg {
  width: 700px;
  padding: 0;
  background: linear-gradient(145deg, #1e1e1e 0%, #252525 100%);
  border: 1px solid rgba(178,254,18,0.15);
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}

.modal-header h3,
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-card-elevated);
}


/* ─────────────────────────────────────────────────────────────────────────────
   EMPTY STATES
   ───────────────────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state .material-symbols-rounded {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
  display: block;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SORTING SECTION
   ───────────────────────────────────────────────────────────────────────────── */
.current-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(178, 254, 18, 0.08) 0%, rgba(178, 254, 18, 0.04) 100%);
  border: 1px solid rgba(178, 254, 18, 0.25);
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.current-branch-pill .branch-pill-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(178, 254, 18, 0.12);
  border-radius: 10px;
  flex-shrink: 0;
}

.current-branch-pill .branch-pill-icon .material-symbols-rounded {
  font-size: 20px;
  color: var(--accent-primary);
}

.current-branch-pill .branch-pill-label {
  color: var(--text-muted);
  font-weight: 500;
}

.current-branch-pill .branch-pill-name {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 16px;
}

.sorting-card {
  max-width: 800px;
}

.sorting-actions {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.sorting-session-info {
  background: var(--bg-active);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.sorting-session-info.hidden {
  display: none;
}

.sorting-session-info p {
  margin: 4px 0;
  font-size: 13px;
}

.sorting-session-info strong {
  color: var(--text-secondary);
}

.scan-log {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.scan-log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.scan-log-item:last-child {
  border-bottom: none;
}


/* ─────────────────────────────────────────────────────────────────────────────
   PAGINATION
   ───────────────────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pagination span {
  font-size: 13px;
  color: var(--text-secondary);
}


/* ─────────────────────────────────────────────────────────────────────────────
   DETAIL PANELS
   ───────────────────────────────────────────────────────────────────────────── */
.detail-card {
  animation: fadeIn 0.2s ease;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 16px;
}

.detail-header h3 {
  font-size: 18px;
  margin: 0;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   IMPERSONATION BANNER
   ───────────────────────────────────────────────────────────────────────────── */
#impersonate-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  font-weight: 500;
}

#impersonate-banner.hidden {
  display: none;
}


/* ─────────────────────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success {
  border-left: 4px solid var(--color-success);
}

.toast-error {
  border-left: 4px solid var(--color-error);
}

.toast-warning {
  border-left: 4px solid var(--color-warning);
}

.toast-info {
  border-left: 4px solid var(--color-info);
}


/* ─────────────────────────────────────────────────────────────────────────────
   SPECIFIC SECTION FIXES
   ───────────────────────────────────────────────────────────────────────────── */

/* Shipment section */
#shipment-user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
}

#shipment-boxes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Intake section - light cards fix */
.intake-info-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
}

.intake-info-card .card-title {
  color: var(--text-primary) !important;
}

/* Receipt modal */
#receipt-modal .modal-body {
  background: var(--bg-card);
}

/* Referral cashback indicator */
#shipment-referral-cashback {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 12px;
}

/* Success overlay */
.success-overlay {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.success-overlay .material-symbols-rounded {
  font-size: 64px;
  color: var(--color-success);
}


/* ─────────────────────────────────────────────────────────────────────────────
   UTILITY CLASSES
   ───────────────────────────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

/* ─────────────────────────────────────────────────────────────────────────────
   BRANCH ANALYTICS TABLE
   ───────────────────────────────────────────────────────────────────────────── */
.branch-analytics-table tbody tr {
  transition: background 0.2s ease;
}

.branch-analytics-table tbody tr:hover {
  background: rgba(178, 254, 18, 0.04);
}

.branch-analytics-table td {
  padding: 14px 12px;
  vertical-align: middle;
}

.branch-analytics-table .branch-name-cell {
  font-weight: 600;
  color: #fff;
}

.branch-analytics-table .address-cell {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.branch-analytics-table .code-cell {
  font-family: var(--font-mono);
  background: rgba(178, 254, 18, 0.1);
  color: var(--accent-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  display: inline-block;
}

.branch-analytics-table .number-cell {
  font-family: var(--font-mono);
  font-weight: 600;
}

.branch-analytics-table .kg-cell {
  color: #9b59b6;
}

.branch-analytics-table .revenue-cell {
  color: #2ecc71;
}

.branch-analytics-table .stock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.branch-analytics-table .stock-badge.sorting {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.branch-analytics-table .stock-badge.ready {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SORTING SECTION — Modern Redesign
   ───────────────────────────────────────────────────────────────────────────── */
.sorting-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-height: calc(100vh - 200px);
}

@media (max-width: 1100px) {
  .sorting-layout {
    grid-template-columns: 1fr;
  }
}

.sorting-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sorting-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 24px;
}

.sorting-header-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.sorting-header-left .icon-xl {
  font-size: 40px;
  padding: 12px;
  background: var(--accent-primary-dim);
  border-radius: var(--radius-md);
}

.sorting-step {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.step-number {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--bg-card-elevated);
  border: 2px solid var(--border-default);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
}

.step-number.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.session-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--color-success);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.active {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.session-details {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.scan-form-modern {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.scan-form-modern .form-group {
  flex: 1;
  margin: 0;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 24px;
}

.input-with-icon .input {
  padding-left: 52px;
}

.input-lg {
  padding: 16px;
  font-size: 16px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 15px;
}

.scan-log {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 350px);
  min-height: 300px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE (for smaller desktops)
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root {
    --sidebar-width: 200px;
  }
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }
  
  .admin-sidenav {
    display: none;
  }
}

/* =============================================================================
   CLIENT PROFILE CRM DASHBOARD
   ============================================================================= */

/* Header Card */
.cp-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(40, 40, 45, 0.95) 0%, rgba(30, 30, 35, 0.98) 100%);
  border: 1px solid rgba(178, 254, 18, 0.15);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cp-back-btn {
  position: absolute;
  left: 16px;
  top: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.7);
}

.cp-back-btn:hover {
  background: rgba(178, 254, 18, 0.15);
  border-color: rgba(178, 254, 18, 0.3);
  color: #b2fe12;
  transform: translateX(-2px);
}

.cp-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b2fe12 0%, #8bc34a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 40px;
  box-shadow: 0 4px 16px rgba(178, 254, 18, 0.25);
}

.cp-avatar .material-symbols-rounded {
  font-size: 40px;
  color: #1a1a1a;
}

.cp-header-info {
  flex: 1;
  min-width: 0;
}

.cp-client-name {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.cp-client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.cp-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.cp-meta-item .material-symbols-rounded {
  font-size: 18px;
  color: rgba(178, 254, 18, 0.7);
}

.cp-header-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cp-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(178, 254, 18, 0.12);
  border: 1px solid rgba(178, 254, 18, 0.25);
  color: #b2fe12;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cp-action-btn:hover {
  background: rgba(178, 254, 18, 0.2);
  border-color: rgba(178, 254, 18, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(178, 254, 18, 0.2);
}

.cp-action-btn.cp-action-danger {
  background: rgba(231, 76, 60, 0.1);
  border-color: rgba(231, 76, 60, 0.25);
  color: #e74c3c;
  padding: 12px;
}

.cp-action-btn.cp-action-danger:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.4);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

/* Grid Layout */
.cp-grid-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

/* Sidebar */
.cp-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* KPI Grid */
.cp-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cp-kpi-card {
  background: rgba(40, 40, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s ease;
}

.cp-kpi-card:hover {
  border-color: rgba(178, 254, 18, 0.2);
  transform: translateY(-2px);
}

.cp-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cp-kpi-ltv .cp-kpi-icon {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.cp-kpi-weight .cp-kpi-icon {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}

.cp-kpi-avg .cp-kpi-icon {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
}

.cp-kpi-referrals .cp-kpi-icon {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.cp-kpi-icon .material-symbols-rounded {
  font-size: 22px;
}

.cp-kpi-content {
  flex: 1;
  min-width: 0;
}

.cp-kpi-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
}

.cp-kpi-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Notes Card */
.cp-notes-card {
  background: rgba(40, 40, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.cp-notes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
}

.cp-notes-header .material-symbols-rounded {
  font-size: 20px;
  color: #f39c12;
}

.cp-notes-textarea {
  width: 100%;
  min-height: 100px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #fff;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.cp-notes-textarea:focus {
  outline: none;
  border-color: rgba(178, 254, 18, 0.4);
}

.cp-notes-textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.cp-save-notes-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 16px;
  background: rgba(52, 152, 219, 0.15);
  border: 1px solid rgba(52, 152, 219, 0.3);
  color: #3498db;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cp-save-notes-btn:hover {
  background: rgba(52, 152, 219, 0.25);
  border-color: rgba(52, 152, 219, 0.5);
}

/* Push Notification Card */
.cp-push-card {
  background: rgba(40, 40, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

/* Disabled state for blocks */
.cp-push-card.cp-disabled {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.cp-push-card.cp-disabled .cp-push-input,
.cp-push-card.cp-disabled .cp-push-textarea,
.cp-push-card.cp-disabled .cp-send-push-btn {
  cursor: not-allowed;
  opacity: 0.6;
}

.cp-dev-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.4);
  color: #ffc107;
  border-radius: 4px;
}

.cp-push-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
}

.cp-push-header .material-symbols-rounded {
  font-size: 20px;
  color: #e74c3c;
}

.cp-push-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
}

.cp-push-input:focus {
  outline: none;
  border-color: rgba(178, 254, 18, 0.4);
}

.cp-push-textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #fff;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.cp-push-textarea:focus {
  outline: none;
  border-color: rgba(178, 254, 18, 0.4);
}

.cp-push-textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.cp-send-push-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 16px;
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cp-send-push-btn:hover {
  background: rgba(231, 76, 60, 0.25);
  border-color: rgba(231, 76, 60, 0.5);
}

/* Stats Card */
.cp-stats-card {
  background: rgba(40, 40, 45, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}

.cp-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-stats-row:last-child {
  border-bottom: none;
}

.cp-stats-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.cp-stats-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.cp-stats-value.cp-bonus {
  color: #b2fe12;
}

/* Main Column */
.cp-main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Tabs */
.cp-tabs {
  display: flex;
  gap: 8px;
  background: rgba(40, 40, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 16px;
}

.cp-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cp-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
}

.cp-tab.active {
  background: rgba(178, 254, 18, 0.12);
  color: #b2fe12;
}

.cp-tab .material-symbols-rounded {
  font-size: 20px;
}

.cp-tab-badge {
  background: rgba(178, 254, 18, 0.2);
  color: #b2fe12;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.cp-tab:not(.active) .cp-tab-badge {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* Tab Content */
.cp-tab-content {
  display: none;
  background: rgba(40, 40, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  min-height: 400px;
}

.cp-tab-content.active {
  display: block;
}

/* Table */
.cp-table-wrapper {
  overflow-x: auto;
}

.cp-table {
  width: 100%;
  border-collapse: collapse;
}

.cp-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.5);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-table tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cp-table tbody tr:hover {
  background: rgba(178, 254, 18, 0.03);
}

.cp-table tbody tr:last-child td {
  border-bottom: none;
}

.cp-empty-row td {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  padding: 40px 16px;
  font-style: italic;
}

/* Status Badges in Table */
.cp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.cp-status.pending {
  background: rgba(241, 196, 15, 0.15);
  color: #f1c40f;
}

.cp-status.cn_warehouse,
.cp-status.cn_transit {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}

.cp-status.sorting {
  background: rgba(155, 89, 182, 0.15);
  color: #9b59b6;
}

.cp-status.ready {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.cp-status.delivered {
  background: rgba(149, 165, 166, 0.15);
  color: #95a5a6;
}

/* Finance Summary */
.cp-finance-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.cp-finance-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cp-finance-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-finance-icon.green {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.cp-finance-icon.orange {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.cp-finance-icon.blue {
  background: rgba(52, 152, 219, 0.15);
  color: #3498db;
}

.cp-finance-icon .material-symbols-rounded {
  font-size: 26px;
}

.cp-finance-info {
  flex: 1;
}

.cp-finance-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.cp-finance-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.cp-finance-note {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════════════════════════
   NEW CRM ELEMENTS (Header, Finance, Referrals)
   ══════════════════════════════════════════════════════════════════════════════ */

/* Client code badge in header */
.cp-client-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.cp-client-code {
  background: rgba(178, 254, 18, 0.15);
  border: 1px solid rgba(178, 254, 18, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #b2fe12;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.5px;
}

.cp-blocked-badge {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #e74c3c;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cp-blocked-badge .material-symbols-rounded {
  font-size: 14px;
}

/* Avatar with initials */
.cp-avatar #cp-initials {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -1px;
}

/* Secondary action buttons */
.cp-action-btn.cp-action-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.cp-action-btn.cp-action-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.cp-action-btn.cp-action-success {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.25);
  color: #2ecc71;
}

.cp-action-btn.cp-action-success:hover {
  background: rgba(46, 204, 113, 0.2);
  border-color: rgba(46, 204, 113, 0.4);
}

.cp-btn-text {
  /* Hide on mobile */
}

/* Balance Section */
.cp-balance-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, rgba(178, 254, 18, 0.08) 0%, rgba(178, 254, 18, 0.03) 100%);
  border: 1px solid rgba(178, 254, 18, 0.15);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.cp-balance-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cp-balance-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(178, 254, 18, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-balance-icon .material-symbols-rounded {
  font-size: 28px;
  color: #b2fe12;
}

.cp-balance-info {
  display: flex;
  flex-direction: column;
}

.cp-balance-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.cp-balance-value {
  font-size: 28px;
  font-weight: 700;
  color: #b2fe12;
  letter-spacing: -0.02em;
}

.cp-balance-actions {
  display: flex;
  gap: 12px;
}

.cp-balance-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cp-balance-add {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}

.cp-balance-add:hover {
  background: rgba(46, 204, 113, 0.25);
  border-color: rgba(46, 204, 113, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
}

.cp-balance-subtract {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

.cp-balance-subtract:hover {
  background: rgba(231, 76, 60, 0.25);
  border-color: rgba(231, 76, 60, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

/* Transactions Section */
.cp-transactions-section {
  margin-top: 24px;
}

.cp-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 16px 0;
}

.cp-section-title .material-symbols-rounded {
  font-size: 20px;
  color: rgba(178, 254, 18, 0.7);
}

.cp-table-compact {
  font-size: 13px;
}

.cp-tx-type {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cp-tx-amount {
  font-weight: 600;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.cp-tx-amount.positive {
  color: #2ecc71;
}

.cp-tx-amount.negative {
  color: #e74c3c;
}

/* Referral Code Section */
.cp-referral-code-section {
  margin-bottom: 20px;
}

.cp-referral-code-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(241, 196, 15, 0.08);
  border: 1px solid rgba(241, 196, 15, 0.15);
  border-radius: 10px;
  padding: 16px 20px;
}

.cp-referral-code-card .material-symbols-rounded {
  font-size: 28px;
  color: #f1c40f;
}

.cp-referral-code-info {
  flex: 1;
}

.cp-referral-code-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.cp-referral-code-value {
  font-size: 18px;
  font-weight: 700;
  color: #f1c40f;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 1px;
}

.cp-earning {
  color: #2ecc71;
  font-weight: 600;
}

/* Payment status badges */
.cp-payment-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cp-payment-status.success {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.cp-payment-status.warning {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.cp-payment-status.pending {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

/* Responsive */
@media (max-width: 1024px) {
  .cp-grid-layout {
    grid-template-columns: 1fr;
  }
  
  .cp-sidebar-col {
    order: 2;
  }
  
  .cp-main-col {
    order: 1;
  }
  
  .cp-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .cp-header-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .cp-back-btn {
    position: static;
    margin-bottom: 12px;
    align-self: flex-start;
  }
  
  .cp-avatar {
    margin-left: 0;
  }
  
  .cp-client-meta {
    justify-content: center;
  }
  
  .cp-header-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .cp-action-btn {
    justify-content: center;
  }
  
  .cp-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .cp-tabs {
    flex-wrap: wrap;
  }
  
  .cp-tab {
    flex: 1 1 45%;
  }
  
  .cp-finance-summary {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* DASHBOARD STYLES - Analytics Overview                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-view {
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease;
  max-width: 1600px;
  margin: 0 auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dash-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.dash-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dash-controls .form-select-sm {
  background: rgba(40, 40, 45, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  min-width: 150px;
  transition: all 0.2s ease;
}

.dash-controls .form-select-sm:hover {
  border-color: rgba(178, 254, 18, 0.4);
}

.dash-controls .form-select-sm:focus {
  outline: none;
  border-color: #b2fe12;
}

.dash-refresh-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(178, 254, 18, 0.1);
  border: 1px solid rgba(178, 254, 18, 0.3);
  color: #b2fe12;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-refresh-btn:hover {
  background: rgba(178, 254, 18, 0.2);
  transform: rotate(90deg);
}

.dash-refresh-btn.loading .material-symbols-rounded {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Export Buttons Group */
.export-group {
  display: flex;
  gap: 8px;
}

.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-outline-sm .material-symbols-rounded {
  font-size: 18px;
}

.btn-outline-sm:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(178, 254, 18, 0.4);
  color: #b2fe12;
}

.btn-outline-sm:active {
  transform: scale(0.96);
}

/* Dashboard Loading State */
.dashboard-view.loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.dashboard-view.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(178, 254, 18, 0.2);
  border-top-color: #b2fe12;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* KPI Cards Grid */
.dash-grid-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.kpi-card {
  background: linear-gradient(145deg, rgba(30, 30, 35, 0.95), rgba(25, 25, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon .material-symbols-rounded {
  font-size: 28px;
}

.kpi-icon.money {
  background: rgba(178, 254, 18, 0.12);
  color: #b2fe12;
}

.kpi-icon.weight {
  background: rgba(0, 200, 255, 0.12);
  color: #00c8ff;
}

.kpi-icon.box {
  background: rgba(255, 100, 100, 0.12);
  color: #ff6464;
}

.kpi-icon.time {
  background: rgba(200, 100, 255, 0.12);
  color: #c864ff;
}

.kpi-info {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.kpi-info h2 {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
  line-height: 1.1;
}

.kpi-trend {
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-trend .material-symbols-rounded {
  font-size: 18px;
}

.kpi-trend.up {
  color: #b2fe12;
}

.kpi-trend.down {
  color: #ff4d4d;
}

.kpi-trend.neutral {
  color: rgba(255, 255, 255, 0.4);
}

/* Secondary Stats Row */
.dash-grid-secondary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.mini-stat-card {
  background: rgba(35, 35, 40, 0.9);
  border-radius: 12px;
  padding: 16px 20px;
  border-left: 3px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.mini-stat-card:hover {
  background: rgba(40, 40, 45, 0.95);
}

.mini-stat-card.danger-glow {
  border-left-color: #ff4d4d;
  background: linear-gradient(90deg, rgba(255, 77, 77, 0.08), transparent);
}

.mini-stat-card.warn-glow {
  border-left-color: #ffa500;
  background: linear-gradient(90deg, rgba(255, 165, 0, 0.08), transparent);
}

.mini-stat-card .label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mini-stat-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* Charts Row */
.dash-grid-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  min-height: 380px;
}

.chart-card {
  background: linear-gradient(145deg, rgba(30, 30, 35, 0.95), rgba(25, 25, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.chart-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-card .card-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.chart-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-item.revenue .dot {
  background: #b2fe12;
}

.legend-item.weight .dot {
  background: #00c8ff;
}

.chart-wrapper {
  flex: 1;
  position: relative;
  min-height: 0;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Funnel Row */
.dash-funnel-row {
  margin: 0;
}

.funnel-card {
  background: linear-gradient(145deg, rgba(30, 30, 35, 0.95), rgba(25, 25, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 24px;
}

.funnel-card .card-head {
  margin-bottom: 20px;
}

.funnel-card .card-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.funnel-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.funnel-item {
  flex: 1;
  text-align: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.funnel-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.funnel-item.highlight {
  background: rgba(178, 254, 18, 0.1);
  border: 1px solid rgba(178, 254, 18, 0.2);
}

.funnel-item.success {
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.funnel-count {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.funnel-item.highlight .funnel-count {
  color: #b2fe12;
}

.funnel-item.success .funnel-count {
  color: #2ecc71;
}

.funnel-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.funnel-arrow {
  color: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.funnel-arrow .material-symbols-rounded {
  font-size: 20px;
}

/* Lists Row */
.dash-grid-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.list-card {
  background: linear-gradient(145deg, rgba(30, 30, 35, 0.95), rgba(25, 25, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
}

.list-card .card-head {
  margin-bottom: 16px;
}

.list-card .card-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-table th,
.dash-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-table th {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-table td {
  font-size: 14px;
  color: #fff;
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.dash-table .empty-row td {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  padding: 24px;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(178, 254, 18, 0.2), rgba(178, 254, 18, 0.1));
  color: #b2fe12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  margin-right: 10px;
  vertical-align: middle;
}

.client-link {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.client-link:hover {
  color: #b2fe12;
}

.revenue-value {
  color: #b2fe12;
  font-weight: 600;
}

.weight-value {
  color: rgba(255, 255, 255, 0.5);
}

/* Summary Row */
.dash-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-card {
  background: rgba(35, 35, 40, 0.8);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary-card .material-symbols-rounded {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.3);
}

.summary-info {
  flex: 1;
}

.summary-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.summary-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MARKETING ANALYTICS SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.dash-grid-marketing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
  border-color: rgba(178, 254, 18, 0.2);
}

.stat-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #b2fe12;
}

.stat-card.gradient-purple {
  background: linear-gradient(135deg, rgba(100, 50, 255, 0.15), rgba(100, 50, 255, 0.03));
  border: 1px solid rgba(100, 50, 255, 0.3);
}

.stat-card.gradient-purple:hover {
  border-color: rgba(100, 50, 255, 0.5);
  box-shadow: 0 15px 50px rgba(100, 50, 255, 0.3);
}

.text-gold {
  color: #ffd700 !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.text-muted {
  color: rgba(255, 255, 255, 0.45);
}

.text-sm {
  font-size: 13px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
}

.stat-row span {
  color: rgba(255, 255, 255, 0.6);
}

.stat-row b {
  color: #b2fe12;
  font-weight: 600;
}

.stat-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin: 12px 0 8px 0;
  overflow: hidden;
}

.stat-progress .bar {
  height: 100%;
  background: linear-gradient(90deg, #b2fe12 0%, #9ee00f 100%);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.stat-card small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-container-sm {
  height: 180px;
  position: relative;
  margin-top: 12px;
}

.top-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.top-list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
}

.top-list li:last-child {
  border-bottom: none;
}

.top-list li .promo-code {
  font-weight: 600;
  color: #b2fe12;
  font-family: 'Courier New', monospace;
}

.top-list li .promo-uses {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-right: 8px;
}

.top-list li .promo-revenue {
  font-weight: 600;
  color: #ffd700;
}

.top-list li.empty-state {
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
  justify-content: center;
  padding: 20px 0;
}

/* Stat Card Header with Icon */
.stat-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card-header .material-symbols-rounded {
  font-size: 22px;
  color: #b2fe12;
  opacity: 0.9;
}

.stat-card-header h3 {
  margin: 0;
  flex: 1;
}

.stat-card-header .badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 6px;
}

.stat-card-header .badge-outline {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
}

.stat-card-header .badge-positive {
  background: rgba(178, 254, 18, 0.15);
  color: #b2fe12;
  border: 1px solid rgba(178, 254, 18, 0.3);
}

.stat-card-header .badge-negative {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.3);
}

/* Segment Legend */
.segment-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
}

.segment-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
}

.segment-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AI FORECAST & SECURITY SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.dash-grid-security {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 20px;
  margin-top: 20px;
}

.stat-card.gradient-dark {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(178, 254, 18, 0.15);
}

.stat-card.gradient-dark:hover {
  border-color: rgba(178, 254, 18, 0.4);
  box-shadow: 0 15px 50px rgba(178, 254, 18, 0.15);
}

.stat-card.wide-card {
  grid-column: span 1;
}

.progress-sm {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-sm .bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-sm .bar.bg-lime {
  background: linear-gradient(90deg, #b2fe12 0%, #9ee00f 100%);
}

.mt-2 {
  margin-top: 8px;
}

/* Growth Stats */
.growth-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.growth-stat {
  text-align: center;
}

.growth-stat .label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.growth-stat h3 {
  font-size: 20px;
  font-weight: 700;
  color: #b2fe12;
  margin: 4px 0 0 0;
}

.chart-container-xs {
  height: 60px;
  position: relative;
}

/* Audit Table */
.audit-list-wrapper {
  max-height: 180px;
  overflow-y: auto;
}

.audit-list-wrapper::-webkit-scrollbar {
  width: 4px;
}

.audit-list-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.audit-list-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.table-compact {
  width: 100%;
  border-collapse: collapse;
}

.table-compact td {
  padding: 8px 10px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.table-compact tr:last-child td {
  border-bottom: none;
}

.table-compact .audit-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  white-space: nowrap;
}

.table-compact .audit-admin {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.table-compact .audit-action {
  color: rgba(255, 255, 255, 0.9);
}

.table-compact .audit-target {
  color: #b2fe12;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}

.table-compact .audit-action.danger {
  color: #ff4d4d;
  text-shadow: 0 0 5px rgba(255, 77, 77, 0.4);
}

.table-compact .audit-action.warning {
  color: #ffa500;
}

.table-compact .empty-state {
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Responsive for Security */
@media (max-width: 1400px) {
  .dash-grid-security {
    grid-template-columns: 1fr 1fr;
  }
  
  .stat-card.wide-card {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .dash-grid-security {
    grid-template-columns: 1fr;
  }
  
  .stat-card.wide-card {
    grid-column: span 1;
  }
  
  .growth-stats {
    flex-direction: row;
    gap: 12px;
  }
  
  .growth-stat h3 {
    font-size: 18px;
  }
}

/* Responsive */
@media (max-width: 1400px) {
  .dash-grid-kpi {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dash-grid-secondary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dash-grid-charts {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  
  .chart-card {
    min-height: 350px;
  }
  
  .funnel-grid {
    flex-wrap: wrap;
  }
  
  .funnel-arrow {
    display: none;
  }
  
  .funnel-item {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 100px;
  }
}

@media (max-width: 900px) {
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .dash-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .dash-controls .form-select-sm {
    flex: 1;
    min-width: 120px;
  }
  
  .export-group {
    order: 3;
    width: 100%;
    margin-top: 8px;
  }
  
  .export-group .btn-outline-sm {
    flex: 1;
    justify-content: center;
  }
  
  .dash-grid-kpi {
    grid-template-columns: 1fr;
  }
  
  .dash-grid-secondary {
    grid-template-columns: 1fr;
  }
  
  .dash-grid-lists {
    grid-template-columns: 1fr;
  }
  
  .dash-summary-row {
    grid-template-columns: 1fr;
  }
  
  .dash-grid-marketing {
    grid-template-columns: 1fr;
  }
  
  .chart-container-sm {
    height: 150px;
  }
  
  .funnel-item {
    flex: 1 1 calc(50% - 8px);
  }
}
