html {
  background: #eef3f7;
}

body {
  font-size: 0.84rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  color: #18212f;
  background: #eef3f7;
}

.wrapper {
  background: transparent;
}

.main-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.28) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.navbar-brand {
  color: #172033 !important;
  font-weight: 800;
  letter-spacing: 0;
}

.navbar-brand .fa-chart-line {
  color: #2563eb !important;
}

.main-header .container-fluid {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand {
  flex: 0 0 auto;
  margin-right: 0.75rem;
}

#status {
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #f7fafc;
  color: #526174 !important;
  font-weight: 700;
  line-height: 1;
  padding: 0.42rem 0.72rem;
}

.axiom-top-nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.axiom-top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  color: #526174;
  background: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.35rem 0.62rem;
  white-space: nowrap;
}

.axiom-top-nav a:hover,
.axiom-top-nav a.active {
  border-color: #2563eb;
  color: #2563eb;
  text-decoration: none;
}

.axiom-top-nav a.active {
  background: #eff6ff;
}

.axiom-top-nav i {
  font-size: 0.78rem;
}

@media (max-width: 767.98px) {
  .main-header .container-fluid {
    align-items: flex-start;
    flex-direction: column;
  }

  .navbar-brand {
    max-width: 100%;
    margin-right: 0;
    white-space: normal;
  }

  .axiom-top-nav {
    justify-content: flex-start;
    width: 100%;
  }

  #status {
    align-self: flex-start;
    margin-left: 0 !important;
  }
}

html,
body,
.wrapper,
.content-wrapper {
  background: #05070d !important;
  color: #f8fafc !important;
}

.content-wrapper {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, #05070d 44%, #05070d 100%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0.08) 1px, transparent 1px, transparent 44px) !important;
}

.main-header,
.card,
.card-header,
.main-footer,
.info-box,
.table,
.raw-report {
  background: #0b1120 !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

.main-header,
.card,
.compact-info-box {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34) !important;
}

.navbar-brand,
.content-header h1,
.card-title,
.info-box-number,
.table,
.table th,
.table td,
.raw-report,
.main-footer,
.main-footer strong {
  color: #f8fafc !important;
}

#status,
.badge-light,
.form-control,
.axiom-top-nav a,
.telegram-nav a {
  background: #111827 !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.34) !important;
}

.form-control {
  box-shadow: none !important;
}

.form-control:focus {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 0.16rem rgba(96, 165, 250, 0.18) !important;
}

label,
.info-box-text,
.info-box-detail,
.text-muted,
.card-header,
.table thead th {
  color: #cbd5e1 !important;
}

.table thead th,
.table tbody tr:hover {
  background: #111827 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(30, 41, 59, 0.72) !important;
}

.table-striped tbody tr:nth-of-type(even) {
  background-color: rgba(15, 23, 42, 0.72) !important;
}

.btn-primary {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.axiom-top-nav a:hover,
.axiom-top-nav a.active,
.telegram-nav a:hover {
  background: #172554 !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.log-status-empty {
  background: #1e293b;
  color: #f8fafc;
}

.log-status-found {
  background: #713f12;
  color: #fef3c7;
}

.log-status-published {
  background: #14532d;
  color: #dcfce7;
}

.log-status-error {
  background: #7f1d1d;
  color: #fee2e2;
}

.content-wrapper {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76) 0%, rgba(238, 243, 247, 0.92) 40%, #eef3f7 100%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0.08) 1px, transparent 1px, transparent 44px);
}

.content .container-fluid,
.content-header .container-fluid,
.main-header .container-fluid {
  max-width: 1440px;
}

.chart {
  min-height: 270px;
  width: 100%;
  overflow: hidden;
}

.content-header {
  padding: 14px 0.5rem 10px;
}

.content-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #172033;
  letter-spacing: 0;
}

.badge {
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0.38rem 0.72rem;
}

.badge-light {
  background: #ffffff;
  color: #334155;
  border-color: #d9e1ea !important;
}

.card {
  margin-bottom: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.card-primary.card-outline {
  border-top: 3px solid #2563eb;
}

.card-header {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #edf1f5;
  background: #ffffff;
}

.card-title {
  color: #223044;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
}

.card-body {
  padding: 0.85rem;
}

.form-group {
  margin-bottom: 0.55rem;
}

label {
  color: #526174;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-control,
.btn {
  min-height: 38px;
  border-radius: 8px;
  padding: 0.36rem 0.62rem;
  font-size: 0.84rem;
}

.form-control {
  border-color: #d7dee8;
  color: #18212f;
  font-weight: 600;
  box-shadow: none;
}

.form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 0.16rem rgba(37, 99, 235, 0.16);
}

.btn-primary {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: 0 9px 18px rgba(37, 99, 235, 0.18);
  font-weight: 800;
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.compact-info-box {
  min-height: 66px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.compact-info-box .info-box-icon {
  width: 48px;
  font-size: 1.1rem;
  border-radius: 0;
}

.compact-info-box .info-box-content {
  padding: 0.35rem 0.55rem;
}

.info-box-text {
  color: #6c757d;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.info-box-number {
  color: #212529;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.info-box-detail {
  color: #6c757d;
  display: block;
  font-size: 0.72rem;
}

.raw-report {
  max-height: 420px;
  overflow: auto;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 1rem;
  color: #343a40;
  font-size: 0.72rem;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

#tradesTable .table-responsive {
  max-height: 460px;
  overflow: auto;
}

#tradesTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.table {
  margin-bottom: 0;
  background: #ffffff;
}

.table th,
.table td {
  white-space: nowrap;
  vertical-align: middle;
}

.table thead th {
  border-bottom-width: 1px;
  color: #526174;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  background: #f8fafc;
}

.table tbody tr:hover {
  background: #f9fbfd;
}

.compact-table,
.table-sm {
  font-size: 0.76rem;
}

.table-sm th,
.table-sm td {
  padding: 0.32rem 0.45rem;
}

.pnl-positive {
  color: #16803a;
  font-weight: 700;
}

.pnl-negative {
  color: #c82333;
  font-weight: 700;
}

.outcome-pill {
  display: inline-flex;
  min-width: 4.5rem;
  justify-content: center;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.outcome-win {
  background: #d4edda;
  color: #155724;
}

.outcome-loss {
  background: #f8d7da;
  color: #721c24;
}

.outcome-timeout {
  background: #fff3cd;
  color: #856404;
}

.log-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
}

.log-status-empty {
  color: #475569;
  background: #eef2f7;
}

.log-status-found {
  color: #92400e;
  background: #fef3c7;
}

.log-status-published {
  color: #166534;
  background: #dcfce7;
}

.log-status-error {
  color: #991b1b;
  background: #fee2e2;
}

#regimeTable h3 {
  margin: 0.75rem 0 0.35rem;
  color: #6c757d;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.main-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  color: #526174;
  font-size: 0.82rem;
}

.main-footer strong {
  font-weight: 800;
}

.footer-heart {
  color: #e11d48;
  margin: 0 0.18rem;
}

.telegram-page .content-wrapper {
  min-height: calc(100vh - 103px);
}

.telegram-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.telegram-nav a {
  border: 1px solid #d7dee8;
  border-radius: 999px;
  color: #526174;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.38rem 0.7rem;
}

.telegram-nav a:hover {
  border-color: #2563eb;
  color: #2563eb;
  text-decoration: none;
}

.telegram-layout {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.telegram-empty-state {
  color: #526174;
  font-weight: 700;
  padding: 1rem;
}

.telegram-result h2 {
  color: #172033;
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0.75rem 0 0.25rem;
}

.telegram-result p {
  color: #526174;
  font-weight: 600;
  margin-bottom: 1rem;
}

.admin-card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-route-card {
  display: flex;
  min-height: 188px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
  color: #172033;
  padding: 1rem;
  text-decoration: none;
}

.admin-route-card:hover {
  border-color: #2563eb;
  color: #172033;
  text-decoration: none;
  transform: translateY(-1px);
}

.admin-route-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 1.25rem;
}

.admin-route-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
}

.admin-route-detail {
  display: block;
  color: #526174;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

@media (max-width: 575.98px) {
  .content-header h1 {
    font-size: 1.12rem;
  }

  .card-body {
    padding: 0.65rem;
  }

  .chart {
    min-height: 220px;
  }

  .compact-info-box {
    min-height: 60px;
  }

  .info-box-number {
    font-size: 0.98rem;
  }

  .raw-report {
    max-height: 300px;
    font-size: 0.72rem;
  }

  .telegram-layout {
    grid-template-columns: 1fr;
  }

  .telegram-nav {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: flex-start;
  }

  .admin-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Final dark theme override. Keep this at the end so AdminLTE and page rules cannot override it. */
html,
body,
.wrapper,
.content-wrapper {
  background: #05070d !important;
  color: #f8fafc !important;
}

.content-wrapper {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, #05070d 44%, #05070d 100%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0.08) 1px, transparent 1px, transparent 44px) !important;
}

.main-header,
.card,
.card-header,
.main-footer,
.info-box,
.table,
.raw-report,
.admin-route-card {
  background: #0b1120 !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

.main-header,
.card,
.compact-info-box {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34) !important;
}

.navbar-brand,
.content-header h1,
.card-title,
.info-box-number,
.table,
.table th,
.table td,
.raw-report,
.main-footer,
.main-footer strong,
.admin-route-title {
  color: #f8fafc !important;
}

#status,
.badge-light,
.form-control,
.axiom-top-nav a,
.telegram-nav a {
  background: #111827 !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.34) !important;
}

.form-control {
  box-shadow: none !important;
}

.form-control:focus {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 0.16rem rgba(96, 165, 250, 0.18) !important;
}

label,
.info-box-text,
.info-box-detail,
.text-muted,
.card-header,
.table thead th,
.admin-route-detail {
  color: #cbd5e1 !important;
}

.table thead th,
.table tbody tr:hover {
  background: #111827 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(30, 41, 59, 0.72) !important;
}

.table-striped tbody tr:nth-of-type(even) {
  background-color: rgba(15, 23, 42, 0.72) !important;
}

.btn-primary {
  background: #2563eb !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.axiom-top-nav a:hover,
.axiom-top-nav a.active,
.telegram-nav a:hover {
  background: #172554 !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.admin-route-icon {
  background: #111827 !important;
}

.log-status-empty {
  background: #1e293b !important;
  color: #f8fafc !important;
}

.log-status-found {
  background: #713f12 !important;
  color: #fef3c7 !important;
}

.log-status-published {
  background: #14532d !important;
  color: #dcfce7 !important;
}

.log-status-error {
  background: #7f1d1d !important;
  color: #fee2e2 !important;
}
