:root {
  --background: #0b1220;
  --sidebar: #111827;
  --card: #111b2d;
  --card-light: #172235;
  --border: #263247;
  --text: #f8fafc;
  --muted: #94a3b8;
  --dim: #64748b;
  --blue: #4f8cff;
  --blue-dark: #2563eb;
  --green: #20c997;
  --red: #fb7185;
  --yellow: #fbbf24;
  --purple: #b084ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(
      circle at 80% 0%,
      rgba(79, 140, 255, 0.1),
      transparent 32rem
    ),
    var(--background);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Sidebar */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 260px;
  padding: 25px 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.98);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #8b5cf6);
  font-size: 20px;
  font-weight: 800;
}

.brand h2 {
  margin: 0;
  font-size: 21px;
}

.brand span {
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 8px 22px;
  padding: 10px 12px;
  border: 1px solid rgba(32, 201, 151, 0.18);
  border-radius: 10px;
  color: #91e8ca;
  background: rgba(32, 201, 151, 0.08);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.side-navigation {
  display: grid;
  gap: 5px;
}

.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 13px;
  transition: 0.2s ease;
}

.side-link span:first-child {
  width: 19px;
  color: var(--dim);
  font-size: 17px;
  text-align: center;
}

.side-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.side-link.active {
  color: white;
  background: var(--blue);
  box-shadow: 0 10px 25px rgba(79, 140, 255, 0.18);
}

.side-link.active span:first-child {
  color: white;
}

.sidebar-section-title {
  margin: 28px 12px 10px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

/* Main area */

.main-area {
  min-height: 100vh;
  margin-left: 260px;
  padding-bottom: 32px;
}

.top-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 38px;
  border-bottom: 1px solid rgba(38, 50, 71, 0.7);
  background: rgba(11, 18, 32, 0.74);
  backdrop-filter: blur(15px);
}

.header-left,
.header-actions,
.user-profile {
  display: flex;
  align-items: center;
}

.header-left {
  gap: 12px;
}

.header-actions {
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.top-header h1 {
  margin: 0;
  font-size: 23px;
}

.mobile-menu-button {
  display: none;
  border: 0;
  color: white;
  background: transparent;
  font-size: 22px;
}

.mode-badge {
  padding: 7px 10px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 8px;
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.08);
  font-size: 10px;
  font-weight: 800;
}

.icon-button {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--card);
  font-size: 20px;
}

.icon-button:hover {
  border-color: var(--blue);
  color: white;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.user-profile {
  gap: 9px;
  margin-left: 5px;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, #4f8cff, #8b5cf6);
  font-weight: 700;
}

.user-details {
  display: grid;
  gap: 2px;
}

.user-details strong {
  font-size: 12px;
}

.user-details small {
  color: var(--dim);
  font-size: 10px;
}

/* Horizontal menu */

.scroll-menu-wrapper {
  overflow-x: auto;
  padding: 17px 38px 0;
}

.scroll-menu {
  display: flex;
  width: max-content;
  gap: 8px;
}

.scroll-menu-item {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  background: var(--card);
  font-size: 12px;
  white-space: nowrap;
}

.scroll-menu-item:hover,
.scroll-menu-item.active {
  border-color: var(--blue);
  color: white;
  background: rgba(79, 140, 255, 0.14);
}

/* Page */

.page-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 27px 38px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.page-heading h2 {
  margin: 0;
  font-size: 26px;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Buttons */

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
}

.primary-button {
  border: 1px solid var(--blue);
  color: white;
  background: var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--card);
}

.secondary-button:hover {
  border-color: var(--blue);
  color: white;
}

.danger-button {
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fda4af;
  background: rgba(251, 113, 133, 0.09);
}

/* Cards */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.stat-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(
      145deg,
      rgba(23, 34, 53, 0.95),
      rgba(17, 27, 45, 0.95)
    );
  box-shadow: var(--shadow);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #8db6ff;
  background: rgba(79, 140, 255, 0.12);
  font-size: 17px;
}

.stat-card.green .stat-icon {
  color: var(--green);
  background: rgba(32, 201, 151, 0.12);
}

.stat-card.red .stat-icon {
  color: var(--red);
  background: rgba(251, 113, 133, 0.12);
}

.stat-value {
  margin-top: 20px;
  font-size: 24px;
  font-weight: 800;
}

.stat-change {
  margin-top: 7px;
  color: var(--dim);
  font-size: 11px;
}

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

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

/* Dashboard grids */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, 0.9fr);
  gap: 17px;
  margin-top: 17px;
}

.bottom-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 17px;
  margin-top: 17px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-top: 17px;
}

/* General cards */

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(17, 27, 45, 0.92);
  box-shadow: var(--shadow);
}

.card-padding {
  padding: 20px;
}

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

.card-header h3 {
  margin: 0;
  font-size: 15px;
}

.card-header p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 11px;
}

/* Chart */

.chart-summary {
  display: flex;
  gap: 40px;
  margin-bottom: 10px;
}

.chart-summary small {
  display: block;
  color: var(--dim);
  font-size: 10px;
}

.chart-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.chart-box {
  width: 100%;
  height: 265px;
}

.chart-box svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: #263247;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#chartGradient);
}

.chart-label {
  fill: var(--dim);
  font-size: 10px;
}

/* Breakdown */

.breakdown-list {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.breakdown-row {
  display: grid;
  gap: 7px;
}

.breakdown-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.breakdown-value {
  color: white;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #263247;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.progress-bar.green {
  background: var(--green);
}

.progress-bar.yellow {
  background: var(--yellow);
}

/* Quick action cards */

.action-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: white;
  background: var(--card);
  text-align: left;
  transition: 0.2s ease;
}

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

.action-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 11px;
  color: #8db6ff;
  background: rgba(79, 140, 255, 0.13);
  font-size: 20px;
}

.action-card h4 {
  margin: 0;
  font-size: 13px;
}

.action-card p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 11px;
}

/* Holdings and activity */

.holdings-list,
.activity-list {
  display: grid;
  gap: 13px;
}

.holding-row,
.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(38, 50, 71, 0.75);
}

.holding-row:last-child,
.activity-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.holding-symbol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.symbol-box {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  color: #b6ccff;
  background: rgba(79, 140, 255, 0.13);
  font-size: 10px;
  font-weight: 800;
}

.holding-symbol strong,
.activity-row strong {
  display: block;
  font-size: 12px;
}

.holding-symbol small,
.activity-row small {
  display: block;
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
}

.holding-price {
  text-align: right;
}

.holding-price strong {
  display: block;
  font-size: 12px;
}

.holding-price small {
  display: block;
  margin-top: 3px;
  color: var(--green);
  font-size: 10px;
}

/* Strategy */

.active-strategy {
  display: grid;
  gap: 16px;
}

.strategy-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.strategy-symbol {
  display: flex;
  align-items: center;
  gap: 11px;
}

.strategy-symbol .symbol-box {
  width: 43px;
  height: 43px;
}

.strategy-symbol h3 {
  margin: 0;
  font-size: 17px;
}

.strategy-symbol p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 11px;
}

.status-pill {
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--green);
  background: rgba(32, 201, 151, 0.1);
  font-size: 10px;
  font-weight: 800;
}

.strategy-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.metric-box {
  padding: 11px;
  border-radius: 10px;
  background: var(--card-light);
}

.metric-box small {
  display: block;
  color: var(--dim);
  font-size: 10px;
}

.metric-box strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.strategy-progress {
  display: grid;
  gap: 8px;
}

.strategy-progress-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

/* Forms */

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.form-card {
  padding: 22px;
}

.form-card h3 {
  margin: 0;
  font-size: 16px;
}

.form-card > p {
  margin: 6px 0 20px;
  color: var(--dim);
  font-size: 12px;
}

.form-group {
  margin-bottom: 17px;
}

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

.input,
.select,
input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  outline: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  background: var(--card-light);
  font-size: 13px;
}

.input:focus,
.select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.amount-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.amount-shortcuts button {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}

.amount-shortcuts button:hover {
  border-color: var(--blue);
  color: white;
}

.radio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.radio-option {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--card-light);
  font-size: 12px;
}

.radio-option.selected {
  border-color: var(--blue);
  color: white;
  background: rgba(79, 140, 255, 0.12);
}

.radio-option input {
  width: auto;
  margin-right: 6px;
  accent-color: var(--blue);
}

/* Preview */

.preview-box {
  display: grid;
  gap: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card-light);
}

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.preview-row:last-child {
  border-bottom: 0;
}

.preview-row strong {
  color: white;
  text-align: right;
}

/* Messages */

.warning-box,
.info-box,
.success-box {
  padding: 13px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.6;
}

.warning-box {
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fcd77a;
  background: rgba(251, 191, 36, 0.08);
}

.info-box {
  border: 1px solid rgba(79, 140, 255, 0.25);
  color: #a9c5ff;
  background: rgba(79, 140, 255, 0.08);
}

.success-box {
  border: 1px solid rgba(32, 201, 151, 0.25);
  color: #8ee3c8;
  background: rgba(32, 201, 151, 0.08);
}

/* Tables */

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 750px;
  border-collapse: collapse;
}

.data-table th {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 15px 10px;
  border-bottom: 1px solid rgba(38, 50, 71, 0.72);
  color: var(--muted);
  font-size: 12px;
}

.data-table td:first-child {
  color: white;
  font-weight: 600;
}

.order-status,
.history-status {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}

.status-completed {
  color: var(--green);
  background: rgba(32, 201, 151, 0.1);
}

.status-pending {
  color: var(--yellow);
  background: rgba(251, 191, 36, 0.1);
}

.status-exited {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.1);
}

/* Monitor */

.monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.monitor-price {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0;
}

.monitor-price strong {
  font-size: 32px;
}

.monitor-price span {
  color: var(--green);
  font-size: 13px;
}

.cycle-circle {
  width: 145px;
  height: 145px;
  display: grid;
  place-items: center;
  margin: 15px auto 20px;
  border: 10px solid rgba(79, 140, 255, 0.16);
  border-top-color: var(--blue);
  border-right-color: var(--blue);
  border-radius: 50%;
  transform: rotate(25deg);
}

.cycle-circle-inner {
  display: grid;
  place-items: center;
  transform: rotate(-25deg);
}

.cycle-circle strong {
  font-size: 22px;
}

.cycle-circle small {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
}

/* Empty page */

.page-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: var(--card);
  text-align: center;
}

.page-empty h2 {
  color: white;
}

/* Toast */

.toast {
  position: fixed;
  right: 25px;
  bottom: 25px;
  z-index: 100;
  max-width: 350px;
  padding: 13px 17px;
  border: 1px solid var(--green);
  border-radius: 10px;
  color: white;
  background: #12332c;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: 0.25s ease;
  font-size: 12px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile bottom navigation */

.bottom-navigation {
  display: none;
}

/* Tablet */

@media (max-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .bottom-content-grid,
  .form-layout,
  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */

@media (max-width: 760px) {
  .sidebar {
    width: 250px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    margin-left: 0;
    padding-bottom: 80px;
  }

  .top-header {
    padding: 16px;
  }

  .mobile-menu-button {
    display: block;
  }

  .user-details,
  .mode-badge {
    display: none;
  }

  .header-actions {
    gap: 7px;
  }

  .scroll-menu-wrapper {
    padding: 14px 16px 0;
  }

  .page-container {
    padding: 22px 16px 30px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading h2 {
    font-size: 23px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    min-height: 130px;
    padding: 14px;
  }

  .stat-value {
    font-size: 19px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .bottom-navigation {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    padding: 7px 3px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(17, 24, 39, 0.96);
    backdrop-filter: blur(16px);
  }

  .bottom-link {
    min-width: 54px;
    display: grid;
    place-items: center;
    gap: 3px;
    padding: 6px 5px;
    border: 0;
    border-radius: 10px;
    color: var(--dim);
    background: transparent;
  }

  .bottom-link span {
    font-size: 18px;
  }

  .bottom-link small {
    font-size: 9px;
  }

  .bottom-link.active {
    color: var(--blue);
    background: rgba(79, 140, 255, 0.1);
  }

  .chart-box {
    height: 220px;
  }

  .toast {
    right: 15px;
    bottom: 88px;
    left: 15px;
  }
}

/* Small mobile */

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

  .stat-value {
    font-size: 17px;
  }

  .chart-summary {
    gap: 20px;
  }

  .chart-summary strong {
    font-size: 16px;
  }

  .monitor-price strong {
    font-size: 26px;
  }
}
.search-results {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.stock-search-card {
  width: calc(100% - 24px);
  max-width: 620px;
  margin: 12px auto 20px;
  padding: 16px;
  border: 1px solid #263653;
  border-radius: 15px;
  background: #111b2e;
  color: #ffffff;
}
.search-item {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-light);
  color: white;
  text-align: left;
}

.search-item strong {
  display: block;
  margin-bottom: 8px;
}

.search-item span,
.search-item small {
  display: block;
  color: var(--muted);
}
