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

:root {
  --bg-body: #08090b;
  --bg-card: rgba(16, 18, 22, 0.75);
  --bg-card-hover: rgba(24, 27, 34, 0.85);
  --bg-panel: #0d0f13;
  --bg-subtle: rgba(255, 255, 255, 0.03);

  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-gold: rgba(197, 160, 89, 0.25);
  --border-gold-strong: rgba(197, 160, 89, 0.5);

  --gold: #c5a059;
  --gold-light: #dfb76c;
  --gold-dark: #917232;
  --gold-glow: rgba(197, 160, 89, 0.15);

  --jade: #10b981;
  --jade-bg: rgba(16, 185, 129, 0.08);
  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.08);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-gold: #c5a059;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-serif: 'Cinzel', serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(197, 160, 89, 0.06), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(16, 185, 129, 0.03), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.dashboard-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px 32px;
}

/* Masthead / Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 20px;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1f242d, #0d0f13);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-title h1 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-transform: uppercase;
}

.brand-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.badge-halal {
  background: rgba(197, 160, 89, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-brokerage {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}

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

/* Controls */
.controls-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.currency-toggle-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0f1115;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
}

.currency-toggle {
  display: flex;
  gap: 2px;
}

.curr-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.curr-btn.active {
  background: var(--gold);
  color: #000;
  font-weight: 700;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.06);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--jade);
  letter-spacing: 1px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--jade);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--jade);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.6; transform: scale(0.9); }
}

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Institutional Brokerage Summary */
.brokerage-summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.brokerage-meta {
  display: flex;
  gap: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.brokerage-id .label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.brokerage-id .val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
  color: #fff;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 18px 20px;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: rgba(197, 160, 89, 0.3);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  margin: 10px 0 4px;
  letter-spacing: -0.5px;
}

.stat-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.text-dim { color: var(--text-muted); }
.text-emerald { color: var(--jade); }
.text-crimson { color: var(--rose); }
.text-gold { color: var(--gold-light); }

.badge-deploy {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-light);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Tabs */
.tab-container {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 24px;
}

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

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

.tab-btn.active {
  color: #fff;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Panels */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.regime-panel {
  margin-bottom: 24px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid rgba(197, 160, 89, 0.2);
  background: rgba(197, 160, 89, 0.03);
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-target {
  background: rgba(16, 185, 129, 0.12);
  color: var(--jade);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-be {
  background: rgba(197, 160, 89, 0.12);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

.badge-open {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 2.8fr 1.2fr;
  gap: 22px;
}

@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* Table */
.table-wrapper {
  overflow-x: auto;
}

.brokerage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.brokerage-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
}

.brokerage-table td {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
  vertical-align: middle;
}

.brokerage-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.rules-box {
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
  border-top: 1px solid var(--border-hairline);
  padding-top: 14px;
}

/* End-of-Day Tickers */
.market-ticker-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.ticker-box {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.ticker-sym {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-light);
}

.ticker-name {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.ticker-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
}

.eod-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-hairline);
}

.highlight-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

.h-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.8px;
}

.h-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

.eod-positions-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.eod-pos-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eod-pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.eod-pos-sym {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.eod-pos-action {
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Security PIN Gate */
.pin-gate-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #060709;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 24px;
}

.pin-box {
  background: #0c0e12;
  border: 1px solid var(--border-gold);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border-radius: 14px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.pin-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #1a1e26, #0e1014);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gold);
  margin: 0 auto 18px;
  box-shadow: 0 4px 20px rgba(197, 160, 89, 0.15);
}

.pin-input {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 22px;
  text-align: center;
  letter-spacing: 12px;
  margin: 16px 0;
  outline: none;
}

.pin-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}

.pin-btn {
  width: 100%;
  padding: 12px;
  background: var(--gold);
  border: none;
  border-radius: 6px;
  color: #000;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 8px;
  transition: filter 0.2s;
}

.pin-btn:hover { filter: brightness(1.1); }

.pin-error {
  color: var(--rose);
  font-size: 12px;
  margin-top: 10px;
  min-height: 18px;
}
