:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #162032;
  --bg-card-hover: #1c2a42;
  --border-color: #24344d;
  --border-focus: #3b82f6;
  
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-emerald: #059669;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px 24px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}

.brand h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pro {
  font-size: 10px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #000;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.tagline {
  font-size: 12px;
  color: var(--text-muted);
}

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

.market-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border-color);
}

.market-pill .val.positive {
  color: var(--accent-green);
  font-weight: 700;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge-sentiment {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

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

/* Header Category Filter Group (Positioned directly to the left of the mobile button) */
.header-cat-filter-group {
  display: inline-flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px;
  gap: 3px;
}

.header-cat-filter-group .cat-filter-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-cat-filter-group .cat-filter-btn i {
  font-size: 12px;
}

.header-cat-filter-group .cat-filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header-cat-filter-group .cat-filter-btn.active {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #fff;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
}

@media (max-width: 640px) {
  .header-cat-filter-group {
    padding: 2px;
    gap: 2px;
  }
  .header-cat-filter-group .cat-filter-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .header-cat-filter-group .cat-btn-text {
    display: none; /* Icon-only on mobile devices for ultra-clean fit */
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-icon-round {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  font-size: 15px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: #334155;
  color: #fff;
}

.btn-success {
  background: var(--accent-emerald);
  color: white;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: var(--accent-red);
  color: white;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
}

/* Quick Stats Bar (2 Rows: 5 in Row 1, 4 in Row 2) */
.stats-overview-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.stats-row-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.stats-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .stats-row-5, .stats-row-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-live { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.icon-closing { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.icon-waiting { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.icon-listing { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.icon-profit { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

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

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-val {
  font-size: 18px;
  font-weight: 700;
}

.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-primary { color: var(--accent-blue) !important; }
.text-warning { color: var(--accent-amber) !important; }

/* Category Filter Bar (Default: Mainboard) */
.category-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.category-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-filter-group {
  display: flex;
  gap: 6px;
  background: #0f172a;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.cat-filter-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.cat-filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.cat-filter-btn.active {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.category-filter-hint {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 600;
}

/* Navigation Tabs */
.main-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-secondary);
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
}

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

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

.tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.badge-tab-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
}

/* Content Panels */
.tab-content-area {
  flex: 1;
}

.tab-panel {
  display: none;
}

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

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.panel-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.input-search {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  width: 240px;
  outline: none;
}
.input-search:focus {
  border-color: var(--border-focus);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.ipo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.ipo-card:hover {
  background: var(--bg-card-hover);
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.ipo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.ipo-name-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.ipo-symbol-tag {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.badge-cat {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.cat-mainboard { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.cat-sme { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

/* Pricing & Lot Grid */
.card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

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

.metric-value {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.highlight-lot {
  color: var(--accent-cyan);
}

/* Dates timeline */
.dates-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  font-size: 11px;
  text-align: center;
}

.date-box {
  background: #0f172a;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.date-box .d-label {
  color: var(--text-dim);
  display: block;
  font-size: 10px;
}
.date-box .d-val {
  font-weight: 600;
  color: #cbd5e1;
}

/* Subscription Bars */
.subscription-block {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.sub-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.sub-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sub-chip {
  background: #1e293b;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  display: flex;
  gap: 4px;
}
.sub-chip .c-name { color: var(--text-muted); }
.sub-chip .c-val { font-weight: 700; color: #fff; }

/* 95%+ AI Indicator Banner */
.prediction-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.pred-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pred-title {
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pred-accuracy {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.pred-values {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.est-price-box {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.est-gain-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-green);
}

.pred-verdict-line {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 4px;
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.card-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Shareholder Page Layout */
.shareholder-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px;
}

.news-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.news-headline {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.4;
}

.news-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.news-parent-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Demat Grid */
.demat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.demat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.demat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.demat-name {
  font-size: 16px;
  font-weight: 700;
}

.demat-broker-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.demat-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.demat-details span strong {
  color: #f1f5f9;
}

/* Portfolio Summary Bar */
.portfolio-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

.summary-box.highlight-profit {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border-color: rgba(16, 185, 129, 0.4);
}

.summary-box .sub-text {
  font-size: 11px;
  color: var(--text-muted);
}

.summary-box .val-text {
  font-size: 20px;
  font-weight: 800;
}

/* Data Table */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #0f172a;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.status-allotted { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-waiting { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.status-rejected { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Listing Day Special Section */
.listing-day-card {
  background: var(--bg-card);
  border: 2px solid #3b82f6;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.listing-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.listing-company-name {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.listing-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  background: #0f172a;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.listing-stat-box {
  display: flex;
  flex-direction: column;
}

.listing-stat-box .lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.listing-stat-box .val {
  font-size: 18px;
  font-weight: 800;
}

.indicator-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid var(--accent-green);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

.ind-icon {
  font-size: 28px;
  color: var(--accent-green);
}

.ind-title {
  font-size: 14px;
  font-weight: 800;
}

.ind-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.ind-signal-badge {
  background: #10b981;
  color: #000;
  font-weight: 800;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 6px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-card.modal-lg {
  max-width: 720px;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}
.btn-close:hover { color: #fff; }

.modal-body {
  padding: 20px;
}

/* Form controls */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-green);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  z-index: 2000;
  transition: all 0.3s ease;
}
.toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* ==========================================================================
   Comprehensive Responsive System (Mobile & Desktop Views)
   ========================================================================== */

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .app-container {
    padding: 14px 18px;
  }
  .stats-row-5 {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* Tablets & Large Phones (<= 900px) */
@media (max-width: 900px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .header-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .header-center {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-right {
    justify-content: flex-end;
  }
  .shareholder-layout {
    grid-template-columns: 1fr;
  }
}

/* Professional Mobile View (<= 768px) */
@media (max-width: 768px) {
  body {
    font-size: 13px;
  }

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

  /* Header Compact */
  .app-header {
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand h1 {
    font-size: 14px;
    font-weight: 800;
    gap: 6px;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
    border-radius: 6px;
  }

  .badge-pro {
    font-size: 8px;
    padding: 1px 5px;
  }

  .market-pill {
    padding: 3px 8px;
    font-size: 9.5px;
  }

  .header-right .btn-icon-round {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  /* -------------------------------------------------------------
     STATS CARDS: STRICT 3x3 GRID (Title on TOP, Value BELOW)
     ------------------------------------------------------------- */
  .stats-overview-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
    margin-bottom: 10px !important;
  }

  .stats-row-5,
  .stats-row-4 {
    display: contents !important; /* Flattens rows into 3x3 layout */
  }

  .stat-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 4px !important;
    gap: 3px !important;
    min-height: 58px !important;
    background: #111827 !important;
    border: 1px solid #1e293b !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.15s ease !important;
  }

  .stat-card:active {
    transform: scale(0.97) !important;
    border-color: #3b82f6 !important;
  }

  /* Hide bulky icon on mobile 3x3 cards */
  .stat-icon {
    display: none !important;
  }

  .stat-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 2px !important;
  }

  /* Title on TOP */
  .stat-label {
    order: 1 !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.2px !important;
    line-height: 1.15 !important;
    text-align: center !important;
    white-space: normal !important;
  }

  /* Value BELOW Title */
  .stat-val {
    order: 2 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #f1f5f9 !important;
    line-height: 1.15 !important;
    text-align: center !important;
  }

  /* Expected Net Profit Card Custom Styling */
  .stat-card[data-tab="portfolio"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.08)) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
  }

  .stat-card[data-tab="portfolio"] .stat-label {
    color: #34d399 !important;
  }

  .stat-card[data-tab="portfolio"] .stat-val {
    color: #10b981 !important;
    font-size: 12.5px !important;
  }

  /* Category Filter Bar */
  .category-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 7px 8px;
    margin-bottom: 8px;
    border-radius: 8px;
  }

  .category-filter-label {
    font-size: 10px;
    font-weight: 700;
  }

  .category-filter-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
  }

  .cat-filter-btn {
    padding: 6px 2px;
    font-size: 10.5px;
    font-weight: 700;
    justify-content: center;
    text-align: center;
    border-radius: 6px;
  }

  /* Horizontal Swipeable Pill Tabs on Mobile */
  .main-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 2px 2px 6px 2px;
    margin-bottom: 10px;
    scrollbar-width: none;
  }

  .main-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 16px;
  }

  .badge-tab-count {
    font-size: 8.5px;
    padding: 1px 5px;
    margin-left: 3px;
  }

  /* Panel Headers */
  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .panel-header h2 {
    font-size: 16px;
    font-weight: 800;
  }

  .panel-desc {
    font-size: 10px;
    line-height: 1.3;
  }

  .panel-header > div:last-child {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .panel-header .btn {
    flex: 1;
    justify-content: center;
    font-size: 11px;
    padding: 7px 10px;
    border-radius: 6px;
  }

  /* Cards Grid: 1 Column Full Width */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ipo-card {
    padding: 11px 12px;
    border-radius: 10px;
    gap: 8px;
  }

  .ipo-card-header {
    margin-bottom: 8px;
  }

  .ipo-name-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
  }

  .ipo-symbol-tag {
    font-size: 9.5px;
  }

  .badge-cat {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
  }

  /* Card Metrics Grid: 2 Columns on Mobile */
  .card-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 6px;
  }

  .metric-label {
    font-size: 8.5px;
    font-weight: 600;
    text-transform: uppercase;
  }

  .metric-value {
    font-size: 11.5px;
  }

  .metric-value.highlight-lot {
    font-size: 13.5px;
    font-weight: 800;
  }

  /* Dates Row */
  .dates-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-bottom: 8px;
  }

  .date-box {
    padding: 5px 6px;
    border-radius: 6px;
  }

  .d-label {
    font-size: 8.5px;
  }

  .d-val {
    font-size: 11px;
    font-weight: 700;
  }

  /* Subscription Block */
  .subscription-block {
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 6px;
  }

  .sub-header {
    font-size: 10.5px;
    margin-bottom: 6px;
  }

  .sub-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }

  .sub-chip {
    font-size: 9.5px;
    padding: 3px 6px;
  }

  /* Card Actions */
  .card-actions {
    display: flex;
    gap: 6px;
  }

  .card-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 11px;
    padding: 7px 6px;
    border-radius: 6px;
  }

  /* Portfolio Summary Bar on Mobile */
  .portfolio-summary-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 10px;
  }

  .portfolio-summary-bar .summary-box.highlight-profit {
    grid-column: span 2;
    text-align: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.1));
    border-color: rgba(16, 185, 129, 0.4);
  }

  .summary-box {
    padding: 8px 10px;
    border-radius: 8px;
  }

  .summary-box .sub-text {
    font-size: 8.5px;
    font-weight: 700;
  }

  .summary-box .val-text {
    font-size: 15px;
  }

  /* Table Container: Smooth horizontal touch scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
  }

  .data-table {
    min-width: 720px;
  }

  .data-table th, .data-table td {
    padding: 7px 8px;
    font-size: 11px;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal-card, .modal-lg {
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 14px;
    border-radius: 14px 14px 6px 6px;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  /* Demat Grid on Mobile */
  .demat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .demat-card {
    padding: 12px;
  }

  /* Listing Today on Mobile */
  .listing-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .indicator-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
  }
}


/* --------------------------------------------------------------------------
   DASHBOARD COMMAND CENTER & ANALYTICS STYLES
   -------------------------------------------------------------------------- */
.dashboard-analytics-card,
.demat-analytics-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-card-title i {
  font-size: 24px;
}

.dash-card-title h3 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.dash-card-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

/* Capital Stats Grid */
.capital-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.cap-stat-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s, border-color 0.2s;
}

.cap-stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.cap-stat-box.box-applied { border-left: 4px solid #38bdf8; }
.cap-stat-box.box-allotted { border-left: 4px solid #10b981; }
.cap-stat-box.box-profit { border-left: 4px solid #06b6d4; }

.cap-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cap-val {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.cap-hint {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.text-profit {
  color: #34d399 !important;
}

/* Comparative Progress Bars */
.capital-bars-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0b1120;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #1e293b;
}

.cap-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.bar-name {
  width: 140px;
  color: #94a3b8;
  font-weight: 600;
  flex-shrink: 0;
}

.cap-progress-track {
  flex: 1;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.cap-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-allotted {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.fill-yield {
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
}

.bar-percent {
  width: 50px;
  text-align: right;
  font-weight: 700;
  color: #fff;
  font-size: 12px;
}

/* Demat Charts Grid */
.demat-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.demat-chart-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.demat-chart-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

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

.demat-chart-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demat-chart-pan {
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
}

.demat-chart-body {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
}

.donut-chart-box {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-rate {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: block;
  line-height: 1;
}

.donut-center-label {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}

.demat-stats-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-allotted { background: #10b981; }
.dot-rejected { background: #ef4444; }
.dot-waiting { background: #f59e0b; }

.legend-val {
  font-weight: 700;
  color: #fff;
}

/* Page Navigation Header for Dedicated Pages */
.page-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-back-dashboard {
  background: #1e293b !important;
  color: #38bdf8 !important;
  border: 1px solid #334155 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.btn-back-dashboard:hover {
  background: #334155 !important;
  color: #fff !important;
  border-color: #38bdf8 !important;
}

.page-nav-breadcrumb {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-nav-breadcrumb strong {
  color: #fff;
}

/* Multi-Tranche Sales Manager Modal */
.sales-manager-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: #0f172a;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  margin-bottom: 16px;
}

.sales-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sales-stat-item .label {
  font-size: 11px;
  color: #94a3b8;
}

.sales-stat-item .val {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.sales-add-form {
  background: #162032;
  border: 1px dashed #38bdf8;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.sales-add-form h4 {
  font-size: 13px;
  color: #38bdf8;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sales-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: flex-end;
}

.sales-tranches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}

.sales-tranches-table th {
  background: #0f172a;
  color: #94a3b8;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}

.sales-tranches-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #162032;
  color: #e2e8f0;
}

@media (max-width: 768px) {
  .capital-stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cap-val {
    font-size: 18px;
  }
  .demat-charts-grid {
    grid-template-columns: 1fr;
  }
  .sales-manager-summary {
    grid-template-columns: 1fr 1fr;
  }
  .sales-inputs-row {
    grid-template-columns: 1fr;
  }
}

/* ===================================================
   ANALYSIS & PERFORMANCE DASHBOARD STYLES
   =================================================== */
.analysis-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.analysis-header-content {
  flex: 1;
  min-width: 250px;
}
.analysis-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
#btnDownloadAnalysisPDF {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}
#btnDownloadAnalysisPDF:hover {
  background: linear-gradient(135deg, #0369a1, #0891b2);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.45);
}
.analysis-header-box h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.analysis-header-box p {
  color: #94a3b8;
  font-size: 13px;
  margin: 0;
}

.analysis-filter-bar {
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.analysis-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.analysis-toggle-group {
  display: flex;
  background: #090e17;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  gap: 2px;
}
.analysis-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.analysis-toggle-btn.active {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}
.analysis-select {
  background: #090e17;
  border: 1px solid #1e293b;
  color: #f1f5f9;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.analysis-select:focus {
  border-color: #38bdf8;
}

.analysis-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.analysis-kpi-card {
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.analysis-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #10b981);
}
.analysis-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.analysis-kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.analysis-kpi-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 500;
}

.analysis-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.analysis-chart-card {
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.analysis-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1e293b;
}
.analysis-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}
.analysis-chart-subtitle {
  font-size: 11px;
  color: #94a3b8;
}
.chart-canvas-container {
  position: relative;
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Gauge Chart Box */
.gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 0;
  width: 100%;
}
.gauge-svg {
  width: 240px;
  height: 130px;
}
.gauge-center-text {
  text-align: center;
  margin-top: -24px;
}
.gauge-pct-val {
  font-size: 28px;
  font-weight: 900;
  color: #10b981;
  display: block;
  line-height: 1;
}
.gauge-desc {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 4px;
}
.gauge-pills {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  font-size: 11px;
}
.gauge-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
}

/* Decomposition Tree */
.decomp-container {
  overflow-x: auto;
  padding: 12px 0 6px 0;
}
.decomp-tree-flow {
  display: flex;
  align-items: stretch;
  gap: 20px;
  min-width: 820px;
}
.decomp-level-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.decomp-col-header {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.decomp-node-box {
  background: #090e17;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: all 0.2s ease;
}
.decomp-node-box:hover {
  border-color: #38bdf8;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.decomp-node-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.decomp-node-amt {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
}
.decomp-node-meta {
  font-size: 11px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.decomp-node-profit {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
}

/* Detailed Matrix Table */
.analysis-table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #1e293b;
}
.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.analysis-table th {
  background: #090e17;
  color: #94a3b8;
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid #1e293b;
  text-transform: uppercase;
  font-size: 11px;
}
.analysis-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #162032;
  color: #e2e8f0;
}
.analysis-table tr:hover td {
  background: rgba(30, 41, 59, 0.4);
}

/* PDF & Print Formatting for Analysis Report */
@media print {
  body {
    background: #090e17 !important;
    color: #f1f5f9 !important;
  }
  .app-header, .main-tabs, .header-cat-filter-group, #btnDownloadAnalysisPDF, .analysis-select, .analysis-toggle-group, .btn {
    display: none !important;
  }
  .analysis-page-wrapper {
    width: 100% !important;
    padding: 0 !important;
  }
  .analysis-kpi-grid, .analysis-charts-row, .decomp-container, .analysis-table-container {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

.analysis-pdf-page {
  margin-bottom: 24px;
}
.analysis-pdf-page:last-child {
  margin-bottom: 0;
}

.analysis-kpi-grid, .analysis-charts-row, .decomp-container, .analysis-table-container {
  break-inside: avoid;
}

/* ===================================================
   AUTHENTICATION & PROFILE STYLES
   =================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: authFadeIn 0.3s ease;
}

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

.auth-header {
  padding: 24px 24px 16px 24px;
  text-align: center;
  border-bottom: 1px solid #1e293b;
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.08), transparent);
}

.auth-nav-tabs {
  display: flex;
  background: #090e17;
  border-bottom: 1px solid #1e293b;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.auth-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}
.auth-tab-btn:hover:not(.active) {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.02);
}

.auth-body {
  padding: 22px 24px;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input-wrapper input {
  padding-right: 40px;
}
.btn-toggle-eye {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  transition: color 0.2s ease;
}
.btn-toggle-eye:hover {
  color: #38bdf8;
}

.header-user-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-pill-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #111a2e;
  border: 1px solid #1e293b;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-pill-badge:hover {
  border-color: #38bdf8;
  background: #162238;
}

.profile-card {
  border: 1.5px solid #0284c7 !important;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), #111a2e) !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.2) !important;
}

