/* ==========================================================================
   MANDOOBI ENTERPRISE EMPLOYEE 360 & FLEET COMMAND CENTER (+500 CADRES)
   Enterprise Multi-Tenant Design System - Arabic RTL Optimized
   ========================================================================== */

:root {
  --bg-app: #0b1120;
  --bg-panel: #0f172a;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-dark: #1e293b;
  --border-light: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  --brand-primary: #4f46e5;
  --brand-primary-hover: #4338ca;
  --brand-cyan: #0284c7;
  --brand-success: #10b981;
  --brand-warning: #f59e0b;
  --brand-danger: #ef4444;
  --brand-purple: #8b5cf6;

  --font-arabic: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace, sans-serif;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-arabic);
}

body.theme-command-center {
  background: #f1f5f9;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Helpers */
.mono { font-family: var(--font-mono) !important; }
.text-bold { font-weight: 800 !important; }
.text-success { color: var(--brand-success) !important; }
.text-emerald { color: #059669 !important; }
.text-danger { color: var(--brand-danger) !important; }
.text-warning { color: var(--brand-warning) !important; }
.text-cyan { color: var(--brand-cyan) !important; }

/* ==========================================================================
   1. TOP EXECUTIVE HEADER
   ========================================================================== */
.cmd-header {
  background: #0b1120;
  border-bottom: 1.5px solid #1e293b;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-inverse);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.cmd-brand-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cmd-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-badge {
  background: linear-gradient(135deg, #4f46e5, #0284c7);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.logo-txt {
  font-size: 22px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  margin-right: 6px;
}

.brand-tagline {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.cmd-header-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-pulse-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  color: #34d399;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulseLive 1.8s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.system-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  background: #1e293b;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  letter-spacing: 0.5px;
}

.cmd-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-cmd {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.btn-export {
  background: #0284c7;
  color: #fff;
}
.btn-export:hover { background: #0369a1; }

.btn-broadcast {
  background: #10b981;
  color: #fff;
}
.btn-broadcast:hover { background: #059669; }

.btn-refresh {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
}
.btn-refresh:hover { background: #334155; }

.btn-app-link {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid #0284c7;
  color: #38bdf8;
}
.btn-app-link:hover { background: #0284c7; color: #fff; }

.btn-core-link {
  background: #4f46e5;
  color: #fff;
}
.btn-core-link:hover { background: #4338ca; }

/* ==========================================================================
   2. ADVANCED MULTI-DIMENSIONAL FILTER & SEARCH BAR
   ========================================================================== */
.cmd-filter-bar {
  background: #0f172a;
  border-bottom: 1.5px solid #1e293b;
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 11.5px;
  font-weight: 800;
  color: #94a3b8;
  white-space: nowrap;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover { background: #334155; color: #f8fafc; }
.filter-pill.active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #6366f1;
}

.cmd-select {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.search-group {
  flex: 1;
  min-width: 280px;
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-input-wrap .search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #64748b;
}

.search-input-wrap input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 7px 32px 7px 28px;
  font-size: 12px;
  color: #f8fafc;
  outline: none;
  transition: border-color 0.2s;
}

.search-input-wrap input:focus {
  border-color: #6366f1;
}

.btn-clear-search {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
}
.btn-clear-search:hover { color: #f8fafc; }

/* ==========================================================================
   3. LEVEL 1: EXECUTIVE KPIS GRID
   ========================================================================== */
.executive-kpis-grid {
  padding: 12px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.exec-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exec-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.exec-kpi-card.card-blue { border-right: 4px solid #0284c7; }
.exec-kpi-card.card-green { border-right: 4px solid #10b981; }
.exec-kpi-card.card-amber { border-right: 4px solid #f59e0b; }
.exec-kpi-card.card-purple { border-right: 4px solid #8b5cf6; }
.exec-kpi-card.card-red { border-right: 4px solid #ef4444; }

.kpi-icon-wrap {
  font-size: 26px;
  background: var(--bg-subtle);
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-secondary);
}

.kpi-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin: 2px 0;
}

.kpi-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   4. MAIN OPERATIONAL VIEWPORT (MAP + 500+ ROSTER)
   ========================================================================== */
.main-operational-viewport {
  flex: 1;
  padding: 0 24px 24px 24px;
  transition: all 0.3s ease;
}

/* 1. DEFAULT: STACKED SCROLL-DOWN GRID (خريطة علوية وشبكة عريضة للتمرير لأسفل) */
.main-operational-viewport.layout-stacked {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.main-operational-viewport.layout-stacked .map-viewport-panel {
  width: 100%;
  height: 380px;
  min-height: 380px;
  border-radius: 14px;
}

.main-operational-viewport.layout-stacked .leaflet-map-canvas {
  height: 330px;
  min-height: 330px;
}

.main-operational-viewport.layout-stacked .roster-viewport-panel {
  width: 100%;
  overflow: visible;
  border-radius: 14px;
}

.main-operational-viewport.layout-stacked .reps-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
  padding: 16px;
  overflow: visible;
  max-height: none;
}

/* 2. SPLIT VIEW (عرض ثنائي متجاور مع تمرير داخلي مستقل) */
.main-operational-viewport.layout-split {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 16px;
  height: calc(100vh - 220px);
  min-height: 650px;
}

@media (max-width: 1300px) {
  .main-operational-viewport.layout-split {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.main-operational-viewport.layout-split .map-viewport-panel,
.main-operational-viewport.layout-split .roster-viewport-panel {
  height: 100%;
  max-height: 100%;
}

.main-operational-viewport.layout-split .leaflet-map-canvas {
  height: calc(100% - 46px);
  min-height: 520px;
}

.main-operational-viewport.layout-split .reps-grid-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 340px);
  padding: 12px;
}

/* MAP PANEL */
.map-viewport-panel {
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.map-toolbar {
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.map-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-indicator-dot {
  width: 10px;
  height: 10px;
  background: var(--brand-cyan);
  border-radius: 50%;
}

.map-title-txt {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.cluster-summary-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.map-filter-tags {
  display: flex;
  gap: 4px;
}

.map-tag {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}

.map-tag.active {
  background: var(--brand-cyan);
  color: #fff;
  border-color: var(--brand-cyan);
}

.leaflet-map-canvas {
  flex: 1;
  width: 100%;
}

/* ROSTER VIEWPORT PANEL */
.roster-viewport-panel {
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.roster-header-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-bottom: 1.5px solid var(--border-color);
  padding: 8px 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.roster-header-tabs {
  display: flex;
}

.roster-tab-btn {
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2.5px solid transparent;
  transition: all 0.15s ease;
}

.roster-tab-btn.active {
  background: #ffffff;
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.tab-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.tab-badge.badge-warning {
  background: #fee2e2;
  color: #ef4444;
}

/* Layout Switcher */
.layout-mode-toggle {
  display: flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 6px;
  gap: 2px;
}

.layout-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.layout-btn.active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.view-mode-toggle {
  display: flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 6px;
  gap: 2px;
}

.view-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  border-radius: 4px;
  cursor: pointer;
}

.view-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Filter Results & Pagination Bar */
.filter-results-bar {
  padding: 8px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  flex-wrap: wrap;
  gap: 8px;
}

.results-txt { color: var(--text-secondary); }
.results-txt b { color: var(--brand-primary); font-family: var(--font-mono); }

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
}

.page-indicator {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
}

.page-size-select {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
  outline: none;
}

.roster-tab-body {
  display: none;
  flex: 1;
  flex-direction: column;
}

.roster-tab-body.active {
  display: flex;
}

.reps-grid-container, .exceptions-feed-container {
  flex: 1;
}

/* Custom modern scrollbars */
.reps-grid-container::-webkit-scrollbar,
.reps-table-container::-webkit-scrollbar,
.exceptions-feed-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.reps-grid-container::-webkit-scrollbar-track,
.reps-table-container::-webkit-scrollbar-track,
.exceptions-feed-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.reps-grid-container::-webkit-scrollbar-thumb,
.reps-table-container::-webkit-scrollbar-thumb,
.exceptions-feed-container::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.reps-grid-container::-webkit-scrollbar-thumb:hover,
.reps-table-container::-webkit-scrollbar-thumb:hover,
.exceptions-feed-container::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Floating Back to Top Button */
.btn-back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.25s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.btn-back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.btn-back-to-top:hover {
  background: #4338ca;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
}

/* ==========================================================================
   5. ENTERPRISE DATAGRID TABLE VIEW
   ========================================================================== */
.reps-table-container {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.enterprise-datagrid {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  text-align: right;
}

.enterprise-datagrid thead {
  position: sticky;
  top: 0;
  background: #0f172a;
  color: #fff;
  z-index: 5;
}

.enterprise-datagrid th {
  padding: 10px 12px;
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 1px solid #1e293b;
}

.enterprise-datagrid tbody tr {
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
}

.enterprise-datagrid tbody tr:hover {
  background: #f0f9ff;
}

.enterprise-datagrid td {
  padding: 8px 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.enterprise-datagrid td.td-rep-name {
  font-weight: 800;
  color: var(--text-primary);
}

.table-action-btns {
  display: flex;
  gap: 4px;
}

.table-btn {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   6. EMPLOYEE ROSTER CARDS (LEVEL 2 HIGH-DENSITY)
   ========================================================================== */
.rep-roster-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rep-roster-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
  transform: translateY(-1.5px);
  background: #fafcff;
}

.rc-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.rc-emp-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rc-avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.rc-name-group {
  display: flex;
  flex-direction: column;
}

.rc-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.rc-code-role {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

.rc-code-role .code {
  font-family: var(--font-mono);
  color: var(--brand-cyan);
}

.rc-status-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
}

.rc-status-pill.live { background: #dcfce7; color: #15803d; }
.rc-status-pill.idle { background: #fef9c3; color: #a16207; }
.rc-status-pill.offline { background: #f1f5f9; color: #64748b; }
.rc-status-pill.delayed { background: #fee2e2; color: #b91c1c; }

.rc-meta-strip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rc-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rc-kpis-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: #f8fafc;
  padding: 6px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #eef2f6;
}

.rc-kpi-box {
  display: flex;
  flex-direction: column;
}

.rc-kpi-box .lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.rc-kpi-box .val {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.rc-mission-box {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rc-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.rc-btn {
  flex: 1;
  text-align: center;
  padding: 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.rc-btn:hover { opacity: 0.9; }
.rc-btn-wa { background: #10b981; color: #fff; }
.rc-btn-call { background: #0284c7; color: #fff; }
.rc-btn-360 { background: #4f46e5; color: #fff; }
.rc-btn-locate { background: #334155; color: #fff; width: 34px; flex: none; }

/* ==========================================================================
   7. LEVEL 3: EMPLOYEE 360 FULL WORKSPACE (MODAL / OVERLAY)
   ========================================================================== */
.employee-360-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeInOverlay 0.2s ease-out;
}

.employee-360-overlay.active {
  display: flex;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.employee-360-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 1440px;
  height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  border: 1px solid #334155;
  animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* 360 HEADER */
.emp-360-header {
  background: #0f172a;
  border-bottom: 1.5px solid #1e293b;
  padding: 12px 20px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.emp-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emp-seq-nav {
  display: flex;
  gap: 4px;
}

.btn-seq-nav {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.btn-seq-nav:hover { background: #334155; color: #fff; }

.emp-avatar-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  background: #1e293b;
  border: 2px solid #4f46e5;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.status-indicator.live {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2.5px solid #0f172a;
  border-radius: 50%;
}

.emp-meta-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.emp-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.emp-fullname {
  font-size: 17px;
  font-weight: 900;
  color: #f8fafc;
}

.emp-code-pill {
  background: #1e293b;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #334155;
}

.emp-role-badge {
  background: rgba(79, 70, 229, 0.2);
  color: #818cf8;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(79, 70, 229, 0.4);
}

.emp-live-status-pill {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.emp-telemetry-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #cbd5e1;
}

.tel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.emp-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-range-pills {
  display: flex;
  gap: 4px;
  background: #1e293b;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.date-pill {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.date-pill:hover { color: #f8fafc; }
.date-pill.active {
  background: #4f46e5;
  color: #ffffff;
}

.header-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-360-action {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-360-action.btn-wa { background: #10b981; color: #fff; }
.btn-360-action.btn-call { background: #0284c7; color: #fff; }
.btn-360-action.btn-assign { background: #4f46e5; color: #fff; }

.btn-close-360 {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 900;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-close-360:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* 360 LEVEL 2 KPIS STRIP */
.emp-360-kpis-strip {
  background: #f8fafc;
  border-bottom: 1.5px solid var(--border-color);
  padding: 10px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.emp-kpi-chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.emp-kpi-chip:hover {
  border-color: #6366f1;
  box-shadow: var(--shadow-sm);
}

.emp-kpi-chip .chip-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.emp-kpi-chip .chip-value {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.emp-kpi-chip .chip-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* 360 NAV TABS */
.emp-360-nav-tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1.5px solid var(--border-color);
  padding: 0 20px;
}

.nav-tab-btn {
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.nav-tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: #faf5ff;
}

/* 360 BODY CONTENT */
.emp-360-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  flex: 1;
  overflow: hidden;
}

.tab-pane.active {
  display: flex;
}

/* ==========================================================================
   8. DAILY JOURNEY & SYNCHRONIZED REPLAY MODE
   ========================================================================== */
.journey-split-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 520px;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .journey-split-layout {
    grid-template-columns: 1fr;
  }
}

/* LEFT COLUMN: MAP & REPLAY CONTROLS */
.journey-map-column {
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid var(--border-color);
  background: #e2e8f0;
}

.replay-controls-bar {
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-bottom: 1.5px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2);
  z-index: 10;
}

.replay-playback-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.replay-btn {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.replay-btn:hover { background: #334155; }
.replay-btn.btn-play-pause {
  background: #4f46e5;
  border-color: #6366f1;
}
.replay-btn.btn-play-pause:hover { background: #4338ca; }

.speed-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1e293b;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.speed-label {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 4px;
}

.speed-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.speed-btn.active {
  background: #4f46e5;
  color: #fff;
}

.replay-scrubber-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-stamp-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  min-width: 55px;
}

.replay-slider {
  flex: 1;
  accent-color: #4f46e5;
  cursor: pointer;
  height: 6px;
}

.replay-event-status {
  background: #1e293b;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  border: 1px solid #334155;
}

.replay-event-icon { font-size: 14px; }
.replay-event-title { font-weight: 700; color: #e2e8f0; }

.journey-map-canvas {
  flex: 1;
  width: 100%;
  min-height: 400px;
}

/* RIGHT COLUMN: CHRONOLOGICAL TIMELINE */
.journey-timeline-column {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow: hidden;
}

.timeline-header-bar {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1.5px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.th-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.th-filters {
  display: flex;
  gap: 4px;
}

.th-filter-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
}

.th-filter-btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.timeline-stream-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* TIMELINE NODE CARDS */
.timeline-node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.timeline-node::before {
  content: '';
  position: absolute;
  right: 18px;
  top: 36px;
  bottom: -20px;
  width: 2.5px;
  background: #cbd5e1;
  z-index: 1;
}

.timeline-node:last-child::before {
  display: none;
}

.timeline-node.active-highlight {
  transform: scale(1.01);
}

.timeline-node.active-highlight .node-card {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.node-card {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.node-signin, .node-signout {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  border-color: #334155;
}

.node-signin .node-title, .node-signout .node-title {
  color: #38bdf8;
  font-size: 13.5px;
  font-weight: 900;
}

.node-travel {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.node-travel .node-title {
  color: #0369a1;
  font-size: 12.5px;
  font-weight: 800;
}

.travel-metrics {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  color: #0284c7;
  font-family: var(--font-mono);
}

.node-stop {
  border-right: 4px solid var(--brand-primary);
}

.node-stop.stop-completed { border-right-color: var(--brand-success); }
.node-stop.stop-active {
  border-right-color: var(--brand-warning);
  background: #fffbeb;
  border-color: #fef08a;
}

.node-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.node-heading-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-icon-bubble {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.node-title-meta {
  display: flex;
  flex-direction: column;
}

.node-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.node-time-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.node-status-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.node-customer-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.node-financial-summary {
  display: flex;
  gap: 12px;
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
}

.node-chips-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.rel-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.rel-chip:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.rel-chip.chip-customer { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.rel-chip.chip-sale { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.rel-chip.chip-payment { background: #fef9c3; color: #a16207; border-color: #fef08a; }
.rel-chip.chip-task { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }

.nested-activities-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

.activity-item-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.activity-item-card:hover {
  background: #ffffff;
  border-color: #93c5fd;
  box-shadow: var(--shadow-sm);
  transform: translateX(-2px);
}

.act-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.act-icon { font-size: 15px; }

.act-title-wrap {
  display: flex;
  flex-direction: column;
}

.act-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.act-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.act-amount {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  color: var(--brand-success);
}

/* ==========================================================================
   9. LEVEL 5: AUDIT DRILL-DOWN DRAWER & MODALS
   ========================================================================== */
.drilldown-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: flex-start;
  z-index: 2000;
}

.drilldown-drawer-overlay.active {
  display: flex;
}

.drilldown-drawer {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  animation: drawerSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  background: #0f172a;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid #1e293b;
}

.drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-badge {
  background: #4f46e5;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
}

.drawer-title {
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
}

.btn-close-drawer {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-drawer:hover { background: #ef4444; color: #fff; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.audit-certificate-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cert-icon { font-size: 26px; }
.cert-title { font-size: 12.5px; font-weight: 800; color: #15803d; }
.cert-sub { font-size: 11px; color: #166534; }

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-heading {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.audit-grid {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

.audit-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ai-label { color: var(--text-muted); font-weight: 700; }
.ai-val { color: var(--text-primary); font-weight: 800; }

.drawer-content-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}

.drawer-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1.5px solid var(--border-color);
  display: flex;
  gap: 10px;
}

.btn-drawer {
  flex: 1;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: none;
}

.btn-drawer.btn-primary { background: #4f46e5; color: #fff; }
.btn-drawer.btn-secondary { background: #e2e8f0; color: #334155; }

/* INVENTORY & MONEY JOURNEYS */
.inventory-journey-view, .money-journey-view, .exceptions-journey-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.ledger-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ledger-card .lc-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.ledger-card .lc-val { font-size: 18px; font-weight: 900; font-family: var(--font-mono); color: var(--text-primary); }

/* ASSIGN MODAL */
.assign-task-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 16px;
}

.assign-task-modal-overlay.active { display: flex; }

.assign-modal {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
}

.assign-modal-header {
  padding: 14px 20px;
  background: #0f172a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assign-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

.form-control:focus { border-color: #4f46e5; }

.assign-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ========================================================================== */
/* IN-APP WHATSAPP MESSENGER (GOWS REALTIME CHAT) STYLES */
/* ========================================================================== */

.modal-wa-card {
  max-width: 580px !important;
  width: 95% !important;
  height: 650px !important;
  max-height: 90vh !important;
  background: #111b21 !important;
  color: #e9edef !important;
  padding: 0 !important;
  border-radius: 20px !important;
  border: 1px solid #2a3942 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 168, 132, 0.15) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  font-family: inherit !important;
  direction: rtl !important;
}

.wa-chat-header {
  background: #202c33;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2a3942;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 10;
}

.wa-user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}

.wa-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884 0%, #005c4b 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  border: 2px solid #00a884;
}

.wa-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00a884;
  border: 2px solid #202c33;
  box-shadow: 0 0 8px #00a884;
}

.wa-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-name-row h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #e9edef;
  letter-spacing: -0.3px;
}

.wa-badge-official {
  background: rgba(0, 168, 132, 0.15);
  color: #00a884;
  border: 1px solid rgba(0, 168, 132, 0.3);
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 800;
}

.wa-info p {
  margin: 0;
  font-size: 0.75rem;
  color: #8696a0;
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-wa-header {
  background: transparent;
  border: none;
  color: #aebac1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-wa-header:hover {
  background: #374248;
  color: #ffffff;
}

.btn-wa-close:hover {
  background: rgba(241, 92, 108, 0.2);
  color: #f15c6c;
}

.wa-quick-bar {
  background: #182229;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid #222e35;
  scrollbar-width: thin;
}

.wa-pill {
  background: #202c33;
  color: #aebac1;
  border: 1px solid #2a3942;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wa-pill:hover {
  background: #005c4b;
  color: #d9fdd3;
  border-color: #00a884;
}

.wa-chat-messages {
  flex: 1;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wa-msg.outbound {
  align-self: flex-start;
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 2px;
}

.wa-msg.inbound {
  align-self: flex-end;
  background: #202c33;
  color: #e9edef;
  border-top-left-radius: 2px;
}

.wa-msg-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
  color: #00a884;
  margin-bottom: 2px;
}

.wa-msg.inbound .wa-msg-header {
  color: #53bdeb;
}

.wa-msg-body {
  white-space: pre-wrap;
}

.wa-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.68rem;
  color: #8696a0;
  margin-top: 2px;
}

.wa-ticks {
  color: #53bdeb;
  font-weight: 900;
  font-size: 0.78rem;
}

.wa-chat-footer {
  background: #202c33;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #2a3942;
}

.wa-input-wrap {
  flex: 1;
  background: #2a3942;
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
}

.wa-input-wrap textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #e9edef;
  font-size: 0.86rem;
  font-family: inherit;
  resize: none;
  max-height: 80px;
}

.btn-wa-send {
  background: linear-gradient(135deg, #00a884 0%, #008f6f 100%);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 168, 132, 0.35);
  transition: all 0.2s ease;
}

.btn-wa-send:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-wa-send:active {
  transform: translateY(1px);
}

.wa-chat-loader {
  text-align: center;
  color: #8696a0;
  font-size: 0.82rem;
  padding: 30px;
}
