:root {
  --dashboard-bg: #d5d5d5;
  --card-radius: 1rem;
  --text-muted: rgba(255, 255, 255, 0.7);
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dashboard-bg) fixed;
  min-height: 100vh;
}

.bg-dashboard {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.bg-gradient {
  background: var(--dashboard-bg) fixed;
}

.account-card {
  border: none;
  border-radius: var(--card-radius);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.account-card .card-body {
  padding: 1rem;
}

.dashboard-shell {
  width: min(100%, 1840px);
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.page-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.page-actions .btn,
.page-actions form,
.page-actions form .btn {
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.12);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.info-tile {
  border: 1px solid rgba(13, 110, 253, 0.15);
  border-radius: 0.9rem;
  background: linear-gradient(160deg, rgba(13, 110, 253, 0.08), rgba(255, 255, 255, 0.95));
  padding: 1rem;
}

.info-tile h2 {
  margin-bottom: 0.45rem;
}

.cta-card {
  border: 1px solid rgba(13, 110, 253, 0.2);
  border-radius: 0.9rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-start;
  background: #fff;
}

.cta-card .btn {
  width: 100%;
}

.balance-display {
  font-size: 1.5rem;
  font-weight: 700;
}

.change-indicator {
  font-size: 0.95rem;
  font-weight: 600;
}

.chart-wrapper {
  position: relative;
  min-height: 200px;
}

.status-panel .card-header {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(111, 66, 193, 0.12));
}

.service-status-card {
  border-radius: var(--card-radius);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(13, 110, 253, 0.08);
  box-shadow: 0 12px 32px rgba(13, 110, 253, 0.08);
  backdrop-filter: blur(6px);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08), 0 0 12px currentColor;
  position: relative;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%);
}

.status-indicator.status-online {
  color: #198754;
  background: rgba(25, 135, 84, 0.12);
}

.status-indicator.status-offline {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.12);
}

.status-detail {
  font-size: 0.75rem;
  word-break: break-word;
}

.table-responsive {
  max-height: none;
}

.table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.table tbody td {
  font-size: 0.85rem;
}

.dashboard-users-table thead {
  display: none;
}

.dashboard-users-table,
.dashboard-users-table tbody,
.dashboard-users-table tr,
.dashboard-users-table td {
  display: block;
  width: 100%;
}

.dashboard-users-table tr {
  border-bottom: 1px solid rgba(13, 110, 253, 0.12);
  padding: 0.75rem;
}

.dashboard-users-table td {
  border: none;
  padding: 0.35rem 0;
}

.dashboard-users-table td::before {
  content: attr(data-label);
  display: block;
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.dashboard-users-table .table-actions {
  justify-content: stretch !important;
}

.dashboard-users-table .table-actions form,
.dashboard-users-table .table-actions .btn,
.dashboard-users-table .table-actions .form-control {
  width: 100%;
}

.dashboard-users-table .table-actions form.d-flex {
  flex-direction: column;
}



.widget-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}

.widget-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.widget-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: none;
  border-radius: 1.15rem;
  background: linear-gradient(160deg, #f7f4ff, #ffffff 60%);
  padding: 1rem;
  box-shadow: 0 14px 38px rgba(58, 26, 102, 0.11);
  display: block;
  margin: 0;
  overflow-x: clip;
}

.subpage-shell {
  width: min(100%, 1240px);
}

.subpage-card {
  border: none;
  border-radius: 1.15rem;
  background: linear-gradient(160deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 18px 44px rgba(18, 74, 172, 0.12);
}

.subpage-muted {
  color: #5f6980;
}

.subpage-table {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(13, 110, 253, 0.14);
  background: #fff;
}

.subpage-table .table {
  margin-bottom: 0;
}

.sqlite-viewer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.sqlite-sidebar {
  align-self: start;
}

.sqlite-path {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  background: rgba(13, 110, 253, 0.08);
  color: #0b3d91;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
}

.sqlite-stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: min(100%, 28rem);
}

.sqlite-stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(13, 110, 253, 0.12);
}

.sqlite-stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c757d;
  font-weight: 600;
}

.sqlite-stat-value {
  font-size: 0.98rem;
  color: #1f2340;
  word-break: break-word;
}

.sqlite-table-list {
  display: grid;
  gap: 0.55rem;
  max-height: min(65vh, 42rem);
  overflow: auto;
}

.sqlite-table-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(13, 110, 253, 0.1);
  background: rgba(255, 255, 255, 0.72);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sqlite-table-link:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 110, 253, 0.3);
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.08);
}

.sqlite-table-link.is-active {
  border-color: rgba(13, 110, 253, 0.35);
  background: linear-gradient(160deg, rgba(13, 110, 253, 0.12), rgba(255, 255, 255, 0.92));
}

.sqlite-table-link-name {
  font-weight: 600;
  word-break: break-word;
}

.sqlite-main {
  min-width: 0;
}

.sqlite-toolbar {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  align-items: end;
}

.sqlite-toolbar-form {
  min-width: 0;
}

.sqlite-column-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sqlite-column-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(13, 110, 253, 0.08);
  color: #0b3d91;
  font-size: 0.78rem;
  font-weight: 600;
}

.sqlite-data-table-wrap {
  max-height: 78vh;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.sqlite-scroll-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: #5f6980;
  font-size: 0.82rem;
}

.sqlite-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4ff;
  box-shadow: inset 0 -1px 0 rgba(13, 110, 253, 0.12);
  white-space: nowrap;
}

.sqlite-data-table tbody tr:nth-of-type(even) {
  background: rgba(13, 110, 253, 0.02);
}

.sqlite-row-toggle-column,
.sqlite-row-toggle-cell,
.sqlite-row-number {
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 2;
  background: inherit;
}

.sqlite-row-toggle-column,
.sqlite-row-toggle-cell {
  width: 1%;
}

.sqlite-row-toggle-column,
.sqlite-row-toggle-cell {
  left: 0;
}

.sqlite-row-number {
  width: 1%;
  color: #6c757d;
  left: 5.75rem;
}

.sqlite-data-table thead .sqlite-row-toggle-column,
.sqlite-data-table thead .sqlite-row-number {
  z-index: 3;
  background: #eef4ff;
}

.sqlite-summary-row .sqlite-row-toggle-cell,
.sqlite-summary-row .sqlite-row-number {
  box-shadow: 1px 0 0 rgba(13, 110, 253, 0.08);
}

.sqlite-row-toggle {
  min-width: 5.5rem;
}

.sqlite-summary-row td,
.sqlite-summary-row th {
  vertical-align: top;
}

.sqlite-cell {
  display: inline-block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: min(32rem, 70vw);
  color: #1f2340;
  background: transparent;
  padding: 0;
}

.sqlite-cell-preview {
  display: -webkit-box;
  max-width: min(18rem, 32vw);
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  line-height: 1.4;
  max-height: 2.8em;
}

.sqlite-detail-row td {
  padding: 0.75rem 1rem 1rem;
  background: rgba(13, 110, 253, 0.04);
}

.sqlite-detail-card {
  border: 1px solid rgba(13, 110, 253, 0.12);
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
}

.sqlite-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

.sqlite-detail-grid {
  display: grid;
  gap: 0.75rem;
}

.sqlite-detail-item {
  display: grid;
  gap: 0.3rem;
}

.sqlite-detail-item dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.sqlite-detail-item dd {
  margin: 0;
}

.sqlite-cell-full {
  max-width: 100%;
}

.sqlite-null-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(108, 117, 125, 0.14);
  color: #5f6980;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.widget-card-clock {
  background: linear-gradient(160deg, #efe6ff, #f8f4ff 55%, #ffffff);
}

.widget-card-log {
  background: #ffffff;
}


.widget-card-account {
  background: linear-gradient(160deg, #f0f7ff, #ffffff 65%);
}

.widget-card-balance {
  background: linear-gradient(160deg, #eef8ff, #ffffff 62%);
}

.tradovate-balance-list {
  display: grid;
  gap: 0.55rem;
}

.tradovate-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 1px solid rgba(13, 110, 253, 0.12);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.86);
}

.tradovate-env {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #0d6efd;
}

.tradovate-account {
  font-size: 0.82rem;
  color: #495057;
}

.tradovate-balance {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0b3d91;
}

.widget-card-hero {
  background: linear-gradient(160deg, #eef2ff, #ffffff 72%);
}

.widget-card-logo {
  min-height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, #e5ddff, #f5f1ff 58%, #ffffff);
}

.logo-widget-text {
  width: 100%;
  text-align: center;
  font-size: clamp(1.75rem, 4.1vw, 3.4rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  font-weight: 800;
  color: #2a2f68;
}

.widget-card[draggable="true"] {
  cursor: grab;
}

.widget-card[draggable="true"]:active {
  cursor: grabbing;
}

.widget-card.widget-dragging {
  opacity: 0.45;
}

.widget-column.widget-drag-over {
  outline: 2px dashed rgba(13, 110, 253, 0.45);
  outline-offset: 0.35rem;
  border-radius: 0.9rem;
}


.hero-logo {
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: #2f3f9d;
  margin-bottom: 0.35rem;
}

.widget-card-hero h1 {
  color: #1f2340;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.25;
}

.widget-card-hero > .widget-header p {
  color: #515a74;
}

.widget-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.account-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(8rem, 11rem) minmax(8rem, 11rem) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid rgba(13, 110, 253, 0.14);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.86);
}

.account-control-meta {
  min-width: 0;
}

.account-control-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.account-control-field-toggle {
  align-items: center;
}

.account-control-label {
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  color: #6c757d;
}

.account-control-field-qty {
  width: 5.2rem;
}

.account-control-field-window {
  width: min(11rem, 100%);
}

.account-control-actions .btn {
  min-width: 4.25rem;
}

.account-control-explanation {
  grid-column: 1 / -1;
}

.widget-header {
  margin-bottom: 0.8rem;
}

.widget-header-log {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.decision-timestamp {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6c757d;
  white-space: nowrap;
}

.widget-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c757d;
  font-weight: 600;
}

.clock-time {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

.clock-date {
  font-size: 0.9rem;
  color: #ffffff;
}

.widget-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  border-radius: 1rem;
  padding: 0.95rem;
  min-width: 0;
}

.widget-shell > *,
.widget-header-log > *,
.reasoning-card > *,
.signal-banner > *,
.candle-chart-card > * {
  min-width: 0;
}

.widget-shell-dark {
  background: linear-gradient(165deg, #28163f, #3a2258);
}

.widget-shell-light {
  background: linear-gradient(160deg, #e8f9f6, #f5fffd);
  border: 1px solid rgba(13, 152, 153, 0.2);
}

.clock-content {
  align-self: center;
}

.mini-gauge {
  --gauge-value: 50;
  --gauge-fill: #e8cbff;
  width: 108px;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(from 210deg, var(--gauge-fill) calc((var(--gauge-value) / 100) * 240deg), rgba(255, 255, 255, 0.16) 0deg 240deg, transparent 240deg);
}

.mini-gauge::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: inherit;
  background: #2e1a49;
}

.mini-gauge-teal {
  --gauge-fill: #089a9d;
  background: conic-gradient(from 210deg, var(--gauge-fill) calc((var(--gauge-value) / 100) * 240deg), rgba(8, 154, 157, 0.2) 0deg 240deg, transparent 240deg);
}

.mini-gauge-teal::before {
  background: #ffffff;
}

.mini-gauge-signal {
  background: conic-gradient(from 210deg, var(--gauge-fill) calc((var(--gauge-value) / 100) * 240deg), color-mix(in srgb, var(--gauge-fill) 22%, white) 0deg 240deg, transparent 240deg);
}

.mini-gauge-signal::before {
  background: #ffffff;
}

.mini-gauge-signal .mini-gauge-label {
  color: color-mix(in srgb, var(--gauge-fill) 70%, black);
}

.mini-gauge-signal-buy {
  --gauge-fill: #1f9d51;
}

.mini-gauge-signal-sell {
  --gauge-fill: #df3d4f;
}

.mini-gauge-signal-wait {
  --gauge-fill: #e0b000;
}

.mini-gauge-signal-neutral {
  --gauge-fill: #089a9d;
}

.mini-gauge-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  z-index: 1;
}

.mini-gauge-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.mini-gauge-value span {
  font-size: 1rem;
}

.mini-gauge-label {
  margin-top: 0.2rem;
  color: #ffffff;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}

.mini-gauge-teal .mini-gauge-value {
  color: #006a70;
}

.mini-gauge-value-action {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.mini-gauge-value-action-buy {
  color: #1f9d51;
}

.mini-gauge-value-action-sell {
  color: #df3d4f;
}

.mini-gauge-value-action-wait {
  color: #d9a300;
}

.mini-gauge-teal .mini-gauge-label {
  color: rgba(0, 106, 112, 0.72);
}

.widget-progress-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #066165;
}

.widget-progress-track {
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(6, 97, 101, 0.13);
  overflow: hidden;
}

.widget-progress-track-split {
  display: flex;
  align-items: stretch;
  height: 1.8rem;
  background: rgba(6, 97, 101, 0.08);
  border: 1px solid rgba(6, 97, 101, 0.12);
}

.widget-progress-segment {
  --segment-width: 50%;
  width: max(var(--segment-width), 4.5rem);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.widget-progress-segment-reward {
  color: #fff;
  background: linear-gradient(90deg, #1f9d51, #2fbe68);
}

.widget-progress-segment-risk {
  color: #fff;
  background: linear-gradient(90deg, #df3d4f, #bf2030);
}

.widget-progress-caption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: rgba(2, 73, 76, 0.75);
}

.signal-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.signal-pill {
  background: rgba(8, 154, 157, 0.14);
  color: #046f73;
  border: 1px solid rgba(8, 154, 157, 0.26);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
}

.signal-pill-buy {
  background: rgba(31, 157, 81, 0.16);
  color: #156a38;
  border-color: rgba(31, 157, 81, 0.3);
}

.signal-pill-sell {
  background: rgba(223, 61, 79, 0.15);
  color: #9c1f2f;
  border-color: rgba(223, 61, 79, 0.3);
}

.signal-pill-wait {
  background: rgba(238, 188, 44, 0.2);
  color: #8a6500;
  border-color: rgba(238, 188, 44, 0.35);
}

.signal-pill-cancelled {
  background: rgba(223, 61, 79, 0.15);
  color: #9c1f2f;
  border-color: rgba(223, 61, 79, 0.3);
}

.widget-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.widget-metrics dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

.widget-metrics dd {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
}

.reasoning-card {
  background: rgba(8, 154, 157, 0.09);
  border-radius: 0.75rem;
  border: 1px solid rgba(8, 154, 157, 0.2);
  padding: 0.85rem;
}

.reasoning-details {
  margin: 0;
}

.reasoning-toggle {
  color: #046f73;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.55rem;
}

.reasoning-toggle::-webkit-details-marker {
  display: none;
}

.reasoning-toggle-expand {
  display: inline;
}

.reasoning-toggle-collapse {
  display: none;
}

.reasoning-details[open] .reasoning-toggle-expand {
  display: none;
}

.reasoning-details[open] .reasoning-toggle-collapse {
  display: inline;
}

.reasoning-text {
  margin: 0;
  line-height: 1.45;
  color: #1f2933;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.reasoning-details[open] .reasoning-text {
  overflow: visible;
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.widget-footnote {
  font-size: 0.78rem;
  color: #6c757d;
}


.candle-chart-card {
  border: 1px solid rgba(8, 154, 157, 0.2);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.8rem;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 0;
}

.candle-chart-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.candle-chart-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.candle-chart-card--candles {
  min-height: clamp(20rem, 44vw, 28rem);
}

.candle-chart-card--candles .candle-chart-frame {
  flex: 1;
  min-height: clamp(18rem, 38vw, 24rem);
}

.candle-chart-card--balance {
  min-height: clamp(14rem, 28vw, 18rem);
}

.candle-chart-card--gpt-image {
  min-height: clamp(16rem, 30vw, 24rem);
}

.candle-chart-frame--image {
  min-height: clamp(16rem, 30vw, 24rem);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}

.candle-chart-frame--empty {
  padding: 0.75rem;
  text-align: center;
}

.candle-chart-frame {
  position: relative;
  flex: 1;
  min-height: 0;
}

.candle-chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.candle-chart-legend {
  font-size: 0.73rem;
  color: rgba(4, 111, 115, 0.78);
  font-weight: 500;
}


.candle-range-controls .btn {
  border-color: rgba(8, 154, 157, 0.28);
  color: rgba(4, 111, 115, 0.9);
  font-size: 0.72rem;
  font-weight: 600;
}

.candle-range-controls .btn.active,
.candle-range-controls .btn:active,
.candle-range-controls .btn:focus-visible {
  background-color: rgba(8, 154, 157, 0.14);
  border-color: rgba(8, 154, 157, 0.45);
  color: #045f63;
}

.candle-display-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.candle-display-controls .btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  width: 100%;
  border-color: rgba(8, 154, 157, 0.18);
  background-color: rgba(247, 255, 254, 0.88);
  color: rgba(4, 111, 115, 0.92);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.candle-display-controls .btn::before {
  content: "";
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  flex: 0 0 0.72rem;
  background-color: #9aa4af;
  border: 1px solid #9aa4af;
}

.candle-display-controls .btn.active,
.candle-display-controls .btn:active,
.candle-display-controls .btn:focus-visible {
  background-color: rgba(247, 255, 254, 0.96);
  border-color: rgba(8, 154, 157, 0.34);
  color: #045f63;
}

.candle-display-controls .btn.active::before,
.candle-display-controls .btn[aria-pressed="true"]::before {
  background-color: #20c570;
  border-color: #20c570;
}

.candle-fullscreen-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-color: rgba(8, 154, 157, 0.28);
  color: rgba(4, 111, 115, 0.9);
  font-size: 1rem;
  line-height: 1;
}

.candle-fullscreen-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-1px);
}

.candle-fullscreen-toggle:hover,
.candle-fullscreen-toggle:focus-visible,
.candle-fullscreen-toggle[aria-pressed="true"] {
  background-color: rgba(8, 154, 157, 0.14);
  border-color: rgba(8, 154, 157, 0.45);
  color: #045f63;
}


.candle-chart-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
}

.candle-chart {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  display: block;
  touch-action: pan-y;
}

.candle-chart--zoom-enabled {
  touch-action: none;
  cursor: grab;
}

.candle-chart--zoom-enabled:active {
  cursor: grabbing;
}

.candle-chart-week {
  min-height: 0;
}

.balance-line-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  color: #5c6770;
  display: grid;
  place-items: center;
  font-size: 0.86rem;
}

.balance-line-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.candle-chart .chart-bg {
  fill: #f6fffe;
  stroke: rgba(8, 154, 157, 0.22);
}

.candle-chart .chart-level {
  font-size: 10.5px;
  font-weight: 600;
}

.candle-chart .chart-grid {
  stroke: rgba(8, 154, 157, 0.12);
  stroke-width: 1;
}

.candle-chart .chart-day-separator {
  stroke: #e3e3e3;
  stroke-width: 2;
}

.candle-chart .chart-axis {
  stroke: rgba(4, 111, 115, 0.45);
  stroke-width: 1;
}

.candle-chart .chart-axis-tick {
  stroke: rgba(4, 111, 115, 0.4);
  stroke-width: 1;
}

.candle-chart .chart-scale-label {
  fill: rgba(4, 111, 115, 0.82);
  font-size: 10px;
  font-weight: 500;
}


.candle-chart .chart-time-label {
  fill: rgba(4, 111, 115, 0.75);
  font-size: 9px;
  font-weight: 500;
}


.candle-chart .chart-volume-zone {
  fill: rgba(8, 154, 157, 0.05);
  stroke: rgba(8, 154, 157, 0.16);
  stroke-width: 1;
}

.candle-chart .chart-volume-label,
.candle-chart .chart-volume-scale-label {
  fill: rgba(4, 111, 115, 0.62);
  font-size: 9px;
  font-weight: 600;
}

.candle-chart .chart-level-label {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.candle-chart .chart-level-label-bg {
  opacity: 0.98;
}

.candle-chart-fullscreen-body {
  overflow: hidden;
}

.candle-chart-card:fullscreen,
.candle-chart-card--fullscreen-fallback {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 0.9rem;
  border-radius: 0;
  background: #f7fffe;
}

.candle-chart-card:fullscreen .candle-chart-frame,
.candle-chart-card--fullscreen-fallback .candle-chart-frame {
  min-height: calc(100dvh - 7rem);
}

.candle-chart-card--fullscreen-fallback {
  position: fixed;
  inset: 0;
  z-index: 1080;
}


@media (min-width: 992px) {
  .widget-layout {
    grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.25fr) minmax(320px, 1fr);
  }
}

@media (max-width: 767.98px) {
  .candle-fullscreen-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 575.98px) {
  main.container,
  main.container-fluid {
    padding-left: 0;
    padding-right: 0;
  }

  .dashboard-shell {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .account-card {
    border-radius: 0;
  }

  .account-card .card-body {
    padding: 0.55rem;
  }

  .widget-layout {
    gap: 0.7rem;
  }

  .widget-column {
    gap: 0.7rem;
  }

  .widget-card {
    border-radius: 1rem;
    padding: 0.95rem;
  }

  .widget-shell {
    gap: 0.7rem;
    padding: 0.75rem;
  }

  .widget-header-log {
    flex-wrap: wrap;
  }

  .decision-timestamp {
    white-space: normal;
  }


   .account-control-row {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .account-control-meta,
  .account-control-actions {
    grid-column: 1 / -1;
  }

  .account-control-field-qty {
    width: 100%;
  }

  .account-control-field-toggle {
    align-items: flex-start;
  }

  .account-control-row .btn,
  .account-control-row .form-control {
    width: 100% !important;
  }
}

@media (min-width: 768px) {
  .account-card .card-body {
    padding: 1.75rem;
  }

  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .page-actions {
    display: flex;
    width: auto;
    align-items: center;
  }

  .page-actions .btn,
  .page-actions form,
  .page-actions form .btn {
    width: auto;
  }

  .chart-wrapper {
    min-height: 220px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .widget-card {
    padding: 1.2rem;
  }

  .info-tile,
  .cta-card {
    padding: 1.25rem;
  }

  .cta-card {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .cta-card .btn {
    width: auto;
    flex-shrink: 0;
  }

  .service-status-card {
    padding: 1.25rem;
  }

  .table-responsive {
    max-height: 480px;
  }

  .dashboard-users-table thead {
    display: table-header-group;
  }

  .dashboard-users-table,
  .dashboard-users-table tbody,
  .dashboard-users-table tr,
  .dashboard-users-table td {
    display: revert;
    width: auto;
  }

  .dashboard-users-table tr {
    padding: 0;
    border: none;
  }

  .dashboard-users-table td {
    border: inherit;
    padding: 0.75rem 0.5rem;
  }

  .dashboard-users-table td::before {
    display: none;
  }

  .dashboard-users-table .table-actions {
    justify-content: end !important;
  }

  .dashboard-users-table .table-actions form,
  .dashboard-users-table .table-actions .btn,
  .dashboard-users-table .table-actions .form-control {
    width: auto;
  }

  .dashboard-users-table .table-actions form.d-flex {
    flex-direction: row;
  }

  .sqlite-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sqlite-viewer-layout {
    grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
    align-items: start;
  }
}

.indicators-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.indicator-item {
  background: rgba(10, 79, 207, 0.06);
  border: 1px solid rgba(10, 79, 207, 0.14);
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
}

.indicator-item dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4a5b75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.indicator-item dd {
  margin: 0.15rem 0 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #081f4d;
}

.indicator-history-wrap {
  overflow-x: auto;
}

.indicator-history-table {
  font-size: 0.8rem;
}

.indicator-history-table thead th {
  color: #4a5b75;
  font-weight: 600;
  border-bottom-color: rgba(10, 79, 207, 0.2);
}

.indicator-history-table tbody td {
  color: #081f4d;
  white-space: nowrap;
}
