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

/* ═══════════════════════════════════════════
   BASE & THEME OVERRIDES
═══════════════════════════════════════════ */
:root {
  --pse-primary: #4f46e5;
  --pse-primary-light: #818cf8;
  --pse-primary-ultra: #eef2ff;
  --pse-accent: #06b6d4;
  --pse-success: #10b981;
  --pse-error: #f43f5e;
  --pse-gold: #f59e0b;
  --pse-surface: #ffffff;
  --pse-surface-2: #f8faff;
  --pse-surface-3: #f1f5f9;
  --pse-border: rgba(99, 102, 241, 0.12);
  --pse-border-strong: rgba(99, 102, 241, 0.25);
  --pse-text: #0f172a;
  --pse-text-2: #475569;
  --pse-text-3: #94a3b8;
  --pse-shadow-sm: 0 1px 3px rgba(79,70,229,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --pse-shadow: 0 4px 16px rgba(79,70,229,0.12), 0 1px 4px rgba(0,0,0,0.06);
  --pse-shadow-lg: 0 8px 32px rgba(79,70,229,0.16), 0 2px 8px rgba(0,0,0,0.08);
  --pse-glow: 0 0 20px rgba(79,70,229,0.25);
  --pse-radius: 14px;
  --pse-radius-sm: 8px;
  --pse-radius-lg: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 40%, #f0fffe 100%);
  background-attachment: fixed;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  color: var(--pse-text);
}

body::before {
  content: '';
  position: fixed;
  top: -40%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(56,189,248,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  left: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-xl.font-bold,
h1.text-xl {
  font-size: 1.6rem !important;
  background: linear-gradient(135deg, var(--pse-primary) 0%, var(--pse-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-2xl.font-bold {
  font-size: 1.75rem !important;
  background: linear-gradient(135deg, var(--pse-primary) 0%, var(--pse-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Monospace for numbers */
.font-mono {
  font-family: 'DM Mono', monospace !important;
  font-size: 0.92em;
}

/* ═══════════════════════════════════════════
   NAVBAR — Glassmorphism
═══════════════════════════════════════════ */
.navbar {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--pse-border);
  box-shadow: 0 1px 0 rgba(99,102,241,0.08), var(--pse-shadow-sm);
  padding: 0.5rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .text-lg.font-bold {
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, var(--pse-primary) 0%, var(--pse-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.navbar .btn-ghost {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--pse-text-2) !important;
  border-radius: var(--pse-radius-sm) !important;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.navbar .btn-ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(6,182,212,0.08));
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
}

.navbar .btn-ghost:hover {
  background: transparent !important;
  color: var(--pse-primary) !important;
}

.navbar .btn-ghost:hover::before {
  opacity: 1;
}

.navbar .text-error {
  color: var(--pse-error) !important;
}

/* ═══════════════════════════════════════════
   CARDS & PANELS
═══════════════════════════════════════════ */
.card,
.card.bg-base-100 {
  background: var(--pse-surface) !important;
  border: 1px solid var(--pse-border) !important;
  border-radius: var(--pse-radius-lg) !important;
  box-shadow: var(--pse-shadow) !important;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  box-shadow: var(--pse-shadow-lg) !important;
}

.card.border.border-base-200 {
  border-color: var(--pse-border) !important;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  border-radius: var(--pse-radius-sm) !important;
  transition: all 0.2s ease !important;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pse-primary) 0%, #6366f1 100%) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(79,70,229,0.35), 0 1px 3px rgba(79,70,229,0.2) !important;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79,70,229,0.45), 0 2px 6px rgba(79,70,229,0.25) !important;
  background: linear-gradient(135deg, #4338ca 0%, var(--pse-primary) 100%) !important;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-error {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(244,63,94,0.3) !important;
}

.btn-error:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(244,63,94,0.4) !important;
}

.btn-error.btn-outline {
  background: transparent !important;
  border: 1.5px solid #f43f5e !important;
  color: #f43f5e !important;
  box-shadow: none !important;
}

.btn-error.btn-outline:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%) !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(244,63,94,0.35) !important;
}

.btn-ghost {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--pse-text-2) !important;
}

.btn-ghost:hover {
  background: var(--pse-surface-3) !important;
  border-color: var(--pse-border) !important;
  color: var(--pse-primary) !important;
}

.btn-sm {
  font-size: 0.8rem !important;
  padding: 0 0.85rem !important;
  height: 2rem !important;
  min-height: 2rem !important;
}

.btn-xs {
  font-size: 0.72rem !important;
  padding: 0 0.6rem !important;
  height: 1.6rem !important;
  min-height: 1.6rem !important;
}

/* Primary outline variant */
.btn-primary.btn-outline {
  background: transparent !important;
  border: 1.5px solid var(--pse-primary) !important;
  color: var(--pse-primary) !important;
  box-shadow: none !important;
}

.btn-primary.btn-outline:hover {
  background: linear-gradient(135deg, var(--pse-primary) 0%, #6366f1 100%) !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35) !important;
}

/* ═══════════════════════════════════════════
   INPUTS
═══════════════════════════════════════════ */
.input,
.input-bordered {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  background: var(--pse-surface) !important;
  border: 1.5px solid var(--pse-border-strong) !important;
  border-radius: var(--pse-radius-sm) !important;
  color: var(--pse-text) !important;
  font-size: 0.875rem !important;
  transition: all 0.2s ease !important;
  box-shadow: var(--pse-shadow-sm) !important;
}

.input:focus,
.input-bordered:focus {
  outline: none !important;
  border-color: var(--pse-primary) !important;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15), var(--pse-shadow-sm) !important;
}

.input::placeholder {
  color: var(--pse-text-3) !important;
}

/* ═══════════════════════════════════════════
   TABS
═══════════════════════════════════════════ */
.tabs-bordered {
  border-bottom: 1.5px solid var(--pse-border) !important;
  gap: 0 !important;
}

.tab {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
  color: var(--pse-text-2) !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: 0.65rem 0.9rem !important;
  transition: color 0.2s ease, border-color 0.2s ease !important;
  letter-spacing: -0.01em;
  background: transparent !important;
  white-space: nowrap !important;
  flex: none !important;
}

.tab:hover {
  color: var(--pse-primary) !important;
  background: transparent !important;
  border-radius: 0 !important;
  border-bottom-color: rgba(79,70,229,0.25) !important;
}

.tab-active,
.tab.tab-active {
  color: var(--pse-primary) !important;
  border-bottom: 2px solid var(--pse-primary) !important;
  font-weight: 700 !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.tab-content {
  padding-top: 1.5rem;
}

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.table {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.table thead tr {
  background: var(--pse-surface-2) !important;
}

.table thead th {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  color: var(--pse-text-3) !important;
  padding: 0.65rem 0.85rem !important;
  border-bottom: 1.5px solid var(--pse-border) !important;
  background: transparent !important;
}

.table thead th:first-child {
  border-radius: var(--pse-radius-sm) 0 0 0 !important;
}

.table thead th:last-child {
  border-radius: 0 var(--pse-radius-sm) 0 0 !important;
}

.table tbody td {
  font-size: 0.875rem !important;
  padding: 0.7rem 0.85rem !important;
  border-bottom: 1px solid var(--pse-surface-3) !important;
  color: var(--pse-text) !important;
  vertical-align: middle !important;
}

.table tbody tr:last-child td {
  border-bottom: none !important;
}

.table-sm thead th {
  padding: 0.55rem 0.75rem !important;
}

.table-sm tbody td {
  padding: 0.6rem 0.75rem !important;
}

/* ═══════════════════════════════════════════
   STOCK ROWS
═══════════════════════════════════════════ */
.stock-row {
  cursor: pointer;
  transition: all 0.18s ease !important;
  border-radius: 0 !important;
}

.stock-row:hover {
  background: linear-gradient(90deg, var(--pse-primary-ultra) 0%, rgba(6,182,212,0.04) 100%) !important;
  cursor: pointer;
}

.stock-row:hover td {
  color: var(--pse-primary) !important;
  border-bottom-color: rgba(99,102,241,0.1) !important;
}

.stock-row:hover td:first-child {
  transform: translateX(3px);
}

.stock-row td:first-child {
  transition: transform 0.18s ease;
}

/* ═══════════════════════════════════════════
   BADGES
═══════════════════════════════════════════ */
.badge {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.65rem !important;
  letter-spacing: 0.02em;
  border-radius: 6px !important;
}

.badge-outline {
  border: 1.5px solid var(--pse-border-strong) !important;
  color: var(--pse-text-2) !important;
  background: transparent !important;
}

.badge-xs {
  font-size: 0.6rem !important;
  padding: 0 0.4rem !important;
  height: 1.1rem !important;
}

.badge-sm {
  font-size: 0.65rem !important;
  height: 1.35rem !important;
}

.badge-reg {
  background: linear-gradient(135deg, #dbeafe, #ede9fe) !important;
  color: #4338ca !important;
  border: none !important;
}

.badge-spcl {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #92400e !important;
  border: none !important;
}

/* ═══════════════════════════════════════════
   SECTOR HEADER
═══════════════════════════════════════════ */
.sector-header {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pse-primary) !important;
  padding: 0.55rem 1rem;
  background: var(--pse-primary-ultra);
  border-bottom: 1px solid var(--pse-border);
  border-top: 1px solid var(--pse-border);
}

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-box {
  max-width: 860px;
  width: 95vw;
  background: var(--pse-surface) !important;
  border-radius: var(--pse-radius-lg) !important;
  border: 1px solid var(--pse-border) !important;
  box-shadow: 0 20px 60px rgba(79,70,229,0.2), 0 8px 24px rgba(0,0,0,0.12) !important;
  padding: 1.5rem !important;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════
   CHART CONTAINER
═══════════════════════════════════════════ */
.chart-container {
  position: relative;
  height: 260px;
  background: var(--pse-surface-2);
  border-radius: var(--pse-radius) !important;
  border: 1px solid var(--pse-border);
  padding: 1rem;
}

/* ═══════════════════════════════════════════
   DISCLOSURE ROWS
═══════════════════════════════════════════ */
.disclosure-row {
  border-bottom: 1px solid var(--pse-surface-3);
  padding: 1rem 0;
  transition: background 0.15s ease;
}

.disclosure-row:hover {
  background: var(--pse-primary-ultra);
  padding-left: 0.5rem;
  border-radius: var(--pse-radius-sm);
  margin: 0 -0.5rem;
  padding-right: 0.5rem;
}

.disclosure-desc {
  font-size: 0.83rem;
  color: var(--pse-text-2);
  margin-top: 0.3rem;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════ */
.min-h-screen.flex.items-center {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 50%, #f0fffe 100%) !important;
  position: relative;
  overflow: hidden;
}

.min-h-screen.flex.items-center::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56,189,248,0.12) 0%, transparent 65%);
  pointer-events: none;
}

.card.w-96 {
  border: 1px solid var(--pse-border) !important;
  border-radius: var(--pse-radius-lg) !important;
  box-shadow: var(--pse-shadow-lg), 0 0 0 1px var(--pse-border) !important;
  background: rgba(255,255,255,0.9) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ═══════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════ */
.alert {
  border-radius: var(--pse-radius-sm) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}

.alert-success {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border: 1.5px solid #6ee7b7 !important;
  box-shadow: 0 4px 16px rgba(16,185,129,0.15) !important;
}

.alert-success span {
  color: #065f46 !important;
  font-weight: 600 !important;
}

.alert-error {
  background: #fff1f2 !important;
  color: #9f1239 !important;
  border: 1.5px solid #fda4af !important;
  box-shadow: 0 4px 16px rgba(244,63,94,0.15) !important;
}

.alert-error *,
.alert-error span,
.alert-error p,
.alert-error div {
  color: #9f1239 !important;
  font-weight: 600 !important;
}

/* ═══════════════════════════════════════════
   LOADING SPINNERS
═══════════════════════════════════════════ */
.loading-spinner {
  color: var(--pse-primary) !important;
}

.overflow-x-auto .tabs-bordered {
  display: flex !important;
  flex-wrap: nowrap !important;
  width: max-content !important;
  border-bottom: none !important;
}

.overflow-x-auto:has(.tabs-bordered) {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-bottom: 1.5px solid var(--pse-border) !important;
  border-radius: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}
.overflow-x-auto {
  border-radius: var(--pse-radius) !important;
  border: 1px solid var(--pse-border) !important;
  background: var(--pse-surface) !important;
  box-shadow: var(--pse-shadow-sm) !important;
  overflow: hidden !important;
}

/* ═══════════════════════════════════════════
   PRICE COLORS
═══════════════════════════════════════════ */
.text-success {
  color: var(--pse-success) !important;
  font-weight: 600;
}

.text-error {
  color: var(--pse-error) !important;
  font-weight: 600;
}

.text-primary {
  color: var(--pse-primary) !important;
}

/* ═══════════════════════════════════════════
   CHART PERIOD BUTTONS
═══════════════════════════════════════════ */
.btn.btn-xs.btn-primary {
  background: linear-gradient(135deg, var(--pse-primary) 0%, #6366f1 100%) !important;
  color: white !important;
  box-shadow: 0 2px 6px rgba(79,70,229,0.35) !important;
}

.btn.btn-xs.btn-ghost {
  color: var(--pse-text-3) !important;
  font-weight: 500 !important;
}

.btn.btn-xs.btn-ghost:hover {
  background: var(--pse-primary-ultra) !important;
  color: var(--pse-primary) !important;
}

/* ═══════════════════════════════════════════
   "SHOW MORE" LINKS
═══════════════════════════════════════════ */
button.text-xs.text-primary {
  font-weight: 600 !important;
  color: var(--pse-primary) !important;
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 0 !important;
  transition: opacity 0.15s;
}

button.text-xs.text-primary:hover {
  opacity: 0.7;
}

/* ═══════════════════════════════════════════
   ROUTER LINK HOVER (disclosures symbol)
═══════════════════════════════════════════ */
a.text-primary {
  color: var(--pse-primary) !important;
  font-weight: 700 !important;
  transition: color 0.15s;
}

a.text-primary:hover {
  color: var(--pse-accent) !important;
}

/* ═══════════════════════════════════════════
   MAIN CONTAINER
═══════════════════════════════════════════ */
main.container {
  padding-top: 2rem !important;
  padding-bottom: 3rem !important;
}

/* ═══════════════════════════════════════════
   FADE TRANSITIONS
═══════════════════════════════════════════ */
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.2s ease;
}
.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

/* ═══════════════════════════════════════════
   TOAST TRANSITIONS
═══════════════════════════════════════════ */
.fixed.top-4.right-4 {
  top: 5rem !important;
}

.toast-enter-active, .toast-leave-active {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-enter-from {
  opacity: 0;
  transform: translateX(60px) scale(0.9);
}
.toast-leave-to {
  opacity: 0;
  transform: translateX(60px) scale(0.9);
}

/* ═══════════════════════════════════════════
   SCROLLBAR STYLING
═══════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--pse-surface-3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pse-primary-light), var(--pse-accent));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pse-primary);
}

/* ═══════════════════════════════════════════
   WATCHLIST HOME — HEADER AREA
═══════════════════════════════════════════ */
.flex.items-center.justify-between.mb-6 h1 {
  font-size: 1.6rem !important;
  font-weight: 800 !important;
}

/* ═══════════════════════════════════════════
   STOCK DETAIL — BACK BUTTON
═══════════════════════════════════════════ */
.btn.btn-ghost.btn-sm {
  color: var(--pse-text-2) !important;
  font-weight: 600;
}

.btn.btn-ghost.btn-sm:hover {
  color: var(--pse-primary) !important;
  background: var(--pse-primary-ultra) !important;
}

/* ═══════════════════════════════════════════
   FINANCIAL TABLE — PERIOD HEADER
═══════════════════════════════════════════ */
.text-xs.font-semibold.text-gray-400.uppercase {
  color: var(--pse-primary) !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

/* ═══════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════ */
.text-center.py-8.text-gray-400,
.text-center.py-12.text-gray-400 {
  color: var(--pse-text-3) !important;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   CARD BODY
═══════════════════════════════════════════ */
.card-body {
  padding: 1.75rem !important;
}

/* ═══════════════════════════════════════════
   MISC TEXT COLORS
═══════════════════════════════════════════ */
.text-gray-400,
.text-gray-500 {
  color: var(--pse-text-3) !important;
}

.text-sm {
  font-size: 0.855rem !important;
}

.font-semibold {
  font-weight: 700 !important;
}

/* ═══════════════════════════════════════════
   PAGE CARD WRAPPER
═══════════════════════════════════════════ */
.page-card {
  background: var(--pse-surface);
  border: 1px solid var(--pse-border);
  border-radius: var(--pse-radius-lg);
  box-shadow: var(--pse-shadow);
  padding: 1.75rem;
}

/* Home already has its own inner card feel — remove double padding */
.page-card .card.bg-base-100 {
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
}