:root {
  --libstox-dark: #0E5C4A;
  --libstox-green: #1F8B6B;
  --libstox-light: #4CAF7A;
  --libstox-orange: #F7931E;
  --libstox-white: #FFFFFF;
  --libstox-bg: #F6FAF8;
  --libstox-ink: #10231F;
  --libstox-muted: #63746F;
  --libstox-line: rgba(14, 92, 74, .14);
  --libstox-shadow: 0 14px 35px rgba(14, 92, 74, .12);
  --libstox-shadow-hover: 0 20px 40px rgba(0, 0, 0, .12);
}

* {
  letter-spacing: 0;
}

body.libstox-theme,
.libstox-theme {
  min-height: 100vh;
  color: var(--libstox-ink);
  background: var(--libstox-bg);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
}

.libstox-theme h1,
.libstox-theme h2,
.libstox-theme h3,
.libstox-theme h4,
.libstox-theme h5,
.libstox-theme h6 {
  color: var(--libstox-ink);
  font-weight: 700;
}

.libstox-theme a {
  color: var(--libstox-green);
}

.libstox-theme a:hover {
  color: var(--libstox-orange);
}

.brand-navbar,
.navbar.brand-navbar {
  background: var(--libstox-dark) !important;
  box-shadow: 0 14px 30px rgba(14, 92, 74, .22);
}

.brand-navbar .navbar-brand,
.brand-navbar .nav-link,
.brand-navbar .admin-profile {
  color: var(--libstox-white) !important;
}

.brand-navbar .nav-link {
  border-radius: 999px;
  font-weight: 600;
  padding: .55rem .9rem !important;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.brand-navbar .nav-link:hover,
.brand-navbar .nav-link.active {
  color: var(--libstox-orange) !important;
  background: rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}

.brand-logo {
  width: 64px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--libstox-white);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.brand-wordmark {
  color: var(--libstox-white);
  font-size: 1.25rem;
  font-weight: 700;
}

.btn {
  border-radius: 12px;
  font-weight: 600;
  overflow: hidden;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary,
.btn-success,
.libstox-btn-primary {
  background: linear-gradient(135deg, var(--libstox-green), var(--libstox-light)) !important;
  border-color: var(--libstox-green) !important;
  color: var(--libstox-white) !important;
  box-shadow: 0 12px 24px rgba(31, 139, 107, .24);
}

.btn-primary:hover,
.btn-success:hover,
.libstox-btn-primary:hover {
  background: linear-gradient(135deg, var(--libstox-dark), var(--libstox-green)) !important;
  border-color: var(--libstox-orange) !important;
  box-shadow: 0 0 0 4px rgba(247, 147, 30, .16), 0 16px 30px rgba(247, 147, 30, .25);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-secondary,
.btn-outline-dark,
.libstox-btn-secondary {
  background: var(--libstox-white) !important;
  border-color: var(--libstox-green) !important;
  color: var(--libstox-green) !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-secondary:hover,
.btn-outline-dark:hover,
.libstox-btn-secondary:hover {
  background: rgba(31, 139, 107, .08) !important;
  border-color: var(--libstox-orange) !important;
  color: var(--libstox-dark) !important;
  box-shadow: 0 0 0 4px rgba(247, 147, 30, .12);
}

.brand-navbar .btn-outline-light {
  border-color: rgba(255, 255, 255, .72);
  color: var(--libstox-white);
}

.brand-navbar .btn-outline-light:hover {
  background: var(--libstox-orange);
  border-color: var(--libstox-orange);
  color: var(--libstox-white);
}

.libstox-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, .5);
  transform: scale(0);
  animation: libstoxRipple .7s ease-out;
}

@keyframes libstoxRipple {
  to {
    opacity: 0;
    transform: scale(4);
  }
}

.brand-card,
.feature-card,
.summary-card,
.category-card,
.market-card,
.panel,
.auth-card,
.libstox-theme .card {
  border: 1px solid var(--libstox-line) !important;
  border-radius: 16px !important;
  background: var(--libstox-white);
  box-shadow: var(--libstox-shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.brand-card:hover,
.feature-card:hover,
.summary-card:hover,
.category-card:hover,
.market-card:hover,
.panel:hover,
.auth-card:hover,
.libstox-theme .card:hover {
  transform: translateY(-6px);
  box-shadow: var(--libstox-shadow-hover);
  border-color: rgba(247, 147, 30, .3) !important;
}

.section-white {
  background: var(--libstox-white);
}

.section-soft {
  background: var(--libstox-bg);
}

.libstox-hero {
  min-height: 620px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 82% 18%, rgba(247, 147, 30, .24), transparent 24%),
    radial-gradient(circle at 70% 74%, rgba(76, 175, 122, .22), transparent 28%),
    linear-gradient(120deg, #ffffff 0%, #f6faf8 45%, rgba(31, 139, 107, .22) 100%);
}

.libstox-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 58%, rgba(14, 92, 74, .1) 58%, rgba(14, 92, 74, .1) 61%, transparent 61%),
    linear-gradient(120deg, transparent 48%, rgba(247, 147, 30, .16) 48%, rgba(247, 147, 30, .16) 50%, transparent 50%);
  opacity: .9;
}

.libstox-hero::after {
  content: "";
  position: absolute;
  right: -95px;
  top: 70px;
  width: min(46vw, 540px);
  height: min(46vw, 540px);
  opacity: .14;
  background: url("../img/stock logo 2.png") center/contain no-repeat;
  filter: saturate(1.2);
  animation: floatShape 6s ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid rgba(31, 139, 107, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: var(--libstox-dark);
  font-size: .8rem;
  font-weight: 700;
  padding: .55rem .85rem;
  box-shadow: 0 10px 24px rgba(14, 92, 74, .1);
}

.hero-title {
  max-width: 760px;
  color: var(--libstox-dark);
}

.hero-copy {
  max-width: 650px;
  color: var(--libstox-muted);
}

.logo-geometry {
  position: relative;
  min-height: 420px;
  z-index: 1;
}

.logo-geometry .ribbon {
  position: absolute;
  border-radius: 30px 8px 30px 8px;
  filter: drop-shadow(0 20px 28px rgba(14, 92, 74, .16));
  animation: floatShape 7s ease-in-out infinite;
}

.logo-geometry .green-ribbon {
  width: 310px;
  height: 82px;
  right: 92px;
  top: 84px;
  background: linear-gradient(135deg, var(--libstox-dark), var(--libstox-light));
  transform: rotate(-38deg);
}

.logo-geometry .orange-ribbon {
  width: 275px;
  height: 70px;
  right: 12px;
  bottom: 106px;
  background: linear-gradient(135deg, #ffb03d, var(--libstox-orange));
  transform: rotate(-38deg);
  animation-delay: .8s;
}

.logo-geometry .arrow-head {
  position: absolute;
  right: 12px;
  top: 54px;
  width: 150px;
  height: 150px;
  background: var(--libstox-orange);
  clip-path: polygon(0 38%, 58% 38%, 58% 0, 100% 50%, 58% 100%, 58% 62%, 0 62%);
  transform: rotate(-38deg);
  filter: drop-shadow(0 22px 30px rgba(247, 147, 30, .24));
  animation: glowArrow 3s ease-in-out infinite;
}

.logo-geometry .curve {
  position: absolute;
  right: 172px;
  bottom: 70px;
  width: 210px;
  height: 210px;
  border: 36px solid rgba(31, 139, 107, .15);
  border-left-color: transparent;
  border-bottom-color: rgba(247, 147, 30, .34);
  border-radius: 50%;
  transform: rotate(-28deg);
}

.market-watermark,
.dashboard-shell,
.auth-shell {
  position: relative;
  overflow: hidden;
}

.market-watermark::before,
.dashboard-shell::before,
.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .26;
  background-image:
    linear-gradient(135deg, transparent 0 42%, rgba(31, 139, 107, .1) 42% 44%, transparent 44%),
    linear-gradient(90deg, transparent 0 7%, rgba(14, 92, 74, .13) 7% 7.4%, transparent 7.4% 13%, rgba(247, 147, 30, .16) 13% 13.4%, transparent 13.4%),
    url("data:image/svg+xml,%3Csvg width='420' height='160' viewBox='0 0 420 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%230E5C4A' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' opacity='.28'%3E%3Cpath d='M12 132 L84 96 L136 112 L205 54 L268 76 L344 28 L405 42'/%3E%3Cpath d='M344 28 L380 24 L370 58'/%3E%3C/g%3E%3Cg stroke='%23F7931E' stroke-width='3' opacity='.28'%3E%3Cpath d='M54 42v70M44 66h20M96 24v76M86 46h20M150 52v72M140 74h20M232 28v84M222 52h20M298 46v76M288 70h20'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 360px 360px, 180px 180px, 420px 160px;
  background-position: right 18px top 40px, left 20px bottom 80px, right 8% bottom 18%;
  background-repeat: no-repeat;
}

.glow-orb {
  position: absolute;
  pointer-events: none;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(76, 175, 122, .24), transparent 65%);
  filter: blur(6px);
  animation: floatShape 8s ease-in-out infinite;
}

.glow-orb.orange {
  background: radial-gradient(circle, rgba(247, 147, 30, .24), transparent 65%);
}

.feature-icon,
.summary-icon {
  width: 50px;
  height: 50px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: var(--libstox-white);
  background: linear-gradient(135deg, var(--libstox-dark), var(--libstox-light));
  font-weight: 700;
}

.summary-index .summary-icon,
.category-index,
.summary-intraday .summary-icon {
  background: linear-gradient(135deg, var(--libstox-orange), #ffb03d) !important;
}

.summary-total .summary-icon,
.summary-delivery .summary-icon,
.summary-active .summary-icon {
  background: linear-gradient(135deg, var(--libstox-dark), var(--libstox-light)) !important;
}

.summary-future .summary-icon,
.summary-new .summary-icon {
  background: linear-gradient(135deg, var(--libstox-green), var(--libstox-orange)) !important;
}

.summary-inactive .summary-icon {
  background: linear-gradient(135deg, #b3261e, var(--libstox-orange)) !important;
}

.category-card {
  color: var(--libstox-white) !important;
  min-height: 116px;
  overflow: hidden;
  position: relative;
}

.category-card::after {
  content: "";
  width: 90px;
  height: 90px;
  position: absolute;
  right: -20px;
  bottom: -28px;
  background: rgba(255, 255, 255, .16);
  border-radius: 50%;
}

.category-delivery,
.category-future {
  background: linear-gradient(135deg, var(--libstox-dark), var(--libstox-light)) !important;
}

.category-intraday {
  background: linear-gradient(135deg, var(--libstox-green), var(--libstox-orange)) !important;
}

.sidebar {
  background:
    linear-gradient(145deg, var(--libstox-dark), #083E32) !important;
  color: var(--libstox-white);
}

.sidebar a {
  color: rgba(255, 255, 255, .82) !important;
  border-radius: 12px !important;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(247, 147, 30, .16) !important;
  color: var(--libstox-white) !important;
}

.content-area {
  position: relative;
  z-index: 1;
}

.form-control,
.form-select {
  border-color: rgba(14, 92, 74, .18);
  border-radius: 12px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--libstox-green);
  box-shadow: 0 0 0 .2rem rgba(31, 139, 107, .16);
}

.table {
  --bs-table-bg: transparent;
}

.table th {
  color: var(--libstox-dark) !important;
  font-size: .78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.text-bg-light {
  color: var(--libstox-dark) !important;
  background: rgba(31, 139, 107, .08) !important;
  border-color: rgba(31, 139, 107, .2) !important;
}

.page-link {
  color: var(--libstox-green);
  border-radius: 10px;
  margin: 0 .15rem;
}

.active > .page-link,
.page-link.active {
  background: var(--libstox-green);
  border-color: var(--libstox-green);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 3rem 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(76, 175, 122, .22), transparent 24%),
    radial-gradient(circle at 88% 78%, rgba(247, 147, 30, .18), transparent 26%),
    linear-gradient(135deg, var(--libstox-bg), var(--libstox-white));
}

.auth-card {
  overflow: hidden;
}

.auth-card::before {
  content: "";
  display: block;
  height: 7px;
  background: linear-gradient(90deg, var(--libstox-dark), var(--libstox-light), var(--libstox-orange));
}

.auth-logo {
  width: 82px;
  height: 62px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--libstox-white);
  box-shadow: 0 10px 22px rgba(14, 92, 74, .12);
}

.otp-input,
input[name="otp"] {
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
}

.brand-footer {
  color: rgba(255, 255, 255, .82);
  background: var(--libstox-dark);
  border-top: 4px solid var(--libstox-orange);
}

.brand-footer strong,
.brand-footer span {
  color: var(--libstox-white);
}

.fade-in-up {
  animation: fadeInUp .7s ease both;
}

.fade-delay-1 { animation-delay: .1s; }
.fade-delay-2 { animation-delay: .2s; }
.fade-delay-3 { animation-delay: .3s; }

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

@keyframes floatShape {
  0%, 100% {
    transform: translateY(0) rotate(var(--shape-rotation, 0deg));
  }
  50% {
    transform: translateY(-14px) rotate(var(--shape-rotation, 0deg));
  }
}

@keyframes glowArrow {
  0%, 100% {
    filter: drop-shadow(0 18px 26px rgba(247, 147, 30, .2));
  }
  50% {
    filter: drop-shadow(0 20px 34px rgba(247, 147, 30, .42));
  }
}

@media (max-width: 991.98px) {
  .libstox-hero {
    min-height: auto;
    padding: 5rem 0 3rem;
  }

  .libstox-hero::after {
    width: 420px;
    height: 420px;
    right: -190px;
    top: 130px;
  }

  .logo-geometry {
    min-height: 260px;
    margin-top: 2rem;
  }

  .logo-geometry .green-ribbon {
    width: 220px;
    height: 58px;
    right: 105px;
    top: 60px;
  }

  .logo-geometry .orange-ribbon {
    width: 210px;
    height: 54px;
    right: 30px;
    bottom: 60px;
  }

  .logo-geometry .arrow-head {
    width: 105px;
    height: 105px;
    right: 38px;
    top: 32px;
  }

  .logo-geometry .curve {
    width: 150px;
    height: 150px;
    right: 150px;
    bottom: 34px;
    border-width: 26px;
  }

  .sidebar {
    min-height: auto !important;
  }
}

@media (max-width: 575.98px) {
  .brand-logo {
    width: 56px;
    height: 42px;
  }

  .brand-wordmark {
    font-size: 1.05rem;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .logo-geometry {
    min-height: 220px;
  }

  .btn-lg {
    width: 100%;
  }
}
