/* Root Variables & Theme Definition */
:root {
  --bg-darker: #050811;
  --bg-dark: #0a0f1d;
  --bg-card: rgba(16, 24, 48, 0.45);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(37, 99, 235, 0.4);
  --primary: #3b82f6;      /* High-contrast royal blue for readable highlights */
  --brand-blue: #16368d;   /* Exact CIPM Logo Blue */
  --brand-red: #d21f26;    /* Exact CIPM Logo Red */
  --primary-glow: rgba(22, 54, 141, 0.25);
  --secondary: #d21f26;    /* Replaced with Brand Red */
  --accent: #d21f26;       /* Replaced with Brand Red */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  --danger: #d21f26;       /* Danger matches Brand Red */
  --shadow-glow: 0 8px 32px 0 rgba(22, 54, 141, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-darker);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Background Glowing Orbs */
.glass-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #0c152a 0%, #030712 100%);
  z-index: -3;
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  z-index: -2;
  pointer-events: none;
  animation: orbFloat 20s infinite alternate;
}

#orb-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}

#orb-2 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  bottom: -200px;
  right: -100px;
  animation-delay: -5s;
}

#orb-3 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  top: 30%;
  right: 20%;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 80px) scale(1.1); }
}

/* App Container Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Navigation Styles */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: var(--shadow-glow);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

.logo-icon i {
  color: #fff;
  width: 24px;
  height: 24px;
}

.logo-text h1 {
  font-size: 20px;
  line-height: 1.1;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.tab-nav {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-tab i {
  width: 16px;
  height: 16px;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  color: var(--text-main);
  background: var(--primary-glow);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background-color: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
}

/* App Main / Tab Content Switcher */
.app-main {
  flex-grow: 1;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats Row Grid */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i {
  color: var(--primary);
  width: 24px;
  height: 24px;
}

.stat-card:nth-child(2) .stat-icon i { color: var(--secondary); }
.stat-card:nth-child(3) .stat-icon i { color: var(--accent); }

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Dashboard Analytics Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.main-chart-card {
  grid-column: span 2;
}

@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .main-chart-card {
    grid-column: span 1;
  }
}

.dashboard-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-glow);
}

.card-header {
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.card-header h3 i {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.card-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-container-donut {
  position: relative;
  height: 280px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* HR Pillars Section */
.mt-4 { margin-top: 24px; }
.w-full { width: 100%; }

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.pillar-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.pillar-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.2);
}

.pillar-num {
  font-size: 48px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: rgba(255, 255, 255, 0.03);
  position: absolute;
  top: -10px;
  right: 10px;
}

.pillar-card h4 {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.pillar-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.pillar-tag {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* Corporate Case Studies List View */
.cases-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  padding: 16px 20px;
  border-radius: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex-grow: 1;
  max-width: 500px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  width: 18px;
  height: 18px;
}

.search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  padding: 12px 16px 12px 42px;
  color: var(--text-main);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.filter-group {
  display: flex;
  gap: 10px;
}

.filter-group select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  color: var(--text-main);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-group select:focus {
  border-color: var(--primary);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.case-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: var(--transition);
}

.case-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15);
}

.case-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
}

.badge.blue {
  color: var(--primary);
  background: var(--primary-glow);
  border-color: rgba(37, 99, 235, 0.2);
}

.badge.green {
  color: var(--secondary);
  background: rgba(210, 31, 38, 0.1);
  border-color: rgba(210, 31, 38, 0.2);
}

.case-card h3 {
  font-size: 17px;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 12px;
  height: 46px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.case-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
  margin-top: auto;
}

.company-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-lbl i {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.read-more-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* AI Assistant & RAG Chat Layout */
.chat-layout {
  display: grid;
  grid-template-rows: 1fr auto;
  height: calc(100vh - 200px);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

.chat-history-container {
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-welcome {
  max-width: 650px;
  margin: 40px auto;
  text-align: center;
}

.welcome-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
}

.welcome-icon i {
  color: var(--primary);
  width: 32px;
  height: 32px;
}

.chat-welcome h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.chat-welcome p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 30px;
}

.suggested-queries {
  text-align: left;
}

.suggested-queries h4 {
  font-size: 13px;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.suggested-query-btn {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  text-align: left;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: var(--transition);
}

.suggested-query-btn:hover {
  background: rgba(37, 99, 235, 0.05);
  color: var(--text-main);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateX(2px);
}

/* Chat Messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: messageSlide 0.3s ease-out forwards;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

@keyframes messageSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-sender {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.message.user .message-sender {
  justify-content: flex-end;
}

.sender-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sender-avatar i {
  width: 12px;
  height: 12px;
}

.message.assistant .sender-avatar {
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.message-content {
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.6;
}

.message.user .message-content {
  background: linear-gradient(135deg, #0e203c, #1e3a8a);
  color: #fff;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(30, 58, 138, 0.4);
}

.message.assistant .message-content {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-glass);
}

/* Chat Citations / Sources */
.message-sources {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.source-tag i {
  width: 12px;
  height: 12px;
}

/* ── Offline Mode Badge ─────────────────────────────────────── */
.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: 6px;
}

.offline-badge i { width: 10px; height: 10px; }

.offline-notice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  line-height: 1.45;
}

.offline-notice i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

.offline-avatar {
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #f59e0b !important;
}

.message.offline-mode .message-content {
  border-color: rgba(245, 158, 11, 0.15) !important;
  background: rgba(245, 158, 11, 0.03) !important;
}

/* ── Rich Markdown Rendering inside messages ────────────────── */
.msg-body { font-size: 14px; line-height: 1.65; color: var(--text-main); }

.msg-h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-glass);
}

.msg-h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 14px 0 5px 0;
}

.msg-list {
  margin: 6px 0 10px 18px;
  padding: 0;
  list-style: disc;
}

.msg-list li {
  margin-bottom: 4px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main);
}

.msg-blockquote {
  border-left: 3px solid var(--primary);
  margin: 6px 0;
  padding: 6px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
}

.msg-source-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.75;
  margin: 4px 0 2px 0;
  letter-spacing: 0.02em;
}

.msg-source-label i { width: 12px; height: 12px; }

.msg-hr {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: 14px 0;
}

/* ── Expandable Source Cards (Offline) ──────────────────────── */
.message-sources:has(.source-card) {
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.source-card {
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.04);
  overflow: hidden;
  transition: border-color 0.2s;
}

.source-card[open] {
  border-color: rgba(245, 158, 11, 0.4);
}

.source-card-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dark);
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

.source-card-summary:hover { background: rgba(245, 158, 11, 0.06); }
.source-card-summary::-webkit-details-marker { display: none; }

.source-card-summary i { width: 13px; height: 13px; color: #f59e0b; flex-shrink: 0; }

.source-page-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 4px;
  padding: 1px 6px;
}

.source-snippet {
  padding: 8px 12px 10px 12px;
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  border-top: 1px solid rgba(245, 158, 11, 0.1);
  font-style: italic;
}


/* Chat Input Bar */
.chat-input-area {
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-glass);
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: 14px;
  transition: var(--transition);
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.chat-input-wrapper textarea {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 14.5px;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  max-height: 120px;
  padding: 4px 0;
}

#chat-send-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

#chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

#chat-send-btn:disabled {
  background: var(--text-dark);
  cursor: not-allowed;
  opacity: 0.5;
}

.chat-disclaimer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dark);
  margin-top: 8px;
  justify-content: center;
}

#chat-mode-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.3s;
}

.chat-disclaimer i {
  width: 12px;
  height: 12px;
}

/* Typing Indicator Animation */
.typing-loader {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.typing-loader span {
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-loader span:nth-child(1) { animation-delay: -0.32s; }
.typing-loader span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.loading-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* Admin Panel Layout */
.admin-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.upload-zone {
  border: 2px dashed var(--border-glass);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.01);
  transition: var(--transition);
  margin-bottom: 20px;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.03);
}

.upload-icon {
  width: 44px;
  height: 44px;
  color: var(--text-dark);
  margin-bottom: 12px;
  transition: var(--transition);
}

.upload-zone:hover .upload-icon {
  color: var(--primary);
  transform: translateY(-2px);
}

.upload-zone p {
  font-size: 14px;
  color: var(--text-muted);
}

.highlight-btn {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.file-limits {
  display: block;
  font-size: 11px;
  color: var(--text-dark);
  margin-top: 8px;
}

/* File Upload Progress */
.upload-progress-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.upload-file-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* Custom Admin Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th, .admin-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
  color: var(--text-dark);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.status-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-badge.success {
  background: rgba(210, 31, 38, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(210, 31, 38, 0.2);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Action Buttons */
.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-icon {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dark);
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.indexer-status-msg {
  font-size: 12px;
  margin-top: 8px;
  color: var(--text-muted);
}

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 17, 0.8);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  width: 100%;
  max-width: 650px;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-glow);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 22px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.modal-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.modal-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-meta strong {
  color: var(--text-main);
}

.modal-body {
  max-height: 450px;
  overflow-y: auto;
  padding-right: 8px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section h4 {
  font-size: 14px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-section h4 i {
  width: 16px;
  height: 16px;
}

.modal-section p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
  font-size: 12px;
  color: var(--text-dark);
}

/* Authentication & Roles Styling */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-auth {
  display: flex;
  align-items: center;
}

.user-session-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.user-name-lbl {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
}

#btn-logout {
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#btn-logout:hover {
  color: var(--danger);
  transform: scale(1.05);
}

/* Auth Modal Card details */
.auth-card {
  max-width: 420px;
  padding: 36px;
  border-radius: 20px;
}

.auth-icon-header {
  color: var(--primary);
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 4px;
}

.auth-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-with-icon {
  position: relative;
  width: 100%;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  width: 18px;
  height: 18px;
}

.input-with-icon input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  padding: 12px 16px 12px 42px;
  color: var(--text-main);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.input-with-icon input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.auth-error-msg {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 18px;
  margin-top: 4px;
  text-align: center;
}

/* Utility Class for Dynamic Navigation hiding */
.hidden-tab {
  display: none !important;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12.5px;
}

/* CIPM Logo & Web Analytics Layout */
.header-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 0 15px rgba(22, 54, 141, 0.15);
}

.web-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.web-metric-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

.web-metric-card:hover {
  background: rgba(37, 99, 235, 0.03);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-2px);
}

.web-metric-header {
  display: flex;
  flex-direction: column;
}

.web-metric-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  text-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
}

.web-metric-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

.web-metric-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.web-metric-footer {
  font-size: 11px;
  color: var(--text-dark);
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.web-metric-footer i {
  width: 12px;
  height: 12px;
}

.comparison-banner {
  display: flex;
  gap: 16px;
  background: rgba(37, 99, 235, 0.03);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  padding: 16px 20px;
  align-items: center;
}

.comparison-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.comparison-content h4 {
  font-size: 14.5px;
  color: var(--primary);
  margin-bottom: 4px;
}

.comparison-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Floating AI Action Button (FAB) */
.fab-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.4);
  transition: var(--transition);
}

.fab-chat:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
}

.fab-chat i {
  width: 18px;
  height: 18px;
}

/* Floating AI Chat Window / Drawer */
.chat-drawer {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 420px;
  height: 600px;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-drawer.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-glass);
}

.drawer-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-main);
}

.drawer-header-title i {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drawer-close-btn:hover {
  color: var(--text-main);
  transform: scale(1.05);
}

.drawer-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.drawer-footer {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-glass);
  padding: 14px 20px;
}

.drawer-footer .chat-disclaimer {
  margin-top: 6px;
}

/* Minor Styles Adjustment for compact chat layout inside drawer */
.chat-drawer .chat-welcome {
  margin: 10px auto;
}

.chat-drawer .chat-welcome h3 {
  font-size: 18px;
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
}

.chat-drawer .chat-welcome p {
  font-size: 12.5px;
  margin-bottom: 16px;
}

.chat-drawer .suggested-query-btn {
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 6px;
}

/* Frontpage AI Card */
.landing-ai-card {
  background: linear-gradient(135deg, rgba(10, 15, 29, 0.4), rgba(22, 78, 99, 0.15));
  border: 1px solid rgba(37, 99, 235, 0.2);
  backdrop-filter: blur(16px);
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 4px 30px rgba(37, 99, 235, 0.05);
}

.landing-ai-search-wrapper {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}

.landing-ai-search-wrapper .input-with-icon {
  flex-grow: 1;
}

.landing-ai-search-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 14px 16px 14px 44px;
  color: var(--text-main);
  border-radius: 12px;
  font-size: 14.5px;
  outline: none;
  transition: var(--transition);
}

.landing-ai-search-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.25);
}

.landing-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.suggestion-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 8px;
}

.landing-suggestion-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.landing-suggestion-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

/* Make web metric cards clickable */
.web-metric-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding-bottom: 28px !important;
}

.web-metric-card::after {
  content: 'Click to deep-dive \2192';
  position: absolute;
  bottom: 8px;
  right: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.5;
  transform: translateX(-4px);
  transition: var(--transition);
}

.web-metric-card:hover::after {
  opacity: 1;
  transform: translateX(0);
  color: var(--secondary);
}

/* Horizontal chart container */
.chart-container-horizontal {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Secure PDF Preview Modal Styles */
.pdf-preview-card {
  max-width: 900px !important;
  width: 95% !important;
}

.pdf-viewer-body {
  max-height: calc(90vh - 160px) !important;
}

.pdf-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.pdf-pagination {
  font-size: 14px;
  color: var(--text-muted);
}

/* Papers list styles */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.paper-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.paper-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.paper-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.paper-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.paper-card h4 {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-main);
  height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.paper-meta-row {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.paper-meta-row span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* JPG logo styling fallback */
.header-logo-img {
  height: 48px !important;
  background: #ffffff !important;
  padding: 4px !important;
}

/* Live News & Split Layout */
.web-analytics-split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .web-analytics-split {
    grid-template-columns: 1fr;
  }
}

.live-news-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
}

.live-news-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 10px;
}

.live-ai-digest {
  background: rgba(210, 31, 38, 0.04);
  border-left: 3px solid var(--brand-red);
  padding: 12px 16px;
  border-radius: 4px 10px 10px 4px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.live-ai-digest h3, .live-ai-digest h4 {
  font-size: 13px;
  color: var(--brand-red);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-ai-digest ul {
  margin-left: 16px;
  margin-top: 4px;
}

.live-ai-digest li {
  margin-bottom: 4px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  transition: var(--transition);
}

.news-item:hover {
  background: rgba(37, 99, 235, 0.03);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateX(2px);
}

.news-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-title:hover {
  color: var(--primary);
}

.news-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dark);
}

.loader-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.05);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Real-Time Forex & Remuneration Calculator Widget */
.forex-rate-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  transition: var(--transition);
}

.forex-rate-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.calculator-box input[type="number"] {
  -moz-appearance: textfield;
}

.calculator-box input[type="number"]::-webkit-outer-spin-button,
.calculator-box input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.calculator-box select, .calculator-box input {
  transition: var(--transition);
}

.calculator-box select:focus, .calculator-box input:focus {
  border-color: var(--primary) !important;
  background: rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.25);
}

/* Blinking Auto-Update Indicator Dot */
.ping-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand-red);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(210, 31, 38, 0.6);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(210, 31, 38, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(210, 31, 38, 0);
  }
}

/* News List Scrollable Fixes */
.live-news-content::-webkit-scrollbar {
  width: 6px;
}
.live-news-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.01);
}
.live-news-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
}
.live-news-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.1);
}

/* Footer & Disclaimer Styles */
.app-footer {
  margin-top: 40px;
  padding: 24px 0 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.footer-disclaimer {
  max-width: 900px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.disclaimer-icon {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-disclaimer p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.footer-disclaimer strong {
  color: var(--text-main);
  font-weight: 600;
}

.footer-copyright {
  font-size: 11px;
  color: var(--text-dark);
  margin-left: 16px;
  margin-top: 4px;
}

.live-ai-digest li {
  margin-bottom: 4px;
}

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

.news-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  transition: var(--transition);
}

.news-item:hover {
  background: rgba(37, 99, 235, 0.03);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateX(2px);
}

.news-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-title:hover {
  color: var(--primary);
}

.news-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dark);
}

.loader-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.05);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Real-Time Forex & Remuneration Calculator Widget */
.forex-rate-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  transition: var(--transition);
}

.forex-rate-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.calculator-box input[type="number"] {
  -moz-appearance: textfield;
}

.calculator-box input[type="number"]::-webkit-outer-spin-button,
.calculator-box input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.calculator-box select, .calculator-box input {
  transition: var(--transition);
}

.calculator-box select:focus, .calculator-box input:focus {
  border-color: var(--primary) !important;
  background: rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.25);
}

/* Blinking Auto-Update Indicator Dot */
.ping-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand-red);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-red {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(210, 31, 38, 0.6);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(210, 31, 38, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(210, 31, 38, 0);
  }
}

/* News List Scrollable Fixes */
.live-news-content::-webkit-scrollbar {
  width: 6px;
}
.live-news-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.01);
}
.live-news-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
}
.live-news-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.1);
}

/* Footer & Disclaimer Styles */
.app-footer {
  margin-top: 40px;
  padding: 24px 0 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.footer-disclaimer {
  max-width: 900px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.disclaimer-icon {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-disclaimer p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.footer-disclaimer strong {
  color: var(--text-main);
  font-weight: 600;
}

.footer-copyright {
  font-size: 11px;
  color: var(--text-dark);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


/* ============================================================
   RESPONSIVE STYLES — Mobile-First Overhaul
   Breakpoints: 992px | 768px | 480px | 360px
   ============================================================ */

/* ── 992px: Tablet Landscape ────────────────────────────── */
@media (max-width: 992px) {

  .app-container { padding: 16px; }

  /* Header: stack logo + nav vertically */
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
  }

  /* Nav tabs: scrollable row */
  .tab-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 4px;
  }
  .tab-nav::-webkit-scrollbar { display: none; }

  .nav-tab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 9px 14px;
    font-size: 13px;
  }

  /* Header actions: full width */
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* Stats row: 2 columns */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Dashboard: single column */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .main-chart-card { grid-column: span 1; }

  /* Admin: stack panels */
  .admin-grid { grid-template-columns: 1fr; }

  /* Web analytics split: single column */
  .web-analytics-split { grid-template-columns: 1fr; }

  /* Cases toolbar: stack search + filters */
  .cases-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box { max-width: 100%; }
  .filter-group { flex-wrap: wrap; }
  .filter-group select { flex: 1 1 140px; }

  /* Case cards: 2 columns */
  .cases-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Comparison banner: stack */
  .comparison-banner {
    flex-direction: column;
    text-align: center;
  }

  /* Chat drawer: wider on tablet */
  .chat-drawer {
    width: calc(100vw - 48px);
    right: 24px;
  }
}

/* ── 768px: Tablet Portrait ─────────────────────────────── */
@media (max-width: 768px) {

  /* App container tighter */
  .app-container { padding: 12px; }

  /* Header: tighter */
  .app-header { padding: 12px 14px; gap: 10px; }

  /* Logo: smaller */
  .header-logo-img { height: 36px; }
  .logo-text h1 { font-size: 16px; }
  .logo-text span { font-size: 10px; }

  /* Stats row: 2 columns, smaller */
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; gap: 12px; }
  .stat-val { font-size: 20px; }
  .stat-icon { width: 40px; height: 40px; }

  /* Case cards: single column */
  .cases-grid { grid-template-columns: 1fr; }
  .case-card { padding: 20px; }
  .case-card h3 { font-size: 15px; height: auto; }

  /* Charts: shorter on mobile */
  .chart-container, .chart-container-donut { height: 220px; }

  /* Dashboard card: reduce padding */
  .dashboard-card { padding: 18px 16px; }

  /* Pillars grid: single column */
  .pillars-grid { grid-template-columns: 1fr; }

  /* Modal: full-width, tighter padding */
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal-card {
    max-width: 100%;
    border-radius: 20px 20px 12px 12px;
    padding: 24px 20px;
  }
  .modal-body { max-height: 55vh; }
  .modal-header h2 { font-size: 18px; }
  .modal-meta { flex-wrap: wrap; gap: 10px; font-size: 12px; }

  /* Auth modal */
  .auth-card { padding: 24px 20px; }

  /* Web metrics: 2 cols */
  .web-analytics-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .web-metric-val { font-size: 22px; }

  /* FAB: smaller on mobile */
  .fab-chat {
    padding: 12px 18px;
    font-size: 13px;
    bottom: 16px;
    right: 16px;
  }

  /* Chat drawer: full-screen on tablet portrait */
  .chat-drawer {
    width: calc(100vw - 32px);
    height: 75vh;
    bottom: 72px;
    right: 16px;
    border-radius: 20px;
  }

  /* Message bubbles: wider */
  .message { max-width: 92%; }

  /* Forex widget */
  .forex-rate-box { padding: 10px; }

  /* Footer disclaimer */
  .footer-disclaimer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 16px;
  }
  .footer-disclaimer p { text-align: center; }

  /* Header status pill: hide text, show dot only */
  .header-status span:last-child { display: none; }
}

/* ── 480px: Mobile ──────────────────────────────────────── */
@media (max-width: 480px) {

  /* App container: minimal padding */
  .app-container { padding: 10px 10px 80px; }

  /* Header: compact */
  .app-header { padding: 10px 12px; gap: 8px; }
  .logo-text h1 { font-size: 14px; }
  .logo-text span { display: none; }   /* hide subtitle on tiny screens */

  /* Nav tabs: icon-only on tiny screens */
  .nav-tab { padding: 8px 10px; gap: 4px; font-size: 12px; }
  .nav-tab span { display: none; }     /* hide text label, keep icon */

  /* Stats: single column */
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 12px; flex-direction: row; gap: 10px; }
  .stat-val { font-size: 18px; }
  .stat-lbl { font-size: 10px; }
  .stat-icon { width: 36px; height: 36px; flex-shrink: 0; }

  /* Charts: compact */
  .chart-container, .chart-container-donut { height: 180px; }

  /* Dashboard card */
  .dashboard-card { padding: 14px 12px; border-radius: 16px; }
  .card-header h3 { font-size: 15px; }

  /* Cases */
  .cases-grid { grid-template-columns: 1fr; gap: 14px; }
  .case-card { padding: 16px; border-radius: 14px; }
  .case-card h3 { font-size: 14px; }
  .case-card p { font-size: 12px; }
  .cases-toolbar { padding: 12px; gap: 10px; border-radius: 12px; }
  .filter-group { gap: 8px; }
  .filter-group select { font-size: 12px; padding: 10px 12px; }
  .search-box input { font-size: 13px; padding: 10px 12px 10px 38px; }

  /* Web analytics: single column */
  .web-analytics-grid { grid-template-columns: 1fr; gap: 10px; }
  .web-metric-card { padding: 16px; }
  .web-metric-val { font-size: 20px; }

  /* Pillar cards */
  .pillar-card { padding: 16px; border-radius: 14px; }

  /* Modal: full-screen bottom sheet */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-card {
    border-radius: 20px 20px 0 0;
    padding: 20px 16px 28px;
    max-height: 90vh;
  }
  .modal-body { max-height: 50vh; }
  .modal-header h2 { font-size: 16px; }
  .modal-close-btn { top: 16px; right: 16px; }
  .modal-section p { font-size: 13px; }

  /* Auth modal */
  .auth-card { border-radius: 20px 20px 0 0; padding: 20px 16px; }

  /* Chat FAB: smaller, round icon only */
  .fab-chat {
    padding: 14px;
    border-radius: 50%;
    font-size: 0;          /* hide text */
    width: 52px;
    height: 52px;
    gap: 0;
    bottom: 14px;
    right: 14px;
  }
  .fab-chat i { width: 22px; height: 22px; }

  /* Chat drawer: full-screen */
  .chat-drawer {
    width: 100vw;
    height: 85vh;
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: 20px 20px 0 0;
  }

  /* Messages */
  .message { max-width: 96%; }
  .message-content { padding: 12px 14px; font-size: 13.5px; }
  .chat-welcome h2 { font-size: 18px; }
  .chat-welcome p { font-size: 12.5px; }
  .suggested-query-btn { font-size: 12px; padding: 10px 12px; }

  /* Chat input */
  .chat-input-wrapper textarea { font-size: 13px; }
  .chat-disclaimer { font-size: 10px; }

  /* Admin panel */
  .admin-table th, .admin-table td { padding: 10px 12px; font-size: 12px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .upload-zone { padding: 28px 16px; }

  /* User session info: compact */
  .user-session-info { padding: 5px 8px; gap: 6px; }
  .user-name-lbl { font-size: 12px; }

  /* Header status: icon only */
  .header-status { padding: 6px 10px; font-size: 11px; }

  /* Comparison banner */
  .comparison-banner { padding: 14px; gap: 12px; }

  /* Footer */
  .app-footer { padding: 20px 0 12px; gap: 12px; }
  .footer-copyright { font-size: 10px; }
}

/* ── 360px: Small Mobile (compact phones) ───────────────── */
@media (max-width: 360px) {

  .app-container { padding: 8px 8px 80px; }

  /* Stats: single full-width column */
  .stats-row { grid-template-columns: 1fr; }
  .stat-card { padding: 12px; }

  .nav-tab { padding: 7px 8px; }

  .chat-drawer { height: 90vh; }

  .modal-card { padding: 18px 14px 24px; }

  .cases-grid { gap: 10px; }
  .case-card { padding: 14px; }

  .web-analytics-grid { gap: 8px; }

  .fab-chat {
    width: 48px;
    height: 48px;
    bottom: 12px;
    right: 12px;
  }
}

/* ── Web Source Links Styles ─────────────────────────── */
.news-source-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.news-source-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.web-metric-card-source {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 10px;
  margin-left: auto;
  padding: 2px 6px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
}

.web-metric-card-source:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.3);
  text-decoration: none;
  color: var(--text-main);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.modal-source-link {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.modal-source-link:hover {
  text-decoration: underline;
  color: var(--text-main);
}

