/* ===================================================
   IPO TRACKER INDONESIA — Design System & Styles
   =================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* --- CSS Variables (Design Tokens) --- */
:root {
  /* Colors */
  --bg-primary: #0a0e17;
  --bg-surface: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2b3d;
  --bg-elevated: #243044;
  --bg-input: #0f1724;

  --accent-primary: #00d4aa;
  --accent-primary-dim: rgba(0, 212, 170, 0.15);
  --accent-primary-glow: rgba(0, 212, 170, 0.3);
  --accent-secondary: #6366f1;
  --accent-secondary-dim: rgba(99, 102, 241, 0.15);
  --accent-gold: #f59e0b;
  --accent-gold-dim: rgba(245, 158, 11, 0.15);

  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverse: #0a0e17;

  --success: #10b981;
  --success-dim: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-dim: rgba(59, 130, 246, 0.15);

  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(0, 212, 170, 0.3);

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --header-height: 70px;
  --sidebar-width: 300px;
  --max-width: 1440px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background: radial-gradient(ellipse at 30% 0%, rgba(0, 212, 170, 0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #33e0be;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================================================
   HEADER
   =================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-brand .logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.18), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(0, 212, 170, 0.35);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0, 212, 170, 0.12);
}

.brand-logo-svg {
  width: 30px;
  height: 30px;
}

.brand-logo-svg rect {
  fill: rgba(0, 212, 170, 0.12);
}

.brand-logo-svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-brand h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.header-brand h1 span {
  color: var(--accent-primary);
}

.brand-copy p {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--accent-primary);
}

.header-nav .admin-link {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.header-nav .admin-link:hover {
  border-color: var(--accent-primary);
  background: var(--accent-primary-dim);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
}

/* ===================================================
   DASHBOARD STATS
   =================================================== */
.dashboard {
  padding: var(--space-2xl) 0;
  position: relative;
  z-index: 1;
}

.dashboard-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.03em;
}

.dashboard-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-xl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--accent-primary), #00e6b8); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--accent-secondary), #818cf8); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--accent-gold), #fbbf24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--success), #34d399); }

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

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

.stat-card:nth-child(1) .stat-icon { background: var(--accent-primary-dim); color: var(--accent-primary); }
.stat-card:nth-child(2) .stat-icon { background: var(--accent-secondary-dim); color: var(--accent-secondary); }
.stat-card:nth-child(3) .stat-icon { background: var(--accent-gold-dim); color: var(--accent-gold); }
.stat-card:nth-child(4) .stat-icon { background: var(--success-dim); color: var(--success); }

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.03em;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ===================================================
   MAIN CONTENT LAYOUT
   =================================================== */
.main-content {
  display: flex;
  gap: var(--space-lg);
  padding-bottom: var(--space-3xl);
  position: relative;
  z-index: 1;
}

/* --- Filter Sidebar --- */
.filter-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  max-height: calc(100vh - var(--header-height) - var(--space-2xl));
  overflow-y: auto;
  padding-right: var(--space-sm);
}

.filter-sidebar::-webkit-scrollbar {
  width: 4px;
}

.filter-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.filter-section-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.filter-section-title i {
  font-size: 1rem;
  color: var(--accent-primary);
}

/* Search input */
.search-wrapper {
  position: relative;
  margin-bottom: var(--space-lg);
}

.search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

/* Filter checkbox group */
.filter-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.filter-checkbox:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color-hover);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.filter-checkbox input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.filter-checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: var(--text-inverse);
  font-weight: 700;
}

.filter-checkbox .count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Filter select */
.filter-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

.filter-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Multi-select dropdown */
.multi-select-wrapper {
  position: relative;
}

.multi-select-trigger {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
  min-height: 42px;
}

.multi-select-trigger:hover {
  border-color: var(--border-color-hover);
}

.multi-select-trigger.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

.multi-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 250px;
  overflow-y: auto;
  display: none;
}

.multi-select-dropdown.open {
  display: block;
  animation: slideDown 200ms ease;
}

.multi-select-dropdown .filter-checkbox {
  padding: 8px 12px;
}

.multi-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.multi-select-tag {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* Price range slider */
.price-range-wrapper {
  padding: 0 var(--space-xs);
}

.price-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.price-range-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-top: var(--space-sm);
}

input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Toggle switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.toggle-switch .toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: white;
}

/* Filter actions */
.filter-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.btn-clear-filters {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear-filters:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-dim);
}

/* Active filter badges */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.active-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-primary-dim);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 500;
}

.active-filter-badge button {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.active-filter-badge button:hover {
  opacity: 1;
}

/* ===================================================
   DATA TABLE AREA
   =================================================== */
.data-area {
  flex: 1;
  min-width: 0;
}

/* Tabs */
.tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-weight: 600;
}

.tab-btn .tab-count {
  margin-left: 6px;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Sort dropdown */
.sort-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sort-wrapper label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-select {
  padding: 8px 32px 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* Results info */
.results-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.results-info strong {
  color: var(--text-primary);
}

/* IPO Cards Grid */
.ipo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

/* IPO Card */
.ipo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.ipo-card:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.ipo-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.ipo-card-info {
  flex: 1;
  min-width: 0;
}

.ipo-card-code {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
}

.ipo-card-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ipo-card-sector {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.status-bookBuilding { background: var(--accent-secondary-dim); color: var(--accent-secondary); }
.status-badge.status-bookBuilding::before { background: var(--accent-secondary); }

.status-badge.status-offering { background: var(--warning-dim); color: var(--warning); }
.status-badge.status-offering::before { background: var(--warning); }

.status-badge.status-preEffective { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-badge.status-preEffective::before { background: #8b5cf6; }

.status-badge.status-closed { background: var(--success-dim); color: var(--success); }
.status-badge.status-closed::before { background: var(--success); }

.status-badge.status-postponed { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.status-badge.status-postponed::before { background: #94a3b8; }

.status-badge.status-canceled { background: var(--danger-dim); color: var(--danger); }
.status-badge.status-canceled::before { background: var(--danger); }

/* IPO Card Details Row */
.ipo-card-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}

.ipo-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ipo-detail-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.ipo-detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

.ipo-detail-value.price {
  color: var(--accent-gold);
}

/* IPO Card Footer */
.ipo-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.ipo-card-underwriter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ipo-card-underwriter i {
  color: var(--accent-primary);
}

.ipo-card-tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.tag {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


.tag-syariah {
  background: var(--success-dim);
  color: var(--success);
}

.tag-waran {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
}

/* ===================================================
   PAGINATION
   =================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding: var(--space-lg) 0;
}

.pagination button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-primary-dim);
}

.pagination button.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-inverse);
  font-weight: 700;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 var(--space-sm);
}

/* ===================================================
   DETAIL MODAL
   =================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header-info h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.02em;
}

.modal-header-info h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 4px;
}

.modal-header-info .modal-sector {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: var(--danger);
}

.modal-body {
  padding: var(--space-xl);
}

.modal-section {
  margin-bottom: var(--space-xl);
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-field.full-width {
  grid-column: 1 / -1;
}

.modal-field-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-field-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.modal-field-value.highlight {
  color: var(--accent-primary);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.modal-field-value.price {
  color: var(--accent-gold);
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Timeline in modal */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding: var(--space-sm) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 4px);
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--text-muted);
  z-index: 1;
}

.timeline-item.completed::before {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.timeline-item.active::before {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.timeline-item-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 120px;
}

.timeline-item.completed .timeline-item-label {
  color: var(--text-secondary);
}

.timeline-item.active .timeline-item-label {
  color: var(--accent-gold);
  font-weight: 600;
}

.timeline-item-date {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Underwriter list in modal */
.underwriter-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.underwriter-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.underwriter-item .uw-code {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-secondary);
  font-size: 0.85rem;
  background: var(--accent-secondary-dim);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
}

.underwriter-item .uw-name {
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ===================================================
   STATISTICS SECTION
   =================================================== */
.stats-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.stats-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.stats-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.chart-card h3 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-secondary);
}

/* Bar chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bar-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.bar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 130px;
  min-width: 130px;
  flex-shrink: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0;
  font-size: 0;
  color: transparent;
  transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill.primary { background: linear-gradient(90deg, var(--accent-primary), #33e0be); }
.bar-fill.secondary { background: linear-gradient(90deg, var(--accent-secondary), #818cf8); }
.bar-fill.gold { background: linear-gradient(90deg, var(--accent-gold), #fbbf24); }
.bar-fill.success { background: linear-gradient(90deg, var(--success), #34d399); }
.bar-fill.danger { background: linear-gradient(90deg, var(--danger), #f87171); }
.bar-fill.info { background: linear-gradient(90deg, var(--info), #60a5fa); }

.bar-value {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 30px;
  font-weight: 600;
}

/* ===================================================
   EMPTY STATE
   =================================================== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.3;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===================================================
   LOADING SKELETON
   =================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================================================
   FOOTER
   =================================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: var(--space-xl) 0;
  position: relative;
  z-index: 1;
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--accent-primary);
}

.footer-update {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.footer-update .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

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

/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-lg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  animation: slideInRight 300ms ease;
  min-width: 280px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }

.toast-icon {
  font-size: 1.2rem;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.animate-in {
  animation: fadeIn 400ms ease forwards;
}

.ipo-card {
  animation: fadeIn 300ms ease forwards;
}

/* ===================================================
   MOBILE RESPONSIVE
   =================================================== */

/* Tablet & below */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    flex-direction: column;
  }

  .filter-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .filter-sidebar-inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .filter-section {
    margin-bottom: 0;
  }

  .stats-charts {
    grid-template-columns: 1fr;
  }

  /* Collapsible filters on mobile */
  .filter-toggle-btn {
    display: flex;
  }

  .filter-sidebar.collapsed .filter-sidebar-inner {
    display: none;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .header-brand h1 {
    font-size: 1rem;
  }

  .brand-copy p {
    display: none;
  }

  .header-nav .nav-text {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .stat-card .stat-label {
    font-size: 0.7rem;
  }

  .dashboard-title {
    font-size: 1.3rem;
  }

  .filter-sidebar-inner {
    grid-template-columns: 1fr;
  }

  .tabs-header {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .ipo-card-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal {
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }

  .modal-overlay {
    padding: var(--space-sm);
  }

  .modal-header {
    padding: var(--space-lg);
  }

  .modal-body {
    padding: var(--space-lg);
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  .pagination button {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-bottom: var(--space-sm);
  }

  .ipo-card-header {
    flex-direction: column;
  }

  .ipo-card-details {
    grid-template-columns: 1fr 1fr;
  }

  .ipo-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===================================================
   FILTER TOGGLE BUTTON (mobile)
   =================================================== */
.filter-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: var(--space-md);
  transition: all var(--transition-fast);
}

.filter-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.filter-toggle-btn i {
  transition: transform var(--transition-fast);
}

.filter-toggle-btn.active i {
  transform: rotate(180deg);
}

/* ===================================================
   PER-PAGE SELECTOR
   =================================================== */
.per-page-selector {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.per-page-selector select {
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

/* ===================================================
   ANTRIAN INFO (IPO Queue)
   =================================================== */
.antrian-info {
  margin-top: 16px;
  padding: 12px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
}

.antrian-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #818cf8;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.antrian-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.antrian-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.antrian-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.antrian-oversub {
  color: #f59e0b;
}

.antrian-dapat {
  color: var(--accent-primary);
  font-size: 1rem;
}

/* Detail page antrian section */
.detail-antrian-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.detail-antrian-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.detail-antrian-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-antrian-value {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.detail-antrian-value.highlight {
  color: var(--accent-primary);
}

.detail-antrian-value.warning {
  color: #f59e0b;
}

.detail-antrian-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
