@import url('generated-inline.css');

:root {
  --charcoal-900: #1a1d24;
  --charcoal-800: #23272f;
  --charcoal-700: #2d323c;
  --charcoal-600: #3a4049;
  
  --white: #ffffff;
  --white-90: rgba(255, 255, 255, 0.9);
  --white-70: rgba(255, 255, 255, 0.7);
  --white-50: rgba(255, 255, 255, 0.5);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-05: rgba(255, 255, 255, 0.05);
  
  --trust-blue: #0066ff;
  --trust-blue-hover: #0052cc;
  --trust-blue-light: #3385ff;
  --trust-blue-pale: rgba(0, 102, 255, 0.15);
  
  --controlled-red: #dc2626;
  --controlled-red-light: #ef4444;
  --controlled-red-pale: rgba(220, 38, 38, 0.15);
  
  --success-green: #16a34a;
  --success-green-pale: rgba(22, 163, 74, 0.15);
  
  --warning-orange: #ea580c;
  --warning-orange-pale: rgba(234, 88, 12, 0.15);
  
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
}

body {
  background: var(--charcoal-900);
  color: var(--white);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html { 
  overflow-x: hidden;
  /* scrollbar-gutter: stable;  -- removed for broader Safari compatibility */
}

.app {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 240px;
  background: var(--charcoal-800);
  padding: 28px 18px;
  border-right: 1px solid var(--white-10);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.3s ease;
  z-index: 100;
  padding-bottom: 40px;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--white-20);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--white-30);
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 40px;
  color: var(--trust-blue-light);
  letter-spacing: -0.02em;
}

.sidebar.collapsed .sidebar-title {
  font-size: 0.7rem;
  line-height: 1.2;
  margin-bottom: 20px;
}

.sidebar-nav ul {
  list-style: none;
  margin-bottom: 24px;
}

.sidebar-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white-50);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 6px 12px 10px;
}

.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-badge { 
  display: none; 
}

.sidebar-nav li {
  margin-bottom: 6px;
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-nav li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--trust-blue);
  transform: scaleY(0);
  transition: transform 0.2s ease;
  border-radius: 0 3px 3px 0;
}

.sidebar-nav li.active::before,
.sidebar-nav li:hover::before {
  transform: scaleY(1);
}

.sidebar-nav li.active {
  background: var(--trust-blue-pale);
}

.sidebar-nav li:hover {
  background: var(--charcoal-700);
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--white-70);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.sidebar-nav li.active a {
  color: var(--trust-blue-light);
  font-weight: 600;
}

.sidebar-nav li:hover a {
  color: var(--white);
}

.sidebar-nav .nav-icon {
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}

.sidebar-nav .nav-text {
  flex: 1;
}

.sidebar.collapsed .nav-text {
  display: none;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--white-05);
  color: var(--white-70);
  border: 1px solid var(--white-10);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-nav li a::after {
  content: attr(data-label);
  position: absolute;
  left: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--charcoal-700);
  color: var(--white);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  padding: 6px 10px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 1001;
}

.sidebar.collapsed .sidebar-nav li a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(2px);
}

/* ================= MAIN CONTENT ================= */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 0 24px 24px 24px;
  width: calc(100% - 240px);
  background: var(--charcoal-900);
  overflow-x: hidden;
  overflow-y: auto;
  /* scrollbar-width: thin; */
  /* scrollbar-color: var(--charcoal-700) var(--charcoal-900); */
  transition: margin-left 0.3s ease, width 0.3s ease;
}

.main-content::-webkit-scrollbar {
  width: 8px;
}

.main-content::-webkit-scrollbar-track {
  background: var(--charcoal-900);
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--charcoal-700);
  border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--charcoal-600);
}

.sidebar.collapsed ~ .main-content {
  margin-left: 80px;
  width: calc(100% - 80px);
}

/* ================= PAGE SECTIONS ================= */
.page {
  display: none;
}

.page[style*="display: block"],
.page:not([style*="display: none"]) {
  display: flex;
  flex-direction: column;
}

/* ================= DASHBOARD HEADER ================= */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 20px 24px;
}

.dashboard-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--white-50);
  margin-top: 4px;
}

.header-icons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.125rem;
  background: var(--charcoal-700);
  color: var(--white-70);
  border: 1px solid var(--white-10);
  transition: all 0.2s ease;
  position: relative;
}

.header-icon:hover {
  background: var(--charcoal-600);
  color: var(--white);
  border-color: var(--white-20);
  transform: translateY(-1px);
}

.header-icon.active {
  background: var(--trust-blue);
  color: var(--white);
  border-color: var(--trust-blue);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--controlled-red);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--charcoal-900);
}

/* ================= SEARCH OVERLAY ================= */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 29, 36, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.active {
  display: flex;
}

.search-box {
  width: 600px;
  max-width: 90%;
  background: var(--charcoal-800);
  border: 1px solid var(--white-20);
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.search-input {
  width: 100%;
  padding: 16px;
  background: var(--charcoal-700);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 400;
}

.search-input:focus {
  outline: none;
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px var(--trust-blue-pale);
}

.search-close {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 44px;
  height: 44px;
  background: var(--charcoal-700);
  border: 1px solid var(--white-10);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--white-70);
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.search-close:hover {
  background: var(--charcoal-600);
  color: var(--white);
}

/* ================= NOTIFICATION PANEL ================= */
.notification-panel {
  position: fixed;
  top: 80px;
  right: 48px;
  width: 380px;
  max-height: 500px;
  background: var(--charcoal-800);
  border: 1px solid var(--white-20);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  flex-direction: column;
  padding: 12px;
}

.notification-panel.active {
  display: flex;
}

.notification-header {
  padding: 20px;
  border-bottom: 1px solid var(--white-10);
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
}

.notification-list {
  overflow-y: auto;
  max-height: 400px;
}

.notification-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--white-05);
  cursor: pointer;
  transition: background 0.15s;
}

.notification-item:hover {
  background: var(--charcoal-600);
  border-left: 3px solid var(--trust-blue);
  padding-left: 17px;
  color: var(--white);
}

.notification-item.unread {
  background: var(--white-05);
}

.notification-title {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--white-90);
  margin-bottom: 4px;
}

.notification-text {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--white-50);
  line-height: 1.4;
}

.notification-time {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--white-50);
  margin-top: 6px;
}

.notification-severity {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 8px;
}

.notification-severity.critical {
  background: var(--controlled-red-pale);
  color: var(--controlled-red-light);
}

.notification-severity.warning {
  background: var(--warning-orange-pale);
  color: var(--warning-orange);
}

/* ================= PROFILE PANEL ================= */
.profile-panel {
  position: fixed;
  top: 80px;
  right: 48px;
  width: 360px;
  background: var(--charcoal-800);
  border: 1px solid var(--white-20);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  flex-direction: column;
  max-height: 600px;
  overflow-y: auto;
  padding: 12px;
}

.profile-panel.active {
  display: flex;
}

.profile-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--white-10);
}

.profile-panel-email {
  font-size: 0.95rem;
  color: var(--white-90);
  font-weight: 500;
}

.profile-panel-close {
  background: none;
  border: none;
  color: var(--white-70);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.profile-panel-close:hover {
  color: var(--white);
}

.profile-card {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--white-10);
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--trust-blue), var(--trust-blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 auto 16px;
}

.profile-greeting {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 16px;
}

.profile-manage-btn {
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--trust-blue-pale);
  border-radius: 8px;
  color: var(--trust-blue-light);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
}

.profile-manage-btn:hover {
  background: var(--trust-blue-pale);
}

.profile-actions {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--white-10);
}

.profile-action-btn {
  flex: 1;
  padding: 12px 16px;
  background: var(--white-05);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  color: var(--white-70);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
}

.profile-action-btn:hover {
  background: var(--white-10);
  color: var(--white);
}

.profile-section-title {
  padding: 16px 20px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white-50);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-menu-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  color: var(--white-70);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}

.profile-menu-item:hover {
  background: var(--white-05);
  color: var(--white);
}

.profile-menu-item i {
  margin-right: 12px;
  font-size: 1rem;
  width: 20px;
}

.profile-menu-label {
  flex: 1;
}

/* ================= METRICS GRID ================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .metrics-grid { grid-template-columns: 1fr; }
}

.metric-card {
  background: var(--charcoal-800);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--white-10);
  border-top: 3px solid transparent;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.metric-card:hover {
  border-color: var(--white-20);
  border-top-color: currentColor;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.metric-card.blue { 
  border-top-color: var(--trust-blue); 
}

.metric-card.red { 
  border-top-color: var(--controlled-red); 
}

.metric-card.green { 
  border-top-color: var(--success-green); 
}

.metric-card.orange { 
  border-top-color: var(--warning-orange); 
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.metric-card.blue .metric-icon { 
  background: var(--trust-blue-pale);
  color: var(--trust-blue-light); 
}

.metric-card.red .metric-icon { 
  background: var(--controlled-red-pale);
  color: var(--controlled-red-light); 
}

.metric-card.green .metric-icon { 
  background: var(--success-green-pale);
  color: var(--success-green); 
}

.metric-card.orange .metric-icon { 
  background: var(--warning-orange-pale);
  color: var(--warning-orange); 
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--white-70);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.metric-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.metric-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-trend {
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-card.blue .metric-trend { 
  color: var(--trust-blue-light); 
}

.metric-card.red .metric-trend { 
  color: var(--controlled-red-light); 
}

.metric-card.green .metric-trend { 
  color: var(--success-green); 
}

.metric-card.orange .metric-trend { 
  color: var(--warning-orange); 
}

.metric-trend i {
  font-size: 0.75rem;
}

.metric-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--warning-orange);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--warning-orange-pale);
  border-radius: 6px;
}

.metric-update {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--white-50);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.metric-value.updating {
  animation: pulse 0.6s ease-in-out;
}

/* ================= CHARTS GRID ================= */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 40px;
}

.chart-card {
  background: var(--charcoal-800);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--white-10);
  position: relative;
  transition: border-color 0.2s;
  overflow: hidden;
  box-sizing: border-box;
}

.chart-card:hover {
  border-color: var(--white-20);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
  letter-spacing: -0.02em;
}

.chart-subtitle {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--white-50);
  margin-top: 4px;
}

.chart-menu {
  color: var(--white-50);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.chart-menu:hover {
  background: var(--charcoal-700);
  color: var(--white);
}

.chart-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-btn {
  padding: 8px 14px;
  background: var(--charcoal-700);
  border: 1px solid var(--white-10);
  border-radius: 6px;
  color: var(--white-70);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn:hover {
  border-color: var(--white-20);
  color: var(--white);
  background: var(--charcoal-600);
}

.filter-btn.active {
  background: var(--trust-blue);
  border-color: var(--trust-blue);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.chart-container {
  height: 350px;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ================= PIE CHARTS GRID ================= */
.pie-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}

@media (max-width: 1100px) {
  .pie-charts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .pie-charts-grid { grid-template-columns: 1fr; }
}

.pie-chart-card {
  background: var(--charcoal-800);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--white-10);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  transition: all 0.2s ease;
}

.pie-chart-card:hover {
  border-color: var(--white-20);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pie-chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  text-align: center;
}

.pie-chart-subtitle {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--white-50);
  text-align: center;
  margin-bottom: 20px;
}

.pie-chart-container {
  width: 100%;
  height: 300px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* ================= CHART.JS LEGEND STYLING ================= */
.chartjs-legend {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
}

.chartjs-legend li {
  color: var(--white) !important;
}

canvas {
  max-width: 100%;
  height: auto !important;
}

/* ================= ACTIVITY FEED ================= */
.recent-activity-section {
  margin-top: 40px;
  margin-bottom: 40px;
}

.activity-feed {
  background: var(--charcoal-800);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--white-10);
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.activity-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
}

.activity-filter {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--trust-blue-light);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.activity-filter:hover {
  background: var(--trust-blue-pale);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.activity-list::-webkit-scrollbar { 
  width: 8px; 
}

.activity-list::-webkit-scrollbar-track { 
  background: var(--charcoal-700); 
  border-radius: 8px; 
}

.activity-list::-webkit-scrollbar-thumb { 
  background: var(--charcoal-600); 
  border-radius: 8px; 
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--charcoal-700);
  border-radius: 10px;
  border: 1px solid var(--white-05);
  transition: all 0.15s;
}

.activity-item:hover { 
  background: var(--charcoal-600); 
  border-color: var(--white-10); 
  transform: translateY(-1px); 
}

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.activity-icon.threat { 
  background: var(--controlled-red-pale); 
  color: var(--controlled-red-light); 
}

.activity-icon.safe { 
  background: var(--success-green-pale); 
  color: var(--success-green); 
}

.activity-content { 
  flex: 1; 
  min-width: 0; 
}

.activity-text { 
  color: var(--white-90); 
  font-weight: 500; 
  font-size: 0.95rem; 
  margin-bottom: 4px; 
}

.activity-url { 
  color: var(--white-70); 
  font-family: var(--font-mono); 
  font-size: 0.85rem; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  white-space: nowrap; 
}

.activity-time { 
  margin-left: auto; 
  color: var(--white-70); 
  font-size: 0.8125rem; 
  padding: 4px 8px; 
  border-radius: 999px; 
  border: 1px solid var(--white-10); 
  background: var(--white-05); 
  flex-shrink: 0;
  white-space: nowrap;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .sidebar {
    width: 80px;
  }

  .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    padding: 24px 16px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .pie-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 60px;
    padding: 16px 8px;
  }

  .main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
    padding: 16px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .header-icons {
    gap: 8px;
  }

  .header-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-value {
    font-size: 1.75rem;
  }

  .chart-container {
    height: 250px;
  }

  .pie-chart-container {
    height: 200px;
  }

  .activity-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }

  .activity-time {
    align-self: flex-start;
    margin-top: 8px;
    margin-left: 0;
  }
}

/* ================= SCANS PAGE ================= */
.scans-page {
  display: flex;
  flex-direction: column;
}

.scans-section {
  background: var(--charcoal-800);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--white-10);
  margin-top: 32px;
}

.scans-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.scans-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
  letter-spacing: -0.02em;
}

.scans-filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-select {
  padding: 10px 14px;
  background: var(--charcoal-700);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  color: var(--white-70);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select:hover {
  border-color: var(--white-20);
  color: var(--white);
}

.filter-select:focus {
  outline: none;
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px var(--trust-blue-pale);
}

.btn-primary {
  padding: 10px 18px;
  background: var(--trust-blue);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--trust-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ================= SCANS TABLE ================= */
.scans-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--white-10);
}

.scans-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--charcoal-800);
}

.scans-table thead {
  background: var(--charcoal-700);
  border-bottom: 2px solid var(--white-10);
}

.scans-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white-70);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.scans-table tbody tr {
  border-bottom: 1px solid var(--white-05);
  transition: background 0.15s;
}

.scans-table tbody tr:hover {
  background: var(--charcoal-700);
}

.scans-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--white-70);
  vertical-align: middle;
}

.scan-id {
  font-weight: 600;
  color: var(--white);
  font-family: var(--font-mono);
}

/* ==================== LOGOUT REQUESTS TABLE (User Management) ==================== */
.logout-requests-table-wrap {
  background: #23272f;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.logout-requests-table {
  width: 100%;
  border-collapse: collapse;
}

.logout-requests-table thead tr {
  background: #2d323c;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.logout-requests-table th {
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
}

.logout-requests-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
}

.logout-requests-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.logout-requests-table td {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  padding: 12px 16px;
  vertical-align: middle;
}

.scan-type {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white-70);
}

.scan-type i {
  font-size: 1rem;
}

.scan-status {
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.completed {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success-green);
}

.status-badge.in-progress {
  background: rgba(0, 102, 255, 0.15);
  color: var(--trust-blue-light);
}

.status-badge.failed {
  background: rgba(220, 38, 38, 0.15);
  color: var(--controlled-red-light);
}

.scan-time {
  font-size: 0.875rem;
  color: var(--white-50);
}

.scan-duration {
  font-weight: 500;
  color: var(--white-70);
}

.scan-count {
  font-weight: 600;
  color: var(--trust-blue-light);
}

.scan-threats {
  text-align: center;
}

.threat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--white-05);
  color: var(--white-70);
  border: 1px solid var(--white-10);
}

.threat-badge.danger {
  background: rgba(220, 38, 38, 0.15);
  color: var(--controlled-red-light);
  border-color: var(--controlled-red);
}

.threat-badge.warning {
  background: rgba(234, 88, 12, 0.15);
  color: var(--warning-orange);
  border-color: var(--warning-orange);
}

.threat-badge.safe {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success-green);
  border-color: var(--success-green);
}

.scan-action {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--white-10);
  background: transparent;
  color: var(--white-70);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-icon:hover {
  background: var(--white-05);
  border-color: var(--white-20);
  color: var(--white);
}

.btn-icon:active {
  background: var(--white-10);
}

/* ================= PAGINATION ================= */
.scans-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--white-10);
  gap: 16px;
  flex-wrap: wrap;
}

.pagination-left {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--white-70);
}

.rows-per-page {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--white-70);
  font-size: 0.875rem;
}

.rows-per-page label {
  margin: 0;
  font-weight: 500;
}

.rows-select {
  background: var(--charcoal-600);
  color: var(--white);
  border: 1px solid var(--charcoal-500);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}

.rows-select:hover {
  border-color: var(--trust-blue);
  background: var(--charcoal-700);
}

.rows-select:focus {
  outline: none;
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-dots {
  color: var(--white-50);
  font-weight: 600;
}

.btn-pagination {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--white-10);
  border-radius: 6px;
  color: var(--white-70);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-pagination:hover:not(:disabled) {
  border-color: var(--trust-blue);
  color: var(--trust-blue-light);
  background: var(--trust-blue-pale);
}

.btn-pagination.active {
  background: var(--trust-blue);
  border-color: var(--trust-blue);
  color: var(--white);
}

.btn-pagination:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ================= RESPONSIVE SCANS ================= */
@media (max-width: 1100px) {
  .scans-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .scans-filters {
    width: 100%;
  }

  .filter-select,
  .btn-primary {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .scans-table th,
  .scans-table td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .scan-id {
    font-size: 0.75rem;
  }

  .scans-pagination {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .pagination-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .pagination-numbers {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .scans-section {
    padding: 16px;
  }

  .scans-table-container {
    overflow-x: auto;
    /* -webkit-overflow-scrolling: touch; */
  }

  .scans-table th,
  .scans-table td {
    padding: 8px;
    font-size: 0.75rem;
  }

  .scan-action {
    gap: 4px;
  }

  .btn-icon {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .status-badge {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .threat-badge {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .scans-header {
    flex-direction: column;
    align-items: stretch;
  }

  .scans-filters {
    flex-direction: column;
  }

  .filter-select,
  .btn-primary {
    width: 100%;
  }
}

/* MODAL STYLES */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

/* Ensure overlays also behave as flex containers (some markup uses .modal-overlay) */
.modal-overlay {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  box-sizing: border-box !important;
  padding: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(180deg, var(--charcoal-700), rgba(36,40,46,0.98));
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  max-width: 720px;
  width: min(94%, 720px);
  max-height: 84vh;
  overflow: hidden; /* internal scroll in .modal-body */
  animation: slideUp 260ms cubic-bezier(.2,.9,.27,1);
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.modal-body { padding: 22px 28px 24px 28px; overflow-y: auto; max-height: calc(84vh - 140px); scroll-behavior: smooth; }

/* Invite modal specific helpers */
.invite-modal-content { max-height: 80vh; display:flex; flex-direction:column; width:520px; }
.invite-modal-body { overflow:auto; flex:1; padding-right:0.5rem; }
.email-domain-pill { display:none; padding:0.25rem 0.5rem; border-radius:12px; font-size:0.85rem; background:#3b2b2b; color:#fff; }
.company-domain-pill { display:none; padding:0.25rem 0.5rem; border-radius:12px; font-size:0.85rem; background:#2b3b4b; color:#fff; cursor:pointer; }
.company-suggestions { display:none; margin-top:0.4rem; background:var(--charcoal-800); border-radius:6px; padding:0.3rem; max-height:8rem; overflow:auto; }
.selected-company-pill { display:none; margin-top:0.4rem; padding:0.4rem; border-radius:6px; background:rgba(255,255,255,0.02); display:flex; align-items:center; justify-content:space-between; gap:0.6rem; }
.company-admin-summary { display:none; margin-top:0.6rem; padding:0.6rem; border-radius:6px; background:rgba(255,255,255,0.02); }
.invite-note { color:#aeb2b8; display:block; margin-top:0.6rem; }
.invite-success { display:none; margin-top:0.6rem; color:var(--success-green); font-weight:600; }
.invite-modal-footer { position:sticky; bottom:0; background:var(--charcoal-900); padding:0.8rem; display:flex; justify-content:flex-end; gap:0.6rem; }
.user-role-display { display:block; color:var(--white-50); background: rgba(0,0,0,0.28); }

/* Make domain pills visible in accessible states */
.email-domain-pill.visible, .company-domain-pill.visible { display:inline-block; }

/* Small responsive tweak */
@media (max-width:640px) { .invite-modal-content { width: min(94%,520px); } }

.form-group { margin-bottom: 16px; }

.form-input { width: 100%; background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.04); color: var(--white-90); padding: 12px 14px; border-radius: 8px; font-size: 0.98rem; transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease; }
.form-input::placeholder { color: var(--white-50); }
.form-input:focus { outline:none; border-color: var(--trust-blue); box-shadow: 0 8px 24px rgba(51,133,255,0.10), 0 0 0 6px rgba(0,102,255,0.08); transform: translateY(-1px); }

/* Larger inputs specifically for the Invite User modal to improve usability */
.invite-modal-content .form-input {
  padding: 16px 18px;
  font-size: 1.06rem;
  border-radius: 10px;
}

.invite-modal-content textarea.form-input {
  min-height: 120px;
}

.field-error { color: var(--controlled-red); font-size: 0.92rem; margin-top: 6px; display: none; }

.modal-close { width: 40px; height: 40px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; background:transparent; transition: background 120ms ease; }
.modal-close:hover { background: rgba(255,255,255,0.03); color: var(--white); }

.modal-footer { display:flex; justify-content:flex-end; gap:0.75rem; }
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--charcoal-500);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--white-50);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--white);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--charcoal-500);
  padding: 0 24px;
}

.tab-button {
  flex: 1;
  background: none;
  border: none;
  padding: 16px;
  color: var(--white-50);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-button:hover {
  color: var(--white);
}

.tab-button.active {
  color: var(--trust-blue);
  border-bottom-color: var(--trust-blue);
}

.tab-content {
  display: none;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--white);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  background: var(--charcoal-600);
  border: 1px solid var(--charcoal-400);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--white);
  font-size: 0.95rem;
  font-family: Inter, sans-serif;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--trust-blue);
  background: var(--charcoal-500);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-input::placeholder {
  color: var(--white-30);
}

textarea.form-input {
  resize: vertical;
  font-family: JetBrains Mono, monospace;
}

.form-group small {
  display: block;
  margin-top: 6px;
  color: var(--white-50);
  font-size: 0.85rem;
}

.url-counter {
  background: var(--charcoal-600);
  padding: 12px;
  border-radius: 6px;
  color: var(--white-70);
  font-size: 0.9rem;
}

.url-counter span:last-child {
  color: var(--trust-blue);
  font-weight: 600;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--charcoal-500);
  justify-content: flex-end;
}

.btn-secondary {
  background: var(--charcoal-600);
  border: 1px solid var(--charcoal-400);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--charcoal-500);
  border-color: var(--charcoal-300);
}

/* Card Clickable Style */
.card-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-clickable:active {
  transform: translateY(-2px);
}

/* HISTORY PAGE STYLES */
.history-page {
  padding: 20px;
}

.history-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  background: var(--charcoal-600);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--charcoal-500);
}

.history-search {
  flex: 1;
  min-width: 250px;
  background: var(--charcoal-700);
  border: 1px solid var(--charcoal-400);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--white);
  font-size: 0.95rem;
  font-family: Inter, sans-serif;
}

.history-search::placeholder {
  color: var(--white-40);
}

.history-search:focus {
  outline: none;
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
  background: var(--charcoal-700);
}

.threat-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.threat-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--charcoal-700);
  border: 1px solid var(--charcoal-500);
  color: var(--white-70);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}

.threat-filter:hover {
  border-color: var(--trust-blue);
  color: var(--white);
}

.threat-filter.active {
  background: var(--trust-blue);
  border-color: var(--trust-blue);
  color: white;
}

.filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.filter-dot.all {
  background: var(--trust-blue);
}

.filter-dot.critical {
  background: var(--controlled-red);
}

.filter-dot.high {
  background: var(--warning-orange);
}

.filter-dot.medium {
  background: #fbbf24;
}

.date-filter {
  margin-left: auto;
}

.date-select {
  background: var(--charcoal-700);
  border: 1px solid var(--charcoal-500);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.date-select:hover {
  border-color: var(--trust-blue);
}

.date-select:focus {
  outline: none;
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.threat-section {
  background: var(--charcoal-700);
  border: 1px solid var(--charcoal-500);
  border-radius: 12px;
  padding: 20px;
}

.threat-count {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.threat-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: 8px;
}

.threat-table {
  width: 100%;
  border-collapse: collapse;
}

.threat-table th {
  background: var(--charcoal-600);
  color: var(--white-60);
  padding: 14px 12px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--charcoal-500);
  white-space: nowrap;
}

.threat-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--charcoal-500);
  color: var(--white);
  font-size: 0.93rem;
}

.threat-row {
  transition: background 0.2s;
}

.threat-row:hover {
  background: rgba(0, 102, 255, 0.05);
}

.threat-row.critical {
  border-left: 4px solid var(--controlled-red);
}

.threat-row.high {
  border-left: 4px solid var(--warning-orange);
}

.threat-row.medium {
  border-left: 4px solid #fbbf24;
}

.threat-row.low {
  border-left: 4px solid var(--success-green);
}

.threat-url a {
  color: var(--trust-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.threat-url a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

.risk-score {
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  min-width: 40px;
}

.threat-row.critical .risk-score {
  color: var(--controlled-red);
}

.threat-row.high .risk-score {
  color: var(--warning-orange);
}

.threat-row.medium .risk-score {
  color: #fbbf24;
}

.severity-bar {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.severity-bar span {
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: var(--charcoal-600);
  border: 1px solid var(--white);
}

.severity-bar span.filled {
  background: inherit;
}

.threat-row.critical .severity-bar span.filled {
  background: var(--controlled-red);
}

.threat-row.high .severity-bar span.filled {
  background: var(--warning-orange);
}

.threat-row.medium .severity-bar span.filled {
  background: #fbbf24;
}

.detection-date {
  color: var(--white-70);
  font-size: 0.9rem;
  white-space: nowrap;
}

.email-target {
  color: var(--white-70);
  font-size: 0.9rem;
}

.confidence {
  font-weight: 700;
  color: var(--success-green);
  text-align: center;
  min-width: 50px;
}

.status-alert {
  display: inline-block;
  background: rgba(220, 38, 38, 0.15);
  color: var(--controlled-red);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-warning {
  display: inline-block;
  background: rgba(234, 88, 12, 0.15);
  color: var(--warning-orange);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-safe {
  display: inline-block;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.threat-row.safe {
  background: rgba(34, 197, 94, 0.08);
}

.threat-row.safe .severity-bar span.filled {
  background: #22c55e;
}

.btn-icon-small {
  background: var(--charcoal-600);
  border: none;
  color: var(--trust-blue);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-small:hover {
  background: var(--trust-blue);
  color: white;
}

.threat-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--charcoal-500);
  gap: 16px;
  flex-wrap: wrap;
}

.pagination-left {
  display: flex;
  gap: 20px;
  align-items: center;
  order: 1;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--white-70);
  font-size: 0.9rem;
}

.rows-per-page {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--white-70);
  font-size: 0.9rem;
}

.rows-per-page label {
  margin: 0;
  font-weight: 500;
}

.rows-select {
  background: var(--charcoal-600);
  color: var(--white);
  border: 1px solid var(--charcoal-500);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}

.rows-select:hover {
  border-color: var(--trust-blue);
  background: var(--charcoal-700);
}

.rows-select:focus {
  outline: none;
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pagination-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  order: 2;
  flex-wrap: wrap;
  margin-left: auto;
}

.pagination-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-pagination {
  background: transparent;
  border: 1px solid transparent;
  color: var(--white-70);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 36px;
  text-align: center;
}

.btn-pagination:hover:not(:disabled) {
  background: var(--charcoal-600);
  border-color: var(--trust-blue);
  color: var(--trust-blue);
}

.btn-pagination.active {
  background: var(--trust-blue);
  border-color: var(--trust-blue);
  color: white;
}

.btn-pagination:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--white-40);
}

.pagination-dots {
  color: var(--white-50);
  padding: 8px 2px;
}

/* Responsive History Page */
@media (max-width: 1200px) {
  .history-header {
    flex-direction: column;
    align-items: stretch;
  }

  .threat-filters {
    flex-wrap: wrap;
  }

  .date-filter {
    margin-left: 0;
    width: 100%;
  }

  .date-select {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .history-header {
    flex-direction: column;
    gap: 12px;
  }

  .history-search {
    min-width: 100%;
  }

  .threat-filters {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .threat-filter {
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }

  .threat-table th,
  .threat-table td {
    padding: 12px 8px;
    font-size: 0.85rem;
  }

  .threat-section {
    padding: 12px;
  }

  .btn-pagination {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .threat-table-container {
    overflow-x: auto;
    /* -webkit-overflow-scrolling: touch; */
  }

  .threat-table th,
  .threat-table td {
    padding: 8px;
    font-size: 0.75rem;
  }

  .threat-filters {
    width: 100%;
  }

  .threat-filter {
    flex: 1;
    min-width: 70px;
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .filter-dot {
    width: 8px;
    height: 8px;
  }

  .btn-icon-small {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .pagination-controls {
    flex-wrap: wrap;
    gap: 6px;
  }

  .threat-pagination {
    flex-direction: column;
    gap: 12px;
  }
}

/* DEVICES PAGE STYLES */
.devices-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 20px;
  padding: 20px 24px;
}

.devices-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}

.btn-revoke-all {
  background: var(--controlled-red);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-revoke-all:hover {
  background: #b91c1c;
  transform: translateY(-2px);
}

.devices-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--charcoal-500);
  margin-bottom: 30px;
  overflow-x: auto;
}

.device-tab {
  background: none;
  border: none;
  color: var(--white-60);
  padding: 16px 24px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.device-tab:hover {
  color: var(--white);
}

.device-tab.active {
  color: var(--trust-blue);
  border-bottom-color: var(--trust-blue);
}

.device-tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.device-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.device-section {
  background: var(--charcoal-700);
  border: 1px solid var(--charcoal-500);
  border-radius: 12px;
  padding: 24px;
}

.device-section h2 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.device-description {
  color: var(--white-70);
  font-size: 0.9rem;
  margin: 0 0 24px 0;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--charcoal-500);
  transition: background 0.2s;
}

.device-item:last-child {
  border-bottom: none;
}

.device-item:hover {
  background: rgba(0, 102, 255, 0.05);
}

.device-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.device-icon {
  width: 56px;
  height: 56px;
  background: var(--charcoal-600);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--trust-blue);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.device-details {
  min-width: 0;
}

.device-details h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.device-details p {
  margin: 4px 0 0 0;
  color: var(--white-60);
  font-size: 0.9rem;
}

.device-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 2;
}

.device-icons {
  display: flex;
  gap: 8px;
}

.device-os {
  width: 36px;
  height: 36px;
  background: var(--charcoal-600);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  border: 1px solid var(--charcoal-500);
  transition: all 0.2s;
}

.device-os.windows {
  background: #0078d4;
  border-color: #0078d4;
}

.device-os.chrome {
  background: #4285f4;
  border-color: #4285f4;
}

.device-os.macos {
  background: #555555;
  border-color: #555555;
}

.device-os.ios {
  background: #555555;
  border-color: #555555;
}

.device-os.safari {
  background: #0071e3;
  border-color: #0071e3;
}

.device-location {
  color: var(--white-70);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-location i {
  opacity: 0.6;
  font-size: 0.8rem;
}

.device-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.device-status {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.device-status.current {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success-green);
}

.btn-revoke-device {
  background: transparent;
  border: 1px solid var(--controlled-red);
  color: var(--controlled-red);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-revoke-device:hover {
  background: var(--controlled-red);
  color: white;
}

.device-view-more {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--charcoal-500);
}

.btn-view-more {
  background: transparent;
  border: none;
  color: var(--trust-blue);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.btn-view-more:hover {
  color: #3b82f6;
}

.btn-revoke-link {
  background: transparent;
  border: none;
  color: var(--controlled-red);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.btn-revoke-link:hover {
  color: #b91c1c;
}

/* App List Styles */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
}

.app-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--charcoal-500);
  transition: background 0.2s;
}

.app-item:last-child {
  border-bottom: none;
}

.app-item:hover {
  background: rgba(0, 102, 255, 0.05);
}

.app-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.app-icon {
  width: 56px;
  height: 56px;
  background: var(--trust-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.app-icon.connected {
  background: var(--charcoal-600);
  color: var(--success-green);
}

.app-details {
  min-width: 0;
}

.app-details h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.app-details p {
  margin: 4px 0 0 0;
  color: var(--white-60);
  font-size: 0.9rem;
}

.app-location {
  color: var(--white-70);
  font-size: 0.9rem;
  text-align: right;
  flex-shrink: 0;
}

.app-actions {
  display: flex;
  gap: 12px;
  margin-left: 16px;
  flex-shrink: 0;
}

.btn-disconnect {
  background: transparent;
  border: 1px solid var(--controlled-red);
  color: var(--controlled-red);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-disconnect:hover {
  background: var(--controlled-red);
  color: white;
}

.app-revoke-all {
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid var(--charcoal-500);
}

.btn-revoke-all-apps {
  background: transparent;
  border: none;
  color: var(--controlled-red);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.btn-revoke-all-apps:hover {
  color: #b91c1c;
}

/* Activity History Empty State */
.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.activity-icon {
  font-size: 4rem;
  color: var(--charcoal-500);
  margin-bottom: 24px;
}

.btn-show-activity {
  background: var(--success-green);
  border: none;
  color: white;
  padding: 12px 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-show-activity:hover {
  background: #15803d;
  transform: translateY(-2px);
}

.connected-apps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.connected-app {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--charcoal-500);
  transition: background 0.2s;
}

.connected-app:last-child {
  border-bottom: none;
}

.connected-app:hover {
  background: rgba(0, 102, 255, 0.05);
}

/* Responsive Devices Page */
@media (max-width: 1024px) {
  .device-item {
    flex-wrap: wrap;
  }

  .device-middle {
    width: 100%;
    order: 3;
    margin-top: 12px;
  }

  .device-location {
    justify-content: center;
  }

  .app-item {
    flex-direction: column;
    text-align: center;
  }

  .app-location {
    text-align: center;
    margin-top: 8px;
  }
}

@media (max-width: 768px) {
  .devices-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-revoke-all {
    width: 100%;
    justify-content: center;
  }

  .device-tabs {
    flex-wrap: wrap;
    gap: 12px;
  }

  .device-tab {
    padding: 12px 16px;
    font-size: 0.85rem;
    border-bottom: none;
    border-radius: 6px;
    background: var(--charcoal-600);
  }

  .device-tab.active {
    background: var(--trust-blue);
    color: white;
  }

  .device-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .device-middle {
    width: 100%;
    align-items: flex-start;
  }

  .device-actions {
    width: 100%;
  }

  .app-item {
    flex-direction: column;
    gap: 12px;
  }

  .app-actions {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .devices-header h1 {
    font-size: 1.5rem;
  }

  .device-section {
    padding: 16px;
  }

  .device-item {
    padding: 12px;
  }

  .device-icon {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .device-tab {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .btn-revoke-device,
  .btn-disconnect {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .activity-icon {
    font-size: 3rem;
  }

  .btn-show-activity {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* ==================== DEVICES/SESSIONS PAGE STYLING ==================== */

.devices-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 2rem;
  border-bottom: none;
}

.devices-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.devices-header .page-subtitle {
  font-size: 0.9rem;
  color: var(--white-70);
  margin-top: 0.25rem;
}

.devices-top-action {
  padding: 0 0 4px 0;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn-terminate-all {
  background: var(--danger-red);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.3s ease;
}

.btn-terminate-all:hover {
  background: #c02020;
}

.sessions-container {
  padding: 0;
}

.sessions-header {
  margin-bottom: 8px;
  margin-top: 0;
}

.sessions-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 0.5rem 0;
}

.sessions-description {
  color: var(--white-70);
  font-size: 0.95rem;
  margin: 0;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.session-item {
  background: var(--charcoal-800);
  border: 1px solid var(--charcoal-700);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s ease;
}

.session-item:hover {
  background: var(--charcoal-700);
}

.session-item.current-session {
  border: 1px solid var(--trust-blue);
  background: rgba(0, 102, 255, 0.05);
}

.session-device-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  min-width: 180px;
}

.session-device-info .device-icon {
  font-size: 2rem;
  color: var(--trust-blue);
}

.device-details h3 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--white);
  margin: 0;
}

.device-time {
  font-size: 0.8rem;
  color: var(--white-70);
  margin: 0.25rem 0 0 0;
}

.session-middle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.device-os-icons {
  display: flex;
  gap: 0.5rem;
}

.os-icon {
  font-size: 1.5rem;
  color: var(--white-70);
  transition: color 0.2s ease;
}

.os-icon:hover {
  color: var(--white);
}

.os-icon.windows {
  color: #0078d4;
}

.os-icon.edge {
  color: #0078d4;
}

.device-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--white-70);
  font-size: 0.9rem;
}

.device-location i {
  font-size: 0.8rem;
}

.session-status {
  flex: 0 0 auto;
}

.status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-badge.current {
  background: rgba(22, 163, 74, 0.2);
  color: var(--success-green);
}

.session-actions {
  flex: 0 0 auto;
}

.btn-terminate-session {
  background: var(--danger-red);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.3s ease;
}

.btn-terminate-session:hover {
  background: #c02020;
}

.sessions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--charcoal-700);
  gap: 1rem;
}

.btn-view-more,
.btn-terminate-others {
  background: transparent;
  color: var(--trust-blue);
  border: none;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.btn-view-more:hover,
.btn-terminate-others:hover {
  color: #0052cc;
}

.btn-terminate-others {
  color: var(--danger-red);
}

.btn-terminate-others:hover {
  color: #c02020;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .session-item {
    flex-wrap: wrap;
  }

  .session-middle {
    flex: 1 1 100%;
    order: 3;
  }
}

@media (max-width: 768px) {
  .devices-header {
    flex-direction: column;
    align-items: stretch;
  }

  .sessions-container {
    padding: 1rem;
  }

  .session-item {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .session-device-info {
    width: 100%;
  }

  .session-middle {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .session-status,
  .session-actions {
    width: 100%;
  }

  .btn-terminate-session {
    width: 100%;
    justify-content: center;
  }

  .sessions-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-view-more,
  .btn-terminate-others {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .devices-header {
    padding: 1.5rem 1rem;
  }

  .devices-header h1 {
    font-size: 1.5rem;
  }

  .btn-terminate-all {
    font-size: 0.8rem;
    padding: 0.625rem 1rem;
  }

  .session-item {
    padding: 0.75rem;
  }

  .session-device-info {
    min-width: auto;
    flex: 1 1 100%;
  }

  .device-location {
    font-size: 0.8rem;
  }

  .os-icon {
    font-size: 1.25rem;
  }
}
/* ==================== SETTINGS PAGE STYLING ==================== */

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 20px;
  padding: 20px 24px;
}

.settings-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}

.page-subtitle {
  color: var(--white-50);
  font-size: 0.875rem;
  margin-top: 4px;
}

.settings-container {
  display: flex;
  gap: 2rem;
  padding: 0;
  max-width: 100%;
  margin: 0;
}

.settings-top-nav {
  background: var(--charcoal-800);
  border-bottom: 1px solid var(--charcoal-700);
  padding: 1rem 2rem;
  margin: -2rem -2rem 2rem -2rem;
  overflow-x: auto;
}

.settings-top-nav .settings-nav {
  display: flex;
  flex-direction: row;
  gap: 0;
  width: 100%;
}

.settings-sidebar {
  display: none;
}

.settings-nav {
  display: flex;
  flex-direction: row;
  gap: 0;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--charcoal-400);
  font-size: 0.85rem;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1rem;
  padding-bottom: calc(0.75rem + 1rem);
}

.settings-nav-item:hover {
  background: transparent;
  color: #0066ff;
  border-bottom-color: #0066ff;
}

.settings-nav-item.active {
  background: transparent;
  color: #0066ff;
  border-bottom-color: #0066ff;
  border-left: none;
  padding-left: 1.25rem;
  font-weight: 600;
}

.settings-nav-item i {
  width: 18px;
  font-size: 0.95rem;
}

.settings-container {
  display: block;
}

.settings-content {
  flex: 1;
  background: transparent;
  border-radius: 0.75rem;
  padding: 0;
  box-shadow: none;
}

.settings-section {
  display: none;
  background: var(--charcoal-800);
  padding: 2rem;
  border-radius: 0.75rem;
  border: 1px solid var(--charcoal-700);
}

.settings-section.active {
  display: block;
  background: var(--charcoal-800);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--charcoal-700);
}

.section-header h2 {
  font-size: 1.5rem;
  color: var(--white);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.section-header p {
  color: var(--charcoal-400);
  margin: 0;
  font-size: 0.95rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group .form-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--charcoal-700);
  border-radius: 0.375rem;
  font-size: 0.95rem;
  background: #000000;
  color: var(--white);
  font-weight: 600;
  transition: all 0.3s ease;
}

.form-group .form-input:focus {
  outline: none;
  border-color: #0066ff;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-group small {
  color: var(--charcoal-400);
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.settings-group {
  padding: 1.5rem;
  background: var(--charcoal-700);
  border-radius: 0.5rem;
  border: 1px solid var(--charcoal-600);
}

.settings-group.danger-zone {
  background: rgba(220, 38, 38, 0.05);
  border-color: #dc2626;
}

.group-header {
  margin-bottom: 1rem;
}

.group-header h3 {
  color: var(--white);
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.group-header p {
  color: #6b7280;
  margin: 0;
  font-size: 0.9rem;
}

.group-description {
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 0.75rem !important;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.status-badge.enabled {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.disabled {
  background: #fee2e2;
  color: #7f1d1d;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--charcoal-800);
  border: 1px solid var(--charcoal-700);
  border-radius: 0.375rem;
}

.session-info {
  flex: 1;
}

.session-device {
  font-weight: 600;
  color: var(--white);
  margin: 0;
  font-size: 0.95rem;
}

.session-location {
  color: var(--charcoal-400);
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
}

.session-time {
  color: var(--charcoal-400);
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
}

.badge-current {
  background: rgba(0, 102, 255, 0.15);
  color: #0066ff;
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--charcoal-700);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
  position: relative;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked ~ .toggle-slider {
  background: #0066ff;
}

.toggle-switch input:checked ~ .toggle-slider::after {
  left: 22px;
}

/* Checkbox Items */
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--white);
}

.checkbox-item input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0066ff;
}

/* Notification Categories */
.notification-category {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--charcoal-700);
}

.notification-category:last-child {
  border-bottom: none;
}

.notification-category h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-weight: 600;
  margin: 0 0 1rem 0;
  font-size: 1rem;
}

.notification-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.notification-item:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.notification-item:hover .notification-title {
  color: #111827;
}

.notification-item:hover .notification-desc {
  color: #374151;
}

.notification-title {
  color: #1f2937;
  font-weight: 600;
  margin: 0;
  font-size: 0.95rem;
}

.notification-desc {
  color: #6b7280;
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
}

/* Theme Selector */
.theme-selector {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.theme-option input {
  display: none;
}

.theme-option input:checked ~ .theme-label {
  font-weight: 700;
  color: #0066ff;
}

.theme-option:hover {
  opacity: 1;
}

.theme-preview {
  width: 80px;
  height: 60px;
  border-radius: 0.375rem;
  border: 2px solid #e5e7eb;
  transition: border-color 0.3s ease;
}

.theme-preview.light {
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
}

.theme-preview.dark {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.theme-preview.auto {
  background: linear-gradient(135deg, #ffffff 0%, #1f2937 100%);
}

.theme-option input:checked ~ .theme-preview {
  border-color: #0066ff;
  box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2);
}

.theme-label {
  font-size: 0.9rem;
  color: #6b7280;
  transition: all 0.3s ease;
}

/* Color Theme Selector */
.color-theme-selector {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option input {
  display: none;
}

.color-option input:checked ~ .color-label {
  font-weight: 700;
  color: var(--trust-blue);
}

.color-preview {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.color-option input:checked ~ .color-preview {
  border-color: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}

.color-label {
  font-size: 0.9rem;
  color: var(--white-70);
  transition: all 0.2s ease;
}

/* Font Size Selector */
.font-size-selector {
  margin: 1rem 0;
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #d1d5db;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  accent-color: #0066ff;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0066ff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0066ff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.size-indicators {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  color: #9ca3af;
  font-size: 0.8rem;
}

.preview-text {
  margin-top: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  color: #1f2937;
}

/* System Info */
.system-info {
  background: #f9fafb;
  border-radius: 0.375rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.info-label {
  color: #6b7280;
  font-weight: 500;
}

.info-value {
  color: #1f2937;
  font-weight: 600;
}

/* Button Styles */
.btn-small {
  background: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-small:hover {
  background: #e5e7eb;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Responsive */
@media (max-width: 1200px) {
  .settings-container {
    gap: 1.5rem;
  }

  .settings-sidebar {
    width: 180px;
  }

  .settings-nav-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .settings-container {
    flex-direction: column;
    gap: 1rem;
  }

  .settings-sidebar {
    width: 100%;
    position: static;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    /* -webkit-overflow-scrolling: touch; */
  }

  .settings-nav-item {
    flex-shrink: 0;
  }

  .settings-content {
    padding: 1.5rem;
  }

  .settings-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .theme-selector {
    flex-direction: column;
    gap: 1rem;
  }

  .session-item {
    flex-direction: column;
    gap: 1rem;
  }

  .notification-item {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .settings-container {
    padding: 0 1rem 1rem 1rem;
  }

  .settings-header {
    padding: 1rem;
  }

  .settings-header h1 {
    font-size: 1.5rem;
  }

  .settings-content {
    padding: 1rem;
  }

  .settings-form {
    gap: 1.5rem;
  }

  .settings-group {
    padding: 1rem;
  }
}

/* ==================== HELP PAGE STYLING ==================== */

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 20px;
  padding: 20px 24px;
}

.help-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}

/* ================= CHAT INTERFACE ================= */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  padding: 20px 24px;
  gap: 16px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user-message {
  justify-content: flex-end;
}

.chat-message.ai-message {
  justify-content: flex-start;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.message-avatar.ai-avatar {
  background: var(--trust-blue-pale);
  color: var(--trust-blue);
}

.message-avatar.user-avatar {
  background: var(--white-10);
  color: var(--white);
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-message.user-message .message-content {
  background: var(--trust-blue);
  color: var(--white);
}

.chat-message.ai-message .message-content {
  background: var(--charcoal-700);
  color: var(--white);
  border: 1px solid var(--white-10);
}

.message-content p {
  margin: 0;
}

.chat-input-area {
  padding: 16px 0;
  border-top: 1px solid var(--white-10);
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--charcoal-700);
  border: 1px solid var(--white-10);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--trust-blue);
  box-shadow: 0 0 0 3px var(--trust-blue-pale);
}

.chat-input::placeholder {
  color: var(--white-50);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  background: var(--trust-blue);
  border: none;
  border-radius: 8px;
  color: var(--white);
  font-size: 1.125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-send-btn:hover {
  background: var(--trust-blue-hover);
  transform: translateY(-1px);
}

.chat-send-btn:active {
  transform: translateY(0);
}

/* Help Categories */
.help-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.category-card {
  background: var(--charcoal-800);
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--charcoal-700);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: #0066ff;
}

.category-icon {
  font-size: 3rem;
  color: #0066ff;
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.25rem;
  color: var(--white);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.category-card p {
  color: var(--charcoal-400);
  margin: 0 0 1.5rem 0;
  font-size: 0.95rem;
}

.view-btn {
  background: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.view-btn:hover {
  background: #e5e7eb;
  border-color: #0066ff;
  color: #0066ff;
}

/* Help Section */
.help-section {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.help-section h2 {
  font-size: 1.75rem;
  color: #1f2937;
  margin: 0 0 1.5rem 0;
  font-weight: 700;
}

/* Articles List */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  cursor: pointer;
}

.article-item:hover {
  background: #f3f4f6;
  border-color: #0066ff;
  transform: translateX(4px);
}

.article-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #0066ff;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.article-content {
  flex: 1;
}

.article-content h4 {
  color: #1f2937;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 700;
}

.article-content p {
  color: #6b7280;
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
}

.read-time {
  display: inline-block;
  color: #9ca3af;
  font-size: 0.8rem;
  background: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
}

.article-item i {
  color: #d1d5db;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.article-item:hover i {
  color: #0066ff;
}

/* Quick Support */
.quick-support {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.support-card {
  background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
  color: white;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 102, 255, 0.2);
}

.support-card h3 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.support-card p {
  margin: 0 0 1.5rem 0;
  opacity: 0.95;
}

.support-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.support-card .btn-primary {
  background: white;
  color: #0066ff;
}

.support-card .btn-primary:hover {
  background: #f3f4f6;
}

.support-card .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: white;
}

.support-card .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.support-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.info-item i {
  font-size: 1.5rem;
  color: #0066ff;
  flex-shrink: 0;
}

.info-item h4 {
  color: #1f2937;
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.info-item p {
  color: #6b7280;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 1200px) {
  .quick-support {
    grid-template-columns: 1fr;
  }

  .help-categories {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .help-container {
    padding: 0 1rem 1rem 1rem;
  }

  .help-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .help-header h1 {
    font-size: 1.5rem;
  }

  .help-search-bar {
    flex-direction: column;
  }

  .help-categories {
    grid-template-columns: 1fr;
  }

  .help-section {
    padding: 1.5rem;
  }

  .support-actions {
    flex-direction: column;
  }

  .support-actions button {
    width: 100%;
  }

  .article-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-number {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .support-info {
    flex-direction: row;
  }

  .info-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .help-categories {
    grid-template-columns: 1fr;
  }

  .category-card {
    padding: 1.5rem;
  }

  .help-section {
    padding: 1rem;
  }

  .support-card {
    padding: 1.5rem;
  }

  .support-info {
    flex-direction: column;
  }

  .article-item {
    padding: 1rem;
    gap: 1rem;
  }
}

/* ================= Feedback / Support tickets page ================= */
.feedback-page .feedback-ticket-list {
  min-height: 80px;
}

.feedback-page .feedback-ticket-row:hover {
  background: var(--charcoal-700);
}

.feedback-page .feedback-ticket-status.status-open {
  background: rgba(0, 102, 255, 0.2);
  color: var(--trust-blue-light);
}

.feedback-page .feedback-ticket-status.status-resolved,
.feedback-page .feedback-ticket-status.status-closed {
  color: var(--success-green);
}

