/*
  AURA Insight - Premium Executive Business Intelligence Style System
  Curated Harmony Dark Theme
*/

:root {
  --bg-dark: #070913;
  --bg-panel: rgba(13, 17, 39, 0.45);
  --bg-panel-hover: rgba(20, 26, 56, 0.6);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Glowing Accents */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-rose: #f43f5e;
  
  --grad-primary: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-orange: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-rose: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  
  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --backdrop-blur: blur(20px) saturate(180%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Custom Scrollbar for premium feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Glow Effects */
.glass-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  top: -10%;
  left: -10%;
  z-index: -1;
  filter: blur(65px);
  animation: float 25s infinite alternate;
}

.glass-bg-glow.secondary {
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  bottom: -10%;
  right: -10%;
  top: auto;
  left: auto;
  animation: float 30s infinite alternate-reverse;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 40px) scale(1.1); }
  100% { transform: translate(-40px, -80px) scale(0.9); }
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: linear-gradient(135deg, rgba(13, 17, 39, 0.55) 0%, rgba(7, 9, 19, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Application Layout */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden; /* Safeguards responsive boundaries */
}

/* Sidebar Navigation Layout */
.sidebar {
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.brand-logo i {
  font-size: 20px;
  color: white;
}

.brand h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #ffffff 30%, #a855f7 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub-brand {
  display: block;
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation Items */
.sidebar-nav {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
  color: white;
  box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 10px 10px 0;
  padding-left: 13px;
}

.nav-item.active i {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 5px var(--accent-cyan));
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  transition: all 0.2s;
}

/* Status Widget */
.status-widget {
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
}

.status-widget h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.status-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.offline {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.status-dot.warning {
  background-color: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* Main Content Area */
.main-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
}

/* Main Header */
.main-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1000 !important;
}

.header-welcome h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.currency-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* KPI Metrics Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.kpi-card {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: white;
  flex-shrink: 0; /* Prevents icon from shrinking under large figures */
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0; /* Safeguards layout overflow and wraps values safely */
}

.kpi-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 21px; /* Calibrated font-size to fit large values in one line when cards are wide */
  font-weight: 700;
  letter-spacing: -0.3px;
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(120deg, #ffffff 40%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 2px 0;
  white-space: nowrap; /* Enforce single line */
  overflow: hidden;
  text-overflow: ellipsis; /* Clip elegantly rather than wrapping horribly */
  line-height: 1.2;
}

.kpi-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Glowing Border/Shadows for KPI Themes */
.cyan-glow .kpi-icon { background: var(--grad-cyan); }
.cyan-glow:hover {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.purple-glow .kpi-icon { background: var(--grad-primary); }
.purple-glow:hover {
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}

.green-glow .kpi-icon { background: var(--grad-green); }
.green-glow:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.orange-glow .kpi-icon { background: var(--grad-orange); }
.orange-glow:hover {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.rose-glow .kpi-icon { background: var(--grad-rose); }
.rose-glow:hover {
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.15);
}

.red-glow .kpi-icon { background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%); }
.red-glow:hover {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

/* Dashboard Visuals Panel */
.dashboard-visuals-grid {
  display: flex;
  gap: 20px;
  width: 100%;
  margin-top: 24px;
}

.visual-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0; /* Prevents child items (like Chart.js canvas) from overflowing in flex layouts */
  overflow: hidden; /* Encapsulates the chart boundaries */
}

.visual-card.flex-2 { flex: 2; }
.visual-card.flex-1 { flex: 1; }

.visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.visual-header h3 {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.visual-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  color: var(--text-muted);
}

.bi-chart {
  height: 380px;
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* Recent Logs List inside BI Dash */
.recent-logs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
  padding-right: 4px;
}

.recent-log-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.recent-log-item:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(4px);
}

.log-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-no {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.log-act {
  font-size: 11px;
  color: var(--text-secondary);
}

.log-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-amt {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.log-date {
  font-size: 10px;
  color: var(--text-muted);
}

/* Controls Panel */
.panel-controls {
  padding: 20px 24px;
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
  position: relative;
  z-index: 50; /* Creates an elevated stacking context for absolute dropdowns */
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-selector-wrapper {
  display: flex;
  gap: 10px;
}

.date-selector-wrapper input,
.filter-box input,
.search-box input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: all 0.3s;
}

.date-selector-wrapper input:focus,
.filter-box input:focus,
.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.search-filter-wrapper {
  flex: 1;
  min-width: 260px;
}

.filter-box,
.search-box {
  position: relative;
}

.filter-box i,
.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-box input,
.search-box input {
  padding-left: 36px;
  width: 100%;
}

/* Autocomplete search container */
.autocomplete-container {
  position: relative;
  flex: 1;
  min-width: 320px;
  z-index: 100; /* Guarantees results render in front of tables and content below */
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(13, 17, 39, 0.95);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(20px);
  border-radius: 10px;
  box-shadow: var(--shadow-main);
  max-height: 250px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 6px;
  z-index: 1000;
  margin-top: 6px;
}

.autocomplete-dropdown.show {
  display: flex;
}

.dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.selected-meta-info {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-light);
  border-radius: 10px;
  padding: 18px 24px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.selected-meta-info h4 {
  font-weight: 600;
  color: var(--accent-cyan);
}

.selected-meta-info span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Table results container */
.table-results-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-actions-header {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.table-actions-header h3 {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-scroll-container {
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
}

/* Standard Table design */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 13px;
  text-align: left;
  margin-top: -6px;
}

.data-table th, .data-table td {
  padding: 14px 20px;
}

.data-table th {
  background: rgba(9, 11, 23, 0.7);
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  background: rgba(255, 255, 255, 0.015);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
}

.data-table tbody tr td:first-child {
  border-radius: 10px 0 0 10px;
  border-left: 2px solid transparent;
}

.data-table tbody tr td:last-child {
  border-radius: 0 10px 10px 0;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.data-table tbody tr:hover td:first-child {
  border-left-color: var(--accent-cyan);
}

.data-table td {
  color: var(--text-primary);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.text-right { text-align: right; }
.text-green { color: var(--accent-green) !important; }
.text-orange { color: var(--accent-orange) !important; }
.text-rose { color: var(--accent-rose) !important; }
.text-red { color: var(--accent-red) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-emerald { color: var(--accent-emerald) !important; }

/* Day Book Footer */
.daybook-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 30px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.01);
}

.daybook-footer strong {
  color: white;
  font-weight: 700;
}

/* Ledger Selection Tabs */
.ledger-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.ledger-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.ledger-tab-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: white;
}

.ledger-tab-btn.active {
  background: rgba(255, 255, 255, 0.07);
  color: white;
  box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.1);
}

.ledger-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.ledger-panel.active {
  display: flex;
}

/* Buttons System */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.action-btn.primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-btn.sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

/* Conversational AI Pane specific Styles */
.pane-content {
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Suggestions Dropdown */
.suggestions-dropdown-wrapper {
  position: relative;
}

.suggestions-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: rgba(13, 17, 39, 0.95);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: var(--shadow-main);
  width: 320px;
  display: none;
  flex-direction: column;
  padding: 8px;
  z-index: 100;
}

.suggestions-menu.show {
  display: flex;
}

.suggestion-item {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: translateX(4px);
}

/* Chat area loading indicators */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
}

.loader {
  display: flex;
  gap: 8px;
}

.loader .circle {
  width: 14px;
  height: 14px;
  background: var(--grad-primary);
  border-radius: 50%;
  animation: bounce 0.6s infinite alternate;
}

.loader .circle:nth-child(2) {
  animation-delay: 0.2s;
  background: var(--accent-blue);
}

.loader .circle:nth-child(3) {
  animation-delay: 0.4s;
  background: var(--accent-cyan);
}

@keyframes bounce {
  to { transform: translateY(-12px); opacity: 0.5; }
}

/* Markdown results */
.markdown-body {
  font-size: 14px;
  line-height: 1.7;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin-top: 22px;
  margin-bottom: 12px;
  font-weight: 600;
  color: white;
}

.markdown-body h1 { font-size: 18px; }
.markdown-body h2 { font-size: 16px; }
.markdown-body h3 { font-size: 14px; }

.markdown-body ul, .markdown-body ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body p {
  margin-bottom: 16px;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent-blue);
  padding-left: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 16px;
}

/* Welcome Card style */
.welcome-card {
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.welcome-visual {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
  margin-bottom: 10px;
}

.welcome-card h2 {
  font-size: 22px;
  font-weight: 700;
}

.welcome-card > p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
  width: 100%;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.feature-card .icon {
  font-size: 20px;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.feature-card h4 {
  font-size: 14px;
  font-weight: 600;
}

.feature-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Tabs and visual components */
.tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: white;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.1);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

/* Code area */
.code-editor-container {
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  overflow-x: auto;
}

.code-editor-container code {
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 13px;
  color: #38bdf8;
  line-height: 1.5;
}

/* Responsive Layout rules */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .dashboard-visuals-grid {
    flex-direction: column;
  }
}

/* =========================================================================
   BRANCH, SERIES & CREDIT LIMIT UPGRADE STYLES (NEW)
   ========================================================================= */

/* Upgraded Header Filter Dropdowns */
.header-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 17, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  position: relative;
}

.header-filter-wrapper:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.header-filter-wrapper label {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdc-toggle-wrapper {
  cursor: pointer;
  user-select: none;
}
.pdc-toggle-wrapper label {
  cursor: pointer;
}
.header-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-cyan, #06b6d4);
  cursor: pointer;
}

.header-select {
  background: transparent;
  border: none;
  color: white;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  padding-right: 20px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 16px;
}

.header-filter-wrapper .header-select {
  margin-left: auto;
  text-align-last: right;
}

.header-select option {
  background: #090b16;
  color: white;
  padding: 12px;
  font-weight: 600;
}

.header-input-date {
  background: transparent;
  border: none;
  color: white;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}
.header-input-date::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}


/* Upgraded Ledger Profile Badges Grid */
.meta-profile {
  flex: 1;
  min-width: 200px;
}

.meta-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

@media (max-width: 1024px) {
  .meta-badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .meta-badges-grid {
    grid-template-columns: 1fr;
  }
}

.meta-badge-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.25s ease;
}

.meta-badge-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.03);
}

.meta-badge-card .badge-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.meta-badge-card .badge-value {
  font-size: 18px;
  font-weight: 700;
  color: white;
  font-family: 'Outfit', sans-serif;
}

.meta-badge-card.highlight {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.03);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.05);
}

.meta-badge-card.highlight.in-debit {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.03);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.05);
}

.meta-badge-card.highlight.in-debit .badge-value {
  color: var(--accent-rose) !important;
}

/* Glowing Warning Alert Bar */
.credit-limit-alert {
  width: 100%;
  margin-top: 14px;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #f87171;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
  animation: borderGlow 2s infinite alternate;
}

@keyframes borderGlow {
  from { border-color: rgba(239, 68, 68, 0.35); box-shadow: 0 0 10px rgba(239, 68, 68, 0.1); }
  to { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 20px rgba(239, 68, 68, 0.25); }
}

/* Overdue status font modifications */
.font-bold { font-weight: 700 !important; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

}

@media (max-width: 768px) {
  .selected-meta-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .meta-badges-grid {
    margin-left: 0;
  }
}

/* =========================================================================
   PROFESSIONAL REDESIGN ADDITIONAL STYLES
   ========================================================================= */

/* Clickable Table Rows Visual States */
.clickable tbody tr {
  cursor: pointer;
}

.clickable tbody tr:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  transform: scale(1.002);
  transition: all 0.2s ease;
}

/* Modal visual backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 20, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  width: 90%;
  max-width: 950px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-vch-icon {
  font-size: 26px;
  background: rgba(6, 182, 212, 0.1);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.modal-vch-icon.sales {
  color: var(--accent-cyan) !important;
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
}

.modal-vch-icon.purchase {
  color: var(--accent-purple) !important;
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
}

.modal-vch-icon.receipt {
  color: var(--accent-green) !important;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
}

.modal-vch-icon.payment {
  color: var(--accent-orange) !important;
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.2);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin: 0;
  font-family: 'Outfit';
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: white;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item strong {
  font-size: 14px;
  color: white;
}

.info-item.highlight strong {
  color: var(--accent-cyan);
  font-size: 16px;
  font-weight: 800;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-section h4 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
}

.table-scroll-container.sm {
  max-height: 250px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.data-table.sm th, .data-table.sm td {
  padding: 8px 14px;
  font-size: 12px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.015);
}

.modal-footer-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Custom visual pane indicator border highlights */
#pane-sales .kpi-card { border-color: rgba(6, 182, 212, 0.15); }
#pane-purchase .kpi-card { border-color: rgba(168, 85, 247, 0.15); }
#pane-ledger .kpi-card { border-color: rgba(99, 102, 241, 0.15); }
#pane-stock .kpi-card { border-color: rgba(245, 158, 11, 0.15); }

/* Scrollable Sidebar Nav List */
.sidebar-nav {
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Sidebar Nav Group Label */
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 16px 12px 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.85;
}

.nav-group-label i {
  font-size: 9px;
  opacity: 0.7;
}

/* Color Accent Variations for active states in different registers */
.nav-item[data-pane="pane-sales-return"].active {
  border-left-color: var(--accent-rose);
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.nav-item[data-pane="pane-sales-return"].active i {
  color: var(--accent-rose);
  filter: drop-shadow(0 0 5px var(--accent-rose));
}

.nav-item[data-pane="pane-purchase-return"].active {
  border-left-color: var(--accent-red);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.nav-item[data-pane="pane-purchase-return"].active i {
  color: var(--accent-red);
  filter: drop-shadow(0 0 5px var(--accent-red));
}

.nav-item[data-pane="pane-payment"].active {
  border-left-color: var(--accent-orange);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.nav-item[data-pane="pane-payment"].active i {
  color: var(--accent-orange);
  filter: drop-shadow(0 0 5px var(--accent-orange));
}

.nav-item[data-pane="pane-receipt"].active {
  border-left-color: var(--accent-green);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.nav-item[data-pane="pane-receipt"].active i {
  color: var(--accent-green);
  filter: drop-shadow(0 0 5px var(--accent-green));
}

.nav-item[data-pane^="pane-cash-"].active,
.nav-item[data-pane^="pane-bank-"].active,
.nav-item[data-pane^="pane-pdc-"].active {
  border-left-color: var(--accent-blue);
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.nav-item[data-pane^="pane-cash-"].active i,
.nav-item[data-pane^="pane-bank-"].active i,
.nav-item[data-pane^="pane-pdc-"].active i {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 5px var(--accent-blue));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Sub-tabs styles */
.sub-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
}
.sub-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.sub-tab-btn.active {
  background: var(--grad-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

/* Accordion Hierarchy Tree */
.group-hierarchy-tree ul {
  list-style: none;
  padding-left: 15px;
  margin: 5px 0;
}
.group-hierarchy-tree > ul {
  padding-left: 0;
}
.tree-node-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.tree-node-wrapper:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}
.tree-node-wrapper.selected {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  font-weight: 600;
}
.tree-toggle-icon {
  width: 14px;
  text-align: center;
  transition: transform 0.2s;
}
.tree-toggle-icon.expanded {
  transform: rotate(90deg);
}

/* Critical Stock Badges */
.badge-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.badge-overstock {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.badge-normal {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.nav-item[data-pane="pane-critical"].active {
  border-left-color: var(--accent-rose);
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
}
.nav-item[data-pane="pane-critical"].active i {
  color: var(--accent-rose);
  filter: drop-shadow(0 0 5px var(--accent-rose));
}

/* Dynamic Config Badge / Database Discovery Timestamp */
.config-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: normal;
  width: 100%;
  box-sizing: border-box;
}

.config-badge i {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.4));
  font-size: 12px;
  flex-shrink: 0;
}

.config-badge span {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: white;
}



/* =========================================================================
   AURA Insight V2.9 - ULTRA-PREMIUM RESPONSIVE MOBILE DRAWER & UI OVERHAUL
   ========================================================================= */

/* Mobile Top Header (Hidden on Desktop) */
.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(9, 11, 23, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0; /* Header spans full width */
  z-index: 998;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.mobile-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.mobile-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand h2 {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #ffffff 40%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo.sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-cyan);
}

.brand-logo.sm i {
  font-size: 14px;
  color: white;
}

.mobile-active-pane-badge {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sidebar Drawer Backdrop Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 4, 10, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Swipe-scrollable responsive tables container styling */
.table-scroll-container, .table-results-container {
  -webkit-overflow-scrolling: touch;
}

/* Mobile responsive style adjustments */
@media (max-width: 1024px) {
  .mobile-top-bar {
    display: flex;
  }
  
  /* Sidebar as slide-out drawer on Mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    z-index: 3000 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    border-radius: 0;
    background: linear-gradient(135deg, rgba(9, 11, 23, 0.98) 0%, rgba(5, 6, 12, 0.99) 100%) !important;
  }
  
  .sidebar-overlay {
    z-index: 2999 !important;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  /* Main content layout adjust */
  .app-container {
    grid-template-columns: 1fr;
    padding-top: 64px; /* Space for fixed mobile top bar */
  }
  
  .main-content {
    height: calc(100vh - 64px);
    padding: 16px;
  }
  
  /* Stack Dashboard metrics and details grid */
  .dashboard-visuals-grid {
    flex-direction: column;
    gap: 16px;
  }
  
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }
  
  .kpi-card {
    padding: 12px 10px;
  }
  
  .kpi-value {
    font-size: 18px; /* Fluid scaling on smaller viewports */
  }
  
  /* Responsive Header filters bar stacking */
  .main-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px 20px;
  }
  
  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  
  .header-filter-wrapper {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
  }
  
  #global-custom-date-container {
    grid-column: span 2;
    width: 100%;
    justify-content: center;
    gap: 16px;
  }
  
  #btn-apply-global-date {
    grid-column: span 2;
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
  
  /* Responsive table rows sizing */
  .data-table th, .data-table td {
    padding: 12px 14px;
    font-size: 12px;
  }
  
  /* Modal adjustments for small screens */
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-body {
    padding: 16px;
    gap: 16px;
  }
  
  .modal-info-grid {
    grid-template-columns: 1fr 1fr;
    padding: 12px 14px;
  }
}

@media (max-width: 640px) {
  .header-actions {
    grid-template-columns: 1fr;
  }
  
  .header-filter-wrapper {
    grid-column: span 1;
  }
  
  #global-custom-date-container {
    grid-column: span 1;
  }
  
  #btn-apply-global-date {
    grid-column: span 1;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Premium V2 Glass-Obsidian Aesthetics & Glow Updates */
:root {
  --bg-dark: #030408;
  --bg-panel: rgba(12, 15, 29, 0.5);
  --border-light: rgba(255, 255, 255, 0.05);
}

.glass-panel {
  background: linear-gradient(135deg, rgba(12, 15, 29, 0.5) 0%, rgba(4, 6, 12, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

/* Scrollbar tweaks */
.main-content::-webkit-scrollbar {
  width: 4px;
}
.main-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}
.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Autocomplete choice premium styling */
.autocomplete-choice {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.autocomplete-choice:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Premium active row highlight */
.data-table tbody tr.active-row td {
  background: rgba(255, 255, 255, 0.05) !important;
  border-left: 2px solid var(--accent-cyan);
}

/* =========================================================================
   VERSION 3.7 - JWALA SHOP LOGO BRANDING & PREMIUM CONVERSATIONAL AI OVERHAUL
   ========================================================================= */

.brand {
  position: relative;
  z-index: 10;
}

.brand-text-wrapper {
  position: relative;
  z-index: 5;
}

.brand-logo.has-img {
  background: #ffffff !important;
  padding: 4px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15), 0 0 5px rgba(168, 85, 247, 0.3);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.brand-watermark {
  position: absolute;
  right: -25px;
  top: -30px;
  width: 110px;
  height: 110px;
  opacity: 0.07;
  pointer-events: none;
  z-index: 1;
  transform: rotate(-15deg);
  transition: all 0.3s ease;
}

.brand:hover .brand-watermark {
  opacity: 0.12;
  transform: rotate(-10deg) scale(1.08);
}

.brand-watermark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* AI Page Premium Split Layout */
.ai-welcome-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 24px;
  margin-top: 20px;
  width: 100%;
}

@media (max-width: 992px) {
  .ai-welcome-grid {
    grid-template-columns: 1fr;
  }
}

.ai-greeting-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 32px;
  gap: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.ai-greeting-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.ai-glowing-sphere {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: white;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.25), inset 0 0 10px rgba(168, 85, 247, 0.1);
  position: relative;
}

.ai-glowing-sphere img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ai-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  animation: pulseOuter 2.5s infinite ease-out;
  pointer-events: none;
}

@keyframes pulseOuter {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.ai-greeting-card h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-greeting-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ai-mini-badges-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.ai-mini-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.25s;
}

.ai-mini-badge:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.ai-mini-badge i {
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.ai-mini-badge.security i { color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }
.ai-mini-badge.schema i { color: var(--accent-purple); background: rgba(168, 85, 247, 0.1); }
.ai-mini-badge.healing i { color: var(--accent-orange); background: rgba(249, 115, 22, 0.1); }

.ai-mini-badge-text h5 {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ai-mini-badge-text p {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.3;
}

/* Prompt Grid Styles */
.prompt-section-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompt-section-header h3 {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.prompt-section-header span {
  font-size: 12px;
  color: var(--text-secondary);
}

.prompt-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

@media (max-width: 600px) {
  .prompt-cards-grid {
    grid-template-columns: 1fr;
  }
}

.prompt-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

/* Color-coded glow tabs */
.prompt-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-purple);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.prompt-card.c-purple::after { background: var(--accent-purple); }
.prompt-card.c-cyan::after { background: var(--accent-cyan); }
.prompt-card.c-orange::after { background: var(--accent-orange); }
.prompt-card.c-green::after { background: var(--accent-green); }

.prompt-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.prompt-card.c-purple:hover { box-shadow: 0 8px 25px rgba(168, 85, 247, 0.08); }
.prompt-card.c-cyan:hover { box-shadow: 0 8px 25px rgba(6, 182, 212, 0.08); }
.prompt-card.c-orange:hover { box-shadow: 0 8px 25px rgba(249, 115, 22, 0.08); }
.prompt-card.c-green:hover { box-shadow: 0 8px 25px rgba(34, 197, 94, 0.08); }

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.prompt-card-header .icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  font-size: 15px;
  transition: all 0.3s;
}

.prompt-card:hover .icon-wrap {
  transform: scale(1.1) rotate(5deg);
}

.prompt-card.c-purple .icon-wrap { color: var(--accent-purple); background: rgba(168, 85, 247, 0.08); }
.prompt-card.c-cyan .icon-wrap { color: var(--accent-cyan); background: rgba(6, 182, 212, 0.08); }
.prompt-card.c-orange .icon-wrap { color: var(--accent-orange); background: rgba(249, 115, 22, 0.08); }
.prompt-card.c-green .icon-wrap { color: var(--accent-green); background: rgba(34, 197, 94, 0.08); }

.prompt-card-header .cat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.prompt-card h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.prompt-card p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.prompt-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.prompt-card:hover .prompt-card-footer {
  color: var(--text-primary);
}

.prompt-card.c-purple:hover .prompt-card-footer { color: var(--accent-purple); }
.prompt-card.c-cyan:hover .prompt-card-footer { color: var(--accent-cyan); }
.prompt-card.c-orange:hover .prompt-card-footer { color: var(--accent-orange); }
.prompt-card.c-green:hover .prompt-card-footer { color: var(--accent-green); }

/* Unified AI Input Glow Wrapper */
.chat-input-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.chat-input-wrapper:focus-within,
.chat-input-wrapper.pulse-glow {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15), inset 0 2px 4px rgba(0,0,0,0.1);
  background: rgba(255, 255, 255, 0.025);
}

@keyframes inputPulse {
  0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); }
  100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

.chat-input-wrapper.pulse-glow {
  animation: inputPulse 1.2s infinite;
}

.chat-input-wrapper textarea {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: none;
  padding: 0;
  width: 100%;
}

.chat-input-wrapper textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.input-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.input-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn.icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* =========================================================================
   VERSION 3.8 - FLOATING GLASSMORPHIC CUSTOM DATE RANGE POPOVER
   ========================================================================= */

.global-custom-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: rgba(13, 17, 39, 0.98);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 16px;
  display: none; /* Controlled by JS flex/none toggles */
  flex-direction: column;
  gap: 14px;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(6, 182, 212, 0.15);
  animation: popoverFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin: 0;
}

.popover-inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.popover-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.popover-input-group label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin: 0;
  padding: 0;
}

.popover-separator {
  color: var(--text-muted);
  font-size: 11px;
  padding-bottom: 10px;
}

.global-custom-date-popover .header-input-date {
  width: 100% !important;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .global-custom-date-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(6, 182, 212, 0.3);
    animation: popoverFadeInMobile 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  @keyframes popoverFadeInMobile {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
}

.selected-range-label {
  position: absolute;
  top: 100%;
  right: 12px;
  left: auto;
  transform: none;
  font-size: 8.5px;
  color: var(--accent-cyan);
  background: transparent;
  border: none;
  backdrop-filter: none;
  padding: 0;
  margin-top: 2px;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
  font-weight: 600;
  box-shadow: none;
  z-index: 10;
  transition: all 0.2s ease;
}

/* ================================================================= */
/* FUTURISTIC EMPLOYEE HUD DOSSIER SYSTEM */
/* ================================================================= */

.employee-dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  min-height: 600px;
  margin-top: 10px;
}

@media (max-width: 1024px) {
  .employee-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Scrollable cyber card list */
.cyber-list-scrollable {
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.2) rgba(255, 255, 255, 0.02);
}
.cyber-list-scrollable::-webkit-scrollbar {
  width: 4px;
}
.cyber-list-scrollable::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 4px;
}
.cyber-list-scrollable::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.2);
  border-radius: 4px;
}
.cyber-list-scrollable::-webkit-scrollbar-thumb:hover {
  background: var(--accent-emerald);
}

/* Roster Roster Card */
.roster-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  gap: 12px;
  flex-shrink: 0; /* CRITICAL FIX: prevents squashing / overlapping in flex flow */
  min-height: 58px; /* Extra height safety protection */
}
.roster-card:hover {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1), inset 0 0 10px rgba(16, 185, 129, 0.05);
  transform: translateY(-2px);
}
.roster-card.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2), inset 0 0 15px rgba(16, 185, 129, 0.1);
}
.roster-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: transparent;
  transition: all 0.2s ease;
}
.roster-card.active::before {
  background: var(--accent-emerald);
}
.roster-card.terminated {
  opacity: 0.6;
}
.roster-card.terminated:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
}
.roster-card.terminated.active {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-rose);
}
.roster-card.terminated.active::before {
  background: var(--accent-rose);
}

.roster-info {
  min-width: 0;
  flex: 1;
}
.roster-info h4 {
  margin: 0 0 4px 0;
  font-family: 'Outfit';
  font-size: 13.5px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.roster-info span {
  font-size: 10px;
  color: var(--text-muted);
  display: block; /* Force subtitle on its own line */
  margin-top: 3px; /* Vertical separation from name */
  line-height: 1.2;
}
.roster-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}
.roster-tag {
  font-family: 'Space Mono';
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
}
.roster-tag.head-office {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
}
.roster-tag.skt1a-shop {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
}
.roster-tag.skt1-b2b {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-orange);
}
.roster-tag.terminated {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-rose);
}

/* Cyber Dossier HUD Styles */
.hud-avatar-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.08);
}
.hud-avatar-initials {
  font-family: 'Outfit';
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  z-index: 2;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
.avatar-ring-inner {
  position: absolute;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border: 1px dashed var(--accent-emerald);
  border-radius: 50%;
  animation: spin 20s linear infinite;
  opacity: 0.6;
}
.avatar-ring-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid var(--accent-emerald);
  border-radius: 50%;
  animation: empAvatarPulse 2s infinite ease-out;
  opacity: 0;
}
@keyframes empAvatarPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0; }
}

.hud-tag {
  font-family: 'Space Mono';
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  letter-spacing: 0.5px;
}
.hud-status-badge {
  font-family: 'Outfit';
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}
.hud-status-badge.green-pulse {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
  animation: hudPulseGreen 2s infinite alternate;
}
.hud-status-badge.red-pulse {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-rose);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.1);
  animation: hudPulseRed 2s infinite alternate;
}

@keyframes hudPulseGreen {
  from { border-color: rgba(16, 185, 129, 0.3); box-shadow: 0 0 5px rgba(16, 185, 129, 0.1); }
  to { border-color: rgba(16, 185, 129, 0.6); box-shadow: 0 0 15px rgba(16, 185, 129, 0.35); }
}
@keyframes hudPulseRed {
  from { border-color: rgba(239, 68, 68, 0.3); box-shadow: 0 0 5px rgba(239, 68, 68, 0.1); }
  to { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 15px rgba(239, 68, 68, 0.35); }
}

/* Gradients for skill parameters */
.orange-gradient {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.cyan-gradient {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}
.purple-gradient {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.salary-min-card.highlight {
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.05), inset 0 0 8px rgba(16, 185, 129, 0.03);
}

.brand-watermark-dossier {
  top: 15%;
  right: -5%;
  width: 320px;
  height: 320px;
}

.suggest-tag {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.suggest-tag:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px);
}
.suggest-tag.active {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: var(--accent-emerald) !important;
  color: var(--accent-emerald) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ================================================================= */
/* PREMIUM ROSTER FILTERS & MOBILE SEGMENTED VIEWPORT STYLES */
/* ================================================================= */

.roster-filter-select {
  width: 100%;
  background: rgba(13, 17, 39, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-family: 'Outfit', sans-serif !important;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  height: auto !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 16px !important;
  padding-right: 28px !important;
}
.roster-filter-select:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
.roster-filter-select:focus {
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}

/* Mobile Segment Tabs for Employee Master */
.employee-mobile-tabs {
  display: none;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  gap: 6px;
  backdrop-filter: blur(10px);
}
.mobile-tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
}
.mobile-tab-btn:hover {
  color: #fff;
}
.mobile-tab-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
}

@media (max-width: 1024px) {
  .employee-mobile-tabs {
    display: flex;
  }
  
  /* When roster tab is active, hide dossier panel */
  .employee-dashboard-grid.show-roster .employee-dossier-panel {
    display: none !important;
  }
  .employee-dashboard-grid.show-roster .employee-roster-sidebar {
    display: flex !important;
    width: 100% !important;
    max-height: none !important;
  }
  
  /* When dossier tab is active, hide roster sidebar */
  .employee-dashboard-grid.show-dossier .employee-roster-sidebar {
    display: none !important;
  }
  .employee-dashboard-grid.show-dossier .employee-dossier-panel {
    display: flex !important;
    width: 100% !important;
  }
}

/* PDC Table compact alignment to fit all contents in one line */
#pdc-board-table th, 
#pdc-board-table td {
  white-space: nowrap !important;
  padding: 10px 14px !important;
  font-size: 12px !important;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pdc-board-table th {
  font-size: 10.5px !important;
  letter-spacing: 0.5px !important;
}

/* SaaS-Grade Login & Configuration Styles */
@keyframes login-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

#frm-login input:focus {
  border-color: rgba(168, 85, 247, 0.4) !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.15) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

#db-config-container input:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Premium interactive pointer cursors and row hovers */
tbody tr[data-vchcode] {
  cursor: pointer !important;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

tbody tr[data-vchcode]:hover {
  background: rgba(255, 255, 255, 0.035) !important;
}

.clickable-account,
.clickable-item {
  cursor: pointer !important;
  transition: all 0.15s ease;
}

.clickable-account:hover {
  color: #22d3ee !important; /* cyan glow hover */
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
}

.clickable-item:hover {
  color: #fbbf24 !important; /* amber glow hover */
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Due Bills & Overdue Badges (v5.9) */
.badge-blocked {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
  animation: pulse-rose 2s infinite;
}

@keyframes pulse-rose {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.badge-due {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.badge-clear {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

/* Ensure the due bills drawer renders below master modal z-index: 20000 but above transaction modal */
#due-bills-details-drawer {
  z-index: 15000 !important;
}

/* Bad Debts AI Dashboard styles (v7.2) */
.badge-suspicious {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
  animation: pulse-crimson 2s infinite;
}

@keyframes pulse-crimson {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.badge-healthy {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.badge-blocked-custom {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* Slide-in animation for drawer */
@keyframes drawer-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.ai-report-markdown h3 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  padding-left: 8px;
}

.ai-report-markdown h4 {
  font-size: 14px;
  font-weight: 600;
  margin-top: 15px;
  margin-bottom: 8px;
  color: #fff;
}

.ai-report-markdown p, .ai-report-markdown ul {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
}

.ai-report-markdown ul {
  padding-left: 20px;
}

.ai-report-markdown li {
  margin-bottom: 6px;
}

.ai-report-markdown strong {
  color: #fff;
  font-weight: 600;
}

/* Bad Debts AI Table Compact Fit Overrides (v7.6) */
#bad-debts-table {
  table-layout: fixed;
  width: 100%;
}
#bad-debts-table th, #bad-debts-table td {
  padding: 6px 6px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
#bad-debts-table th:nth-child(1), #bad-debts-table td:nth-child(1) { width: 35px; text-align: center; } /* Checkbox */
#bad-debts-table th:nth-child(2), #bad-debts-table td:nth-child(2) { width: 16%; min-width: 120px; } /* Customer Name */
#bad-debts-table th:nth-child(3), #bad-debts-table td:nth-child(3) { width: 9%; min-width: 80px; } /* Group */
#bad-debts-table th:nth-child(4), #bad-debts-table td:nth-child(4) { width: 8%; text-align: center; } /* Credit Days */
#bad-debts-table th:nth-child(5), #bad-debts-table td:nth-child(5) { width: 10%; text-align: center; } /* Credit Days - AI */
#bad-debts-table th:nth-child(6), #bad-debts-table td:nth-child(6) { width: 10%; text-align: right; } /* Credit Limit */
#bad-debts-table th:nth-child(7), #bad-debts-table td:nth-child(7) { width: 12%; text-align: right; } /* Credit Limit - AI */
#bad-debts-table th:nth-child(8), #bad-debts-table td:nth-child(8) { width: 12%; text-align: right; } /* Pending Balance */
#bad-debts-table th:nth-child(9), #bad-debts-table td:nth-child(9) { width: 12%; text-align: right; } /* Total Overdue */
#bad-debts-table th:nth-child(10), #bad-debts-table td:nth-child(10) { width: 9%; text-align: center; } /* Risk Classification */
#bad-debts-table th:nth-child(11), #bad-debts-table td:nth-child(11) { width: 8%; text-align: center; padding-right: 10px !important; } /* AI Audit */

#bad-debts-table td .clickable-account {
  font-size: 11px !important;
}
#bad-debts-table td span {
  font-size: 11px !important;
}
#bad-debts-table td button {
  padding: 3px 6px !important;
  font-size: 10px !important;
}


/* Executive Stats Deck styling for 13 compact metrics */
.executive-stats-deck {
  display: flex;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  padding: 16px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.executive-stats-deck::-webkit-scrollbar {
  height: 4px;
}
.executive-stats-deck::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.executive-stats-deck::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.stat-card {
  flex: 0 0 240px; /* Fixed width for standard item blocks inside horizontal scrolling bar */
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.stat-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  font-family: 'Outfit', sans-serif;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.stat-meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Color theme mappings for stat deck icons */
.cyan-glow .stat-icon { background: var(--grad-cyan); }
.purple-glow .stat-icon { background: var(--grad-primary); }
.green-glow .stat-icon { background: var(--grad-green); }
.orange-glow .stat-icon { background: var(--grad-orange); }
.rose-glow .stat-icon { background: var(--grad-rose); }
.red-glow .stat-icon { background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%); }



