/* ISPS Dashboard - Modern Stylesheet */

/* ==================== ROOT THEME VARIABLES ==================== */
:root {
  /* Common variables */
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --sidebar-width: 280px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Theme 1: Slate Light (Matches the WhatsApp screenshot) */
body.theme-slate-light {
  --bg-app: #f4f6fa;
  --bg-sidebar: #1e293b;
  --bg-sidebar-hover: #334155;
  --bg-sidebar-active: #2563eb;
  --text-sidebar: #e2e8f0;
  --text-sidebar-muted: #94a3b8;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-table-header: #f8fafc;
  --border-color: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-color: #2563eb;
  --accent-light: #eff6ff;
  
  --color-green: #10b981;
  --color-green-light: #ecfdf5;
  --color-orange: #f59e0b;
  --color-orange-light: #fffbeb;
  --color-red: #ef4444;
  --color-red-light: #fef2f2;
  --color-blue: #3b82f6;
  --color-blue-light: #eff6ff;
  --color-purple: #8b5cf6;
  --color-purple-light: #f5f3ff;
  
  --shadow-card: var(--shadow-md);
}

/* Theme 2: Deep Obsidian (Full Dark Mode) */
body.theme-obsidian-dark {
  --bg-app: #090d16;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #3b82f6;
  --text-sidebar: #f1f5f9;
  --text-sidebar-muted: #64748b;
  --bg-card: #131c31;
  --bg-input: #1e293b;
  --bg-table-header: #1e2942;
  --border-color: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-color: #3b82f6;
  --accent-light: rgba(59, 130, 246, 0.15);
  
  --color-green: #10b981;
  --color-green-light: rgba(16, 185, 129, 0.15);
  --color-orange: #f59e0b;
  --color-orange-light: rgba(245, 158, 11, 0.15);
  --color-red: #ef4444;
  --color-red-light: rgba(239, 68, 68, 0.15);
  --color-blue: #3b82f6;
  --color-blue-light: rgba(59, 130, 246, 0.15);
  --color-purple: #a78bfa;
  --color-purple-light: rgba(167, 139, 250, 0.15);
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Theme 3: Glassmorphism Modern */
body.theme-glass-modern {
  background: radial-gradient(circle at 10% 20%, rgba(98, 114, 246, 0.2) 0%, rgba(204, 188, 251, 0.1) 90.2%), #f1f3f9;
  --bg-app: transparent;
  --bg-sidebar: rgba(15, 23, 42, 0.85);
  --bg-sidebar-hover: rgba(51, 65, 85, 0.7);
  --bg-sidebar-active: #6366f1;
  --text-sidebar: #f8fafc;
  --text-sidebar-muted: #94a3b8;
  
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-input: rgba(255, 255, 255, 0.8);
  --bg-table-header: rgba(241, 245, 249, 0.5);
  --border-color: rgba(255, 255, 255, 0.4);
  
  --text-primary: #1e1b4b;
  --text-secondary: #4338ca;
  --text-muted: #818cf8;
  
  --accent-color: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.12);
  
  --color-green: #059669;
  --color-green-light: rgba(16, 185, 129, 0.12);
  --color-orange: #d97706;
  --color-orange-light: rgba(245, 158, 11, 0.12);
  --color-red: #dc2626;
  --color-red-light: rgba(239, 68, 68, 0.12);
  --color-blue: #2563eb;
  --color-blue-light: rgba(59, 130, 246, 0.12);
  --color-purple: #7c3aed;
  --color-purple-light: rgba(139, 92, 246, 0.12);
  
  --shadow-card: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ==================== CORE RESET & GENERAL ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Layout Wrapper */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==================== SIDEBAR STYLES ==================== */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transition: background-color var(--transition-normal), width var(--transition-normal);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.logo-icon {
  background-color: var(--bg-sidebar-active);
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--text-sidebar-muted);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 180px;
}

.sidebar-nav {
  flex-grow: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-sidebar-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  user-select: none;
}

.nav-item svg {
  opacity: 0.75;
  transition: transform var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.nav-item:hover svg {
  transform: translateX(2px);
  opacity: 1;
}

.nav-item.active {
  background-color: var(--bg-sidebar-active);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.env-label {
  font-size: 0.65rem;
  color: var(--text-sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.env-value {
  font-size: 0.78rem;
  color: #ffffff;
  font-weight: 500;
  margin-top: 2px;
}

/* ==================== MAIN CONTENT CONTAINER ==================== */
.app-main {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: 24px 32px 48px;
  min-width: 0; /* Prevents flex children from breaking parent boundaries */
}

/* ==================== TOP HEADER ==================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  z-index: 100;
}

.header-left h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.header-left p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Filters & Select Controls */
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.control-select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.control-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.control-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  outline: none;
  width: 100%;
  transition: all var(--transition-fast);
}

.control-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Header Actions */
.header-action {
  position: relative;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.header-action:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.header-action .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--color-red);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid var(--bg-app);
}

/* Notifications Dropdown */
.notification-bell {
  position: relative;
}

.notification-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  width: 320px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 500;
  overflow: hidden;
}

.notification-dropdown.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}

.dropdown-header {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-table-header);
}

.dropdown-body {
  max-height: 280px;
  overflow-y: auto;
}

.noti-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  line-height: 1.4;
  display: flex;
  gap: 10px;
  transition: background-color var(--transition-fast);
}

.noti-item:last-child {
  border-bottom: none;
}

.noti-item:hover {
  background-color: var(--bg-table-header);
}

.noti-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.noti-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.noti-title {
  font-weight: 600;
  color: var(--text-primary);
}

.noti-desc {
  color: var(--text-secondary);
}

/* Profile Widget */
.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.2);
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ==================== CONTENT BODY VIEWS ==================== */
.content-body {
  position: relative;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

/* ==================== KPI CARDS GRID ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 4px;
}

#kpi-service-level::before { background-color: var(--color-blue); }
#kpi-stockout-rate::before { background-color: var(--color-orange); }
#kpi-forecast-accuracy::before { background-color: var(--color-green); }
#kpi-inventory-value::before { background-color: var(--color-purple); }

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-blue { background-color: var(--color-blue-light); color: var(--color-blue); }
.icon-orange { background-color: var(--color-orange-light); color: var(--color-orange); }
.icon-green { background-color: var(--color-green-light); color: var(--color-green); }
.icon-yellow { background-color: var(--color-purple-light); color: var(--color-purple); }

.kpi-details {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2px 0;
  color: var(--text-primary);
}

.kpi-trend {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--color-green); }
.trend-down { color: var(--color-red); }

/* ==================== CHARTS & WIDGETS GRID ==================== */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 1200px) {
  .dashboard-charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-charts-grid .text-card {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-charts-grid .text-card {
    grid-column: span 1;
  }
}

.chart-container-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition-fast);
}

.chart-container-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  flex-grow: 1;
}

.chart-wrapper.tall {
  height: 320px;
}

/* ==================== TABLES ==================== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table-wrapper.scrollable-y {
  max-height: 220px;
  overflow-y: auto;
}

.table-wrapper.medium-height {
  max-height: 480px;
  overflow-y: auto;
}

.table-wrapper.large-height {
  max-height: 600px;
  overflow-y: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.dashboard-table.font-sm {
  font-size: 0.8rem;
}

.dashboard-table th, .dashboard-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-table th {
  background-color: var(--bg-table-header);
  color: var(--text-secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dashboard-table tbody tr {
  transition: background-color var(--transition-fast);
}

.dashboard-table tbody tr:hover {
  background-color: var(--bg-table-header);
}

.dashboard-table td.num, .dashboard-table th.num {
  text-align: right;
}

/* Badge Status Styles */
.badge-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.status-ok { background-color: var(--color-green-light); color: var(--color-green); }
.status-reorder { background-color: var(--color-orange-light); color: var(--color-orange); }
.status-risk { background-color: var(--color-red-light); color: var(--color-red); }

/* Sortable Table Header */
.sortable-table th {
  cursor: pointer;
  user-select: none;
}
.sortable-table th:hover {
  background-color: var(--border-color);
}

/* ==================== ALERTS WIDGETS ==================== */
.alerts-section {
  margin-top: 16px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.alert-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow-card);
  border-left-width: 4px;
  transition: transform var(--transition-fast);
}

.alert-card:hover {
  transform: translateY(-1px);
}

.alert-card.alert-red { border-left-color: var(--color-red); }
.alert-card.alert-orange { border-left-color: var(--color-orange); }
.alert-card.alert-blue { border-left-color: var(--color-blue); }
.alert-card.alert-purple { border-left-color: var(--color-purple); }

.alert-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-red .alert-card-icon { background-color: var(--color-red-light); color: var(--color-red); }
.alert-orange .alert-card-icon { background-color: var(--color-orange-light); color: var(--color-orange); }
.alert-blue .alert-card-icon { background-color: var(--color-blue-light); color: var(--color-blue); }
.alert-purple .alert-card-icon { background-color: var(--color-purple-light); color: var(--color-purple); }

.alert-card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.alert-card-title {
  font-weight: 700;
  color: var(--text-primary);
}

.alert-card-desc {
  color: var(--text-secondary);
  line-height: 1.4;
}

.alert-card-action {
  font-size: 0.72rem;
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  margin-top: 4px;
  align-self: flex-start;
}
.alert-card-action:hover {
  text-decoration: underline;
}

/* ==================== DETAIL SPLIT GRID & FILTERS ==================== */
.filter-panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.filter-row {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-row.flex-between {
  justify-content: space-between;
  align-items: center;
}

.filter-row-left {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-field.search-box {
  min-width: 260px;
}

.filter-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.detail-split-grid.extra-large {
  grid-template-columns: 3fr 1fr;
}

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

.chart-container-card.large {
  grid-column: span 1;
}

.chart-container-card.medium {
  grid-column: span 1;
}

.chart-container-card.extra-large {
  grid-column: span 1;
}

.chart-container-card.full-width {
  grid-column: span 3;
}

.list-container {
  height: 320px;
}

/* ==================== PARAMETERS PANEL (SUPPLY PLANNING) ==================== */
.parameters-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.parameter-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast);
}

.parameter-card:hover {
  border-color: var(--accent-color);
}

.parameter-card h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.parameter-card .formula {
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-color);
  background-color: var(--accent-light);
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  display: inline-block;
  margin-bottom: 10px;
}

.parameter-card .description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==================== MPS OPTIMIZER GANTT CHART ==================== */
.gantt-chart-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 0;
  width: 100%;
}

.gantt-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 16px;
}

.gantt-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.gantt-timeline-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gantt-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--bg-table-header);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  height: 36px;
  position: relative;
  overflow: hidden;
}

.gantt-grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  pointer-events: none;
}

.gantt-grid-lines .grid-line {
  border-right: 1px dashed var(--border-color);
}
.gantt-grid-lines .grid-line:last-child {
  border-right: none;
}

.gantt-bar {
  grid-column: span 1;
  border-radius: 4px;
  height: 24px;
  margin: 5px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  z-index: 2;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.gantt-bar:hover {
  transform: scale(1.02);
}

.bar-blue { background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%); }
.bar-purple { background: linear-gradient(90deg, #a78bfa 0%, #8b5cf6 100%); }
.bar-orange { background: linear-gradient(90deg, #fb923c 0%, #ea580c 100%); }
.bar-gray { background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%); opacity: 0.5; }

.gantt-weeks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Capacity Gauges */
.gauges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

@media (max-width: 480px) {
  .gauges-grid {
    grid-template-columns: 1fr;
  }
}

.gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gauge-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
}

.gauge-canvas {
  width: 100px;
  height: 100px;
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

/* ==================== S&OP GOVERNANCE MAP & MINI KPIS ==================== */
.kpi-grid-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .kpi-grid-mini {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-mini-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.kpi-mini-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-mini-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.map-view-wrapper {
  width: 100%;
  height: 320px;
  position: relative;
  background-color: var(--bg-table-header);
  border-radius: var(--border-radius-sm);
  border: 1px dashed var(--border-color);
  overflow: hidden;
}

.indonesia-svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 10px;
  transition: transform var(--transition-normal);
}

.map-land {
  fill: #cbd5e1;
  stroke: var(--bg-card);
  stroke-width: 0.5;
  transition: fill var(--transition-normal);
}

body.theme-obsidian-dark .map-land {
  fill: #1e293b;
  stroke: #090d16;
}

body.theme-glass-modern .map-land {
  fill: rgba(199, 210, 254, 0.4);
  stroke: rgba(255, 255, 255, 0.5);
}

.map-marker {
  cursor: pointer;
}

.map-marker-pin {
  stroke: #ffffff;
  stroke-width: 1;
  transition: r var(--transition-fast), filter var(--transition-fast);
}

.map-marker:hover .map-marker-pin {
  r: 8.5px;
  filter: brightness(1.2);
}

.map-tooltip {
  position: absolute;
  background-color: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  font-size: 0.72rem;
  pointer-events: none;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.map-tooltip h4 {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2px;
}

/* Early Warning Alert Section */
.sop-early-warning {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-top: 24px;
}

.warning-alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.warning-alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  border-left: 3px solid;
}

.warning-alert-item.warn-high {
  background-color: var(--color-red-light);
  color: var(--color-red);
  border-left-color: var(--color-red);
}
.warning-alert-item.warn-medium {
  background-color: var(--color-orange-light);
  color: var(--color-orange);
  border-left-color: var(--color-orange);
}

.warning-text {
  font-weight: 500;
}

.warning-badge {
  font-weight: 700;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.warn-high .warning-badge { background-color: var(--color-red); color: #ffffff; }
.warn-medium .warning-badge { background-color: var(--color-orange); color: #ffffff; }

/* ==================== MASTER DATA STYLES ==================== */
.master-summary-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.master-summary-label span {
  font-weight: 700;
  color: var(--accent-color);
}

/* ==================== REPORT STYLES ==================== */
.report-generator-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.report-intro-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.report-intro-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.report-intro-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.report-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.report-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.report-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
}

.report-card h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.report-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex-grow: 1;
}

.btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ==================== SETTINGS STYLES ==================== */
.setting-panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.setting-panel-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.setting-panel-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 24px;
}

.settings-theme-selector h4, .settings-info-box h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.theme-option {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--bg-card);
}

.theme-option:hover {
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.theme-option.active {
  border-color: var(--accent-color);
  background-color: var(--accent-light);
  box-shadow: var(--shadow-sm);
}

.theme-preview {
  height: 24px;
  border-radius: 4px;
  margin-bottom: 12px;
  border: 1px solid rgba(0,0,0,0.05);
}

.color-slate { background: linear-gradient(90deg, #1e293b 35%, #ffffff 35%); }
.color-obsidian { background: linear-gradient(90deg, #0f172a 35%, #131c31 35%); }
.color-glass { background: linear-gradient(90deg, #0f172a 35%, #e0e7ff 35%); }

.theme-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.theme-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.settings-info-box {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

.info-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.info-table th, .info-table td {
  padding: 8px 0;
  text-align: left;
}

.info-table th {
  color: var(--text-secondary);
  font-weight: 600;
  width: 180px;
}

.info-table td {
  color: var(--text-primary);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== RESPONSIVE LAYOUTS & MEDIA QUERIES ==================== */

/* 1. Tablets and Small Laptops (max-width: 992px) */
@media (max-width: 992px) {
  .app-sidebar {
    width: 70px;
  }
  .app-sidebar .logo-text,
  .app-sidebar .nav-item span,
  .app-sidebar .sidebar-footer {
    display: none;
  }
  .app-sidebar .sidebar-brand {
    padding: 16px 14px;
    justify-content: center;
  }
  .app-sidebar .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .app-main {
    margin-left: 70px;
    padding: 20px 24px;
  }
  .detail-split-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 2. Mobile Landscape & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 16px;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
  }
  .kpi-grid-mini {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .gauges-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 3. Small Mobile Devices (max-width: 600px) */
@media (max-width: 600px) {
  .app-container {
    flex-direction: column;
  }
  
  /* Convert Sidebar to Bottom Navigation Bar */
  .app-sidebar {
    width: 100%;
    height: 60px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
  }
  
  .sidebar-brand, 
  .sidebar-footer {
    display: none !important;
  }
  
  .sidebar-nav {
    padding: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }
  
  .sidebar-nav ul {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    gap: 0;
  }
  
  .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px 2px;
    font-size: 0.62rem;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    border-radius: 0;
    height: 100%;
    min-width: 60px;
  }
  
  .nav-item svg {
    width: 18px;
    height: 18px;
  }
  
  .nav-item:hover svg {
    transform: none;
  }
  
  /* Reset Main Container Margins */
  .app-main {
    margin-left: 0 !important;
    padding: 16px 16px 88px !important; /* Bottom padding so bottom nav doesn't overlap contents */
  }
  
  /* Adjust Gantt Layout for Mobile */
  .gantt-row {
    grid-template-columns: 85px 1fr !important;
    gap: 8px !important;
  }
  
  .gantt-label {
    font-size: 0.7rem;
    word-break: break-word;
  }
  
  .gantt-bar {
    font-size: 0.55rem;
    padding: 2px 4px;
    margin: 6px 2px;
  }
  
  .gantt-weeks div {
    font-size: 0.65rem;
  }
  
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .filter-field {
    width: 100%;
  }
  
  .filter-field.search-box {
    min-width: 100%;
  }
  
  .chart-container-card {
    padding: 16px;
  }
  
  .map-view-wrapper {
    height: 240px;
  }
}

/* 4. Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .kpi-grid-mini {
    grid-template-columns: 1fr !important;
  }
  .gauges-grid {
    grid-template-columns: 1fr !important;
  }
  .header-left h1 {
    font-size: 1.5rem;
  }
  .profile-info {
    display: none; /* Hide name/role, show avatar only */
  }
}

/* ==================== AI CHATBOT WIDGET ==================== */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-body);
}

.chatbot-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-blue) 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.chatbot-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6);
}

.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--color-red);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1.5px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.chatbot-drawer {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  height: 520px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-drawer.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* Glassmorphism theme override for chatbot drawer */
body.theme-glass-modern .chatbot-drawer {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

body.theme-obsidian-dark .chatbot-drawer {
  background-color: #0b1329;
  border-color: #1e293b;
}

.chatbot-header {
  padding: 16px 20px;
  background-color: var(--bg-table-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.theme-obsidian-dark .chatbot-header {
  background-color: rgba(30, 41, 59, 0.5);
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-purple) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.chatbot-status-container {
  display: flex;
  flex-direction: column;
}

.chatbot-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

body.theme-glass-modern .chatbot-title {
  color: #ffffff;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background-color: var(--color-green);
  box-shadow: 0 0 6px var(--color-green);
  display: inline-block;
}

.status-text {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

body.theme-glass-modern .status-text {
  color: rgba(255, 255, 255, 0.7);
}

.chatbot-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.chatbot-close-btn:hover {
  color: var(--color-red);
}

.chatbot-body {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-app);
}

body.theme-obsidian-dark .chatbot-body {
  background-color: #090d16;
}

body.theme-glass-modern .chatbot-body {
  background-color: rgba(0, 0, 0, 0.2);
}

/* Custom Scrollbar for Chat */
.chatbot-body::-webkit-scrollbar {
  width: 6px;
}
.chatbot-body::-webkit-scrollbar-track {
  background: transparent;
}
.chatbot-body::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 10px;
}

.chat-message {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: var(--border-radius-md);
  font-size: 0.82rem;
  line-height: 1.45;
  word-wrap: break-word;
  animation: messageSlideIn 0.3s ease-out;
}

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

.chat-message.assistant {
  align-self: flex-start;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--color-blue);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

body.theme-obsidian-dark .chat-message.assistant {
  background-color: #111b30;
}

body.theme-glass-modern .chat-message.assistant {
  background-color: rgba(30, 41, 59, 0.4);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
}

.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-blue) 0%, #2563eb 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.chat-message p {
  margin: 0 0 8px 0;
}
.chat-message p:last-child {
  margin-bottom: 0;
}
.chat-message ul, .chat-message ol {
  margin: 6px 0 0 0;
  padding-left: 20px;
}
.chat-message li {
  margin-bottom: 4px;
}

.chatbot-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  animation: messageSlideIn 0.4s ease-out;
}

.quick-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  text-align: left;
}

.quick-chip:hover {
  background-color: var(--color-blue-light);
  border-color: var(--color-blue);
  color: var(--color-blue);
  transform: translateY(-1px);
}

body.theme-obsidian-dark .quick-chip:hover {
  background-color: rgba(59, 130, 246, 0.15);
}

body.theme-glass-modern .quick-chip {
  background-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}
body.theme-glass-modern .quick-chip:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.chatbot-footer {
  padding: 12px 16px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

body.theme-obsidian-dark .chatbot-footer {
  background-color: #0b1329;
}

body.theme-glass-modern .chatbot-footer {
  background-color: transparent;
}

.chatbot-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-table-header);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 4px 8px 4px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chatbot-input-form:focus-within {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px var(--color-blue-light);
}

body.theme-obsidian-dark .chatbot-input-form {
  background-color: rgba(30, 41, 59, 0.5);
}

body.theme-glass-modern .chatbot-input-form {
  background-color: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.chatbot-input-form input {
  flex-grow: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 0.82rem;
  color: var(--text-primary);
  padding: 8px 0;
}

body.theme-glass-modern .chatbot-input-form input {
  color: #ffffff;
}
body.theme-glass-modern .chatbot-input-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chatbot-send-btn {
  background: none;
  border: none;
  color: var(--color-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.chatbot-send-btn:hover {
  background-color: var(--color-blue-light);
  transform: scale(1.05);
}

body.theme-obsidian-dark .chatbot-send-btn:hover {
  background-color: rgba(59, 130, 246, 0.15);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@media (max-width: 480px) {
  .chatbot-drawer {
    width: calc(100vw - 32px);
    right: -10px;
    height: 450px;
  }
}

/* Chatbot Table and Blockquote Styles */
.chatbot-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.chatbot-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: left;
  background-color: var(--bg-card);
}

.chatbot-table-wrapper th, 
.chatbot-table-wrapper td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  color: var(--text-primary);
}

.chatbot-table-wrapper th {
  background-color: var(--bg-table-header);
  font-weight: 600;
  color: var(--text-secondary);
}

.chatbot-table-wrapper th:last-child, 
.chatbot-table-wrapper td:last-child {
  border-right: none;
}

.chatbot-table-wrapper tr:last-child td {
  border-bottom: none;
}

.chat-message.assistant blockquote {
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--color-blue);
  color: var(--text-secondary);
  background-color: var(--bg-table-header);
  font-style: italic;
  font-size: 0.78rem;
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

/* Expanded state for chatbot drawer */
.chatbot-expand-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.chatbot-expand-btn:hover {
  color: var(--color-blue);
  transform: scale(1.1);
}

.chatbot-drawer.expanded {
  position: fixed !important;
  top: 24px !important;
  bottom: 24px !important;
  left: 24px !important;
  right: 24px !important;
  width: auto !important;
  height: auto !important;
  border-radius: var(--border-radius-lg) !important;
  z-index: 10000 !important;
}

/* On mobile/tablets, make it cover the entire screen */
@media (max-width: 768px) {
  .chatbot-drawer.expanded {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    z-index: 10000 !important;
  }
}




