/* ===================================================================
   Indian Market Agents — Quant Radar & Portfolio Terminal
   Design System & Styling (Vanilla CSS)
   =================================================================== */

:root {
  --bg-main: #090d16;
  --bg-card: rgba(18, 26, 42, 0.85);
  --bg-card-hover: rgba(26, 37, 60, 0.95);
  --bg-nested: rgba(12, 18, 30, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-main: #f9fafb;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.15);
  --rose: #f43f5e;
  --rose-dim: rgba(244, 63, 94, 0.15);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.15);
  --violet: #8b5cf6;
  --violet-dim: rgba(139, 92, 246, 0.15);

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #3b82f6, #8b5cf6);
}
.glow-2 {
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, #06b6d4, #10b981);
}

/* Utility Classes */
.font-mono { font-family: var(--font-mono); }
.text-emerald { color: var(--emerald); }
.text-rose { color: var(--rose); }
.text-cyan { color: var(--cyan); }
.text-violet { color: var(--violet); }
.text-amber { color: var(--amber); }

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  font-size: 28px;
  line-height: 1;
}
.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.brand-tag {
  font-size: 0.72rem;
  color: var(--cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

/* Status Badge */
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--amber);
}
.status-badge.connected .status-dot {
  background-color: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
.status-badge.disconnected .status-dot {
  background-color: var(--rose);
}
.status-badge.checking .status-dot {
  background-color: var(--amber);
  animation: pulse 1.5s infinite;
}

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

/* Navigation Tabs */
.nav-tabs {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition);
}
.nav-tab:hover {
  color: var(--text-main);
}
.nav-tab.active {
  color: #ffffff;
  border-bottom-color: var(--primary);
}

/* Main Container */
.main-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}
.tab-content.active {
  display: block;
}

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

/* Cards & Containers */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}
.card-nested {
  background: var(--bg-nested);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

/* KPI Metric Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}
.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.kpi-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Sub-nav bar & Segmented Controls */
.sub-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}
.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.seg-btn:hover {
  color: var(--text-main);
}
.seg-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}
.badge {
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Info Banner */
.info-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.banner-icon {
  font-size: 32px;
  line-height: 1;
}
.banner-text {
  flex: 1;
}
.banner-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}
.banner-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Tables */
.table-container {
  overflow-x: auto;
  padding: 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.data-table th {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 18px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
.btn-danger {
  background: var(--rose-dim);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--rose);
}
.btn-danger:hover {
  background: var(--rose);
  color: #ffffff;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.btn-icon-only {
  padding: 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.field-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.form-row {
  display: flex;
  gap: 16px;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.inline-form {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.form-submit {
  align-self: flex-start;
  margin-top: 26px;
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
  transition: var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Switch Toggles */
.form-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .25s;
  border-radius: 26px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--emerald);
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Configuration Grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  margin-top: 18px;
}
.config-section h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

/* Cards Grid (IPO) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.ipo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.ipo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}
.ipo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ipo-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}
.tag-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-awaiting {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.tag-allotted {
  background: var(--emerald-dim);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.tag-not-allotted {
  background: var(--rose-dim);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.tag-listed {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.ipo-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 0.85rem;
}
.ipo-item-label {
  color: var(--text-dim);
  font-size: 0.74rem;
  text-transform: uppercase;
}
.ipo-item-val {
  font-weight: 600;
  color: var(--text-main);
}
.ipo-gmp-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ipo-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover {
  color: #ffffff;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Workflow Selection Cards in Modal */
.workflow-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.workflow-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  transition: var(--transition);
}
.workflow-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}
.workflow-card.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}
.wf-icon {
  font-size: 24px;
}
.wf-info strong {
  display: block;
  font-size: 0.95rem;
  color: #ffffff;
}
.wf-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* QR Code Container */
.qr-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.qr-container {
  display: inline-block;
  padding: 16px;
  background: #ffffff;
  border-radius: var(--radius-md);
  margin: 14px auto;
}
.magic-link-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.magic-link-bar input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 12px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state p {
  margin-bottom: 14px;
}

/* Search Box */
.toolbar {
  margin-bottom: 16px;
}
.search-box {
  position: relative;
  max-width: 460px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: toastSlide 0.25s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-color: var(--emerald); }
.toast.error { border-color: var(--rose); }
.toast.info { border-color: var(--primary); }

/* Global Indices & Radar Feed Styles */
.global-ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.ticker-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition);
}
.ticker-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
.ticker-name {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.ticker-val {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #ffffff;
}
.ticker-change {
  font-size: 0.82rem;
  font-weight: 600;
}

.macro-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.macro-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.macro-bias-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.macro-bias-badge.cautious {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber);
}
.macro-bias-badge.bullish {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald);
}
.macro-bias-badge.bearish {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--rose);
}
.macro-driver {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--cyan);
  padding: 12px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.radar-grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 950px) {
  .radar-grid-2 {
    grid-template-columns: 1fr;
  }
}

.headline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
  line-height: 1.5;
}
.headline-item:last-child {
  border-bottom: none;
}
.headline-bullet {
  color: var(--cyan);
  font-size: 1.2rem;
  line-height: 1;
}

.shock-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.shock-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(2px);
}

.telegram-feed-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 6px;
}
.telegram-msg-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.telegram-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.telegram-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}
.telegram-msg-card pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin: 0;
  font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .main-container {
    padding: 16px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .config-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .inline-form {
    flex-direction: column;
  }
  .form-submit {
    margin-top: 0;
    width: 100%;
  }
  .form-submit button {
    width: 100%;
  }
}

/* ==========================================================================
   Live Data Refresh Watermark & Header Badges
   ========================================================================== */
.watermark-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.status-dot.green {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Floating Watermark Pill */
.floating-watermark {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 999;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 12px rgba(56, 189, 248, 0.15);
  border-radius: 24px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.floating-watermark:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(56, 189, 248, 0.3);
}

.watermark-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.watermark-pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-glow 2s infinite ease-in-out;
}

.watermark-icon {
  font-size: 0.85rem;
}

.watermark-label {
  color: var(--text-muted);
  font-weight: 500;
}

.watermark-val {
  color: #38bdf8;
  font-weight: 700;
}

/* Watermark Tooltip */
.watermark-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 12px 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s ease;
  pointer-events: none;
  font-family: var(--font-sans);
}

.floating-watermark:hover .watermark-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip-header {
  font-weight: 700;
  font-size: 0.82rem;
  color: #38bdf8;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tooltip-row strong {
  color: var(--text-main);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-hint {
  margin-top: 8px;
  font-size: 0.7rem;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 5px;
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

@media (max-width: 768px) {
  .floating-watermark {
    bottom: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 0.72rem;
  }
  .watermark-tooltip {
    right: -10px;
    width: 250px;
  }
}
