body {
  transition: background-color 0.3s, color 0.3s;
}

.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.dark-mode .form-control,
.dark-mode .table {
  background-color: #1e1e1e;
  color: #ffffff;
  border-color: #444;
}

.dark-mode .table-striped tbody tr:nth-of-type(odd) {
  background-color: #222;
}

.table td,
.table th {
  vertical-align: middle;
}

.btn-primary {
  background-color: #2c3e50;
  border-color: #2c3e50;
}

.btn-primary:hover {
  background-color: #1a252f;
  border-color: #1a252f;
}

.form-check.form-switch .form-check-input {
  width: 2.5rem;
  height: 1.3rem;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.switch-label {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  line-height: 1;
}

h6 {
  font-weight: 500;
  font-size: 16px;
}

/* Desktop results */
.result-card {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.result-card .result-block {
  flex: 1;
  padding: 1rem;
  text-align: center;
  border-right: 1px solid #ccc;
  background: #fff;
}

.result-card .result-block:last-child {
  border-right: none;
}

.result-card h6 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.result-card strong {
  display: block;
  font-size: 18px;
  font-weight: bold;
  margin-top: 4px;
}

.dark-mode .result-card {
  background: #1e1e1e;
  border-color: #444;
}

.dark-mode .result-block {
  background: #2a2a2a;
  color: #fff;
  border-color: #444;
}

@media (max-width: 576px) {
  .desktop-result {
    display: none !important;
  }

  .dark-mode .result-card.card td,
  .dark-mode .result-card.card th {
    background-color: #1e1e1e;
    color: #ffffff;
    border-color: #444;
  }
}

@media (min-width: 577px) {
  .mobile-result {
    display: none !important;
  }

  .result-card {
    display: flex;
    gap: 1px;
  }
}

@media (max-width: 576px) {
  .table th,
  .table td {
    font-size: 12px;
    padding: 4px;
  }

  .table thead tr th {
    font-size: 0;
    position: relative;
  }

  .table thead tr th::before {
    display: block;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.1;
  }

  .table thead tr th::after {
    display: block;
    font-size: 10px;
    color: #888;
    line-height: 1;
  }

  .table thead tr th:nth-child(1)::before { content: "Неделя"; }
  .table thead tr th:nth-child(1)::after  { content: "№"; }
  .table thead tr th:nth-child(2)::before { content: "Баланс"; }
  .table thead tr th:nth-child(2)::after  { content: "в начале"; }
  .table thead tr th:nth-child(3)::before { content: "Проценты"; }
  .table thead tr th:nth-child(3)::after  { content: "доход"; }
  .table thead tr th:nth-child(4)::before { content: "Пополнение"; }
  .table thead tr th:nth-child(4)::after  { content: "или снятие"; }
  .table thead tr th:nth-child(5)::before { content: "Баланс"; }
  .table thead tr th:nth-child(5)::after  { content: "в конце"; }
  .table thead tr th:nth-child(6)::before { content: "Прибыль"; }
  .table thead tr th:nth-child(6)::after  { content: "накопл."; }

  body.en .table thead tr th:nth-child(1)::before { content: "Week"; }
  body.en .table thead tr th:nth-child(1)::after  { content: "#"; }
  body.en .table thead tr th:nth-child(2)::before { content: "Balance"; }
  body.en .table thead tr th:nth-child(2)::after  { content: "Start"; }
  body.en .table thead tr th:nth-child(3)::before { content: "Interest"; }
  body.en .table thead tr th:nth-child(3)::after  { content: "Earned"; }
  body.en .table thead tr th:nth-child(4)::before { content: "Deposit"; }
  body.en .table thead tr th:nth-child(4)::after  { content: "or W/D"; }
  body.en .table thead tr th:nth-child(5)::before { content: "Balance"; }
  body.en .table thead tr th:nth-child(5)::after  { content: "End"; }
  body.en .table thead tr th:nth-child(6)::before { content: "Profit"; }
  body.en .table thead tr th:nth-child(6)::after  { content: "Total"; }
}
