/* 
  AI Call Evaluator & Analytics Service Dashboard Stylesheet
  Theme: Sleek Glassmorphism Dark Mode
  Fonts: Outfit & Inter (Google Fonts)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark; /* Force dark mode native widgets across all browsers */
  --bg-gradient: radial-gradient(circle at 50% 50%, #121420 0%, #08090f 100%);
  --panel-bg: rgba(16, 20, 38, 0.6);
  --panel-border: rgba(255, 255, 255, 0.05);
  --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --primary: #6366f1; /* Neon Indigo */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --primary-hover: #4f46e5;
  
  --success: #10b981; /* Emerald */
  --success-glow: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b; /* Amber */
  --warning-glow: rgba(245, 158, 11, 0.1);
  --danger: #ef4444; /* Rose */
  --danger-glow: rgba(239, 68, 68, 0.1);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --bg-card: #0d0f17;
  --text-main: #f3f4f6;
  
  --sidebar-width: 260px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(10, 11, 18, 0.8);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.5rem;
  z-index: 10;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding-left: 0.5rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background: var(--primary-glow);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.nav-item.active i {
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--panel-border);
}

.user-profile-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-email {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.68rem;
  color: #818cf8;
  font-weight: 500;
}

.btn-logout {
  color: #9ca3af;
  font-size: 1rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.bl-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  margin: 0.15rem;
}

.bl-tag-pill.all-access {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.api-status-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-indicator.offline {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.status-details h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.status-details p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
}

/* Header */
header {
  height: 70px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(10, 11, 18, 0.4);
  backdrop-filter: blur(10px);
}

.header-title h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  background: var(--primary);
  color: var(--text-primary);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.btn-secondary.active, .btn-secondary.active:hover {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 15px var(--primary-glow) !important;
}

/* Panels */
.panel {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: none;
}

.panel.active {
  display: block;
}

/* Dashboard Metrics Grid */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--glass-glow);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.2);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.kpi-header i {
  font-size: 1.25rem;
  color: var(--primary);
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
}

.kpi-footer {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Visual Layout Columns */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.section-box {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--glass-glow);
  backdrop-filter: blur(12px);
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Custom Vector SVGs and Charts */
.chart-container {
  height: 260px;
  width: 100%;
  position: relative;
  margin-top: 1rem;
}

/* Responsive Table */
.data-table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--panel-border);
}

td {
  padding: 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* Badge Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 0.25rem;
}

.badge-pending { background: var(--warning-glow); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-processing { background: var(--primary-glow); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-completed { background: var(--success-glow); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-failed { background: var(--danger-glow); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-unanswered { background: rgba(148, 163, 184, 0.05); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }


/* Lost Opportunities Box */
.lost-ops-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lost-op-card {
  background: rgba(239, 68, 68, 0.02);
  border: 1px solid rgba(239, 68, 68, 0.1);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.lost-op-card:hover {
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateX(4px);
}

.lost-op-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lost-op-title {
  font-weight: 600;
  color: #ff8080;
  font-size: 0.95rem;
}

.lost-op-reason {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--danger);
  padding-left: 0.5rem;
  margin-top: 0.25rem;
}

/* Call detail side-by-side modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  background: #11131f;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

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

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.modal-column {
  overflow-y: auto;
  padding: 2rem;
}

.modal-column-left {
  border-right: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.1);
}

.transcript-bubble-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bubble {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1rem;
  line-height: 1.5;
  font-size: 0.92rem;
}

.bubble-manager {
  border-left: 3px solid var(--primary);
}

.bubble-speaker {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
}

/* Category score visual gauges */
.gauges-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.gauge-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.gauge-circle {
  position: relative;
  width: 60px;
  height: 60px;
}

.gauge-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}

.gauge-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Settings Form Styles */
.settings-group {
  margin-bottom: 1.5rem;
}

.settings-label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.prompt-editor {
  width: 100%;
  height: 400px;
  background: #0d0f17;
  border: 1px solid var(--panel-border);
  color: #a5b4fc;
  font-family: 'Courier New', Courier, monospace;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.5;
}

/* Markdown parsing output box */
.markdown-view h1, .markdown-view h2, .markdown-view h3 {
  font-family: 'Outfit', sans-serif;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}
.markdown-view h1 { font-size: 1.4rem; border-bottom: 1px solid var(--panel-border); padding-bottom: 0.4rem; }
.markdown-view h2 { font-size: 1.2rem; }
.markdown-view h3 { font-size: 1.05rem; }
.markdown-view p { line-height: 1.6; margin-bottom: 0.85rem; font-size: 0.95rem; color: var(--text-primary); }
.markdown-view ul, .markdown-view ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.markdown-view li { margin-bottom: 0.4rem; font-size: 0.92rem; }
.markdown-view blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-glow);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0 8px 8px 0;
}

.crm-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed var(--primary);
  transition: var(--transition-smooth);
}

.crm-link:hover {
  color: var(--primary-hover);
  border-bottom: 1px solid var(--primary-hover);
  opacity: 0.95;
}

/* Manager Selector Section */
.manager-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.manager-select {
  background: #0d0f17;
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

/* Interactive SVG vector chart lines */
.svg-chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0px 4px 10px rgba(99, 102, 241, 0.4));
}
.svg-chart-dots {
  fill: var(--primary);
  stroke: #ffffff;
  stroke-width: 2;
  cursor: pointer;
}
.svg-chart-grid {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}

/* Toast alert messages */
.toast-msg {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-msg.active {
  transform: translateY(0);
  opacity: 1;
}

/* Header Progress Bar */
.header-progress-container {
  flex: 1;
  max-width: 300px;
  margin: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  width: 0%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Planned Activities (Next Actions) List Styles */
.planned-activities-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: var(--glass-glow);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--transition-smooth);
}

.activity-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.activity-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: bold;
}

.activity-type-1 { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.2); } /* Call */
.activity-type-2 { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); } /* Meeting */
.activity-type-3 { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); } /* Email */
.activity-type-4 { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.2); } /* Task */

.activity-subject {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.activity-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.activity-meta-item i {
  color: var(--text-muted);
}

.activity-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 2px solid var(--primary);
}

.activity-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.activity-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
}

.activity-badge-overdue { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.activity-badge-planned { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }


/* Custom Premium Dark Glassmorphism Flatpickr styling */
.flatpickr-calendar {
  background: rgba(16, 20, 38, 0.95) !important;
  backdrop-filter: blur(15px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6) !important;
  font-family: 'Inter', sans-serif !important;
  border-radius: 12px !important;
}

.flatpickr-calendar.arrowTop:after {
  border-bottom-color: rgba(16, 20, 38, 0.95) !important;
}
.flatpickr-calendar.arrowTop:before {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.flatpickr-calendar.arrowBottom:after {
  border-top-color: rgba(16, 20, 38, 0.95) !important;
}
.flatpickr-calendar.arrowBottom:before {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

.flatpickr-months {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding-bottom: 5px;
}

.flatpickr-month {
  color: var(--text-primary) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
  border-bottom-color: var(--text-primary) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
  border-top-color: var(--text-primary) !important;
}

.flatpickr-day {
  color: var(--text-secondary) !important;
  border-radius: 8px !important;
  transition: all 0.15s ease;
}

.flatpickr-day.today {
  border-color: var(--primary) !important;
  background: rgba(99, 102, 241, 0.1) !important;
  color: #fff !important;
}

.flatpickr-day:hover, .flatpickr-day.prevMonthDay:hover, .flatpickr-day.nextMonthDay:hover {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4) !important;
}

.flatpickr-time {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: transparent !important;
}

.flatpickr-time input {
  color: #fff !important;
  font-weight: 600 !important;
}

.flatpickr-time .flatpickr-am-pm {
  color: #fff !important;
}

.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.flatpickr-weekday {
  color: var(--text-muted) !important;
  font-weight: 600 !important;
}

/* Fix Dropdown Legibility in Dark Theme */
select option {
  background-color: #11131f !important;
  color: #f3f4f6 !important;
}

select:focus option {
  background-color: #11131f !important;
  color: #f3f4f6 !important;
}

select, .manager-select, .input-field {
  color-scheme: dark; /* Signals browser to use dark-themed native UI widgets */
}

/* Glassmorphic Business Line Selector styles */
.business-line-selector-container {
  display: flex;
  align-items: center;
  margin-left: 1rem;
}

.glass-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 0.5rem 2.2rem 0.5rem 1rem;
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: var(--transition-smooth);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%25239ca3af%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-7.7H18.4a17.6%2017.6%200%200%200-13%207.7%2017.6%2017.6%200%200%200%20.1%2020L135%20259.3a17.6%2017.6%200%200%200%2028.4%200L287%2089.4a17.6%2017.6%200%200%200%200-20z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem top 50%;
  background-size: 0.65rem auto;
}

.glass-select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

.glass-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

/* Premium stage hover tooltips */
.stage-tooltip-trigger {
  position: relative;
  cursor: help;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.stage-tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 145%;
  left: 50%;
  transform: translateX(-50%) translateY(4px) scale(0.95);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  width: 260px;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-tooltip-trigger::before {
  content: "";
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px) scale(0.95);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.96) transparent transparent transparent;
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-tooltip-trigger:hover::after,
.stage-tooltip-trigger:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.stage-info-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.5;
  transition: var(--transition-smooth);
}

.stage-tooltip-trigger:hover .stage-info-icon {
  opacity: 1;
  color: var(--primary);
  transform: scale(1.15);
}

/* ========================================================
   Enterprise Dynamics & Analytics Page Styles
   ======================================================== */

/* Presets & Filter Ribbon */
.mgr-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  background: rgba(16, 20, 38, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  margin-bottom: 1.25rem;
}

.mgr-preset-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mgr-preset-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mgr-preset-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.mgr-preset-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Sub-Tab Navigation */
.mgr-subtabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
  padding-bottom: 2px;
}

.mgr-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mgr-subtab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px 6px 0 0;
}

.mgr-subtab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  border-radius: 6px 6px 0 0;
}

/* Top Department KPI Ribbon */
.dept-kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dept-kpi-card {
  background: rgba(16, 20, 38, 0.6);
  border: 1px solid var(--panel-border);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.dept-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.dept-kpi-card .card-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dept-kpi-card .card-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.dept-kpi-card .card-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Competency Mini Bar in Table */
.skill-bar-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 140px;
}

.skill-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.skill-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Missed Calls Tag */
.missed-alert-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.missed-alert-tag:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: scale(1.05);
}

.missed-clean-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 500;
}

/* Grade Badges */
.grade-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.grade-excellent { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.grade-good { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.grade-needs_attention { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.grade-critical { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Skeleton Loader */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

/* Radar Chart & Benchmark bars */
.radar-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  position: relative;
}

.benchmark-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}

.benchmark-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.benchmark-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.5s ease;
}

.benchmark-dept-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #f59e0b;
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  z-index: 2;
}

/* Smart Diagnostic Cards */
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.diagnostic-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  position: relative;
}

.diagnostic-card.superpower { border-left: 4px solid var(--success); }
.diagnostic-card.bottleneck { border-left: 4px solid var(--danger); }
.diagnostic-card.stability { border-left: 4px solid var(--primary); }


