* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0d1117;
  color: #e6edf3;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0d1117;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 35px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 14px;
}

.login-box h1 {
  font-size: 25px;
  margin: 0 0 10px;
}

.login-box p {
  color: #8b949e;
  margin-bottom: 25px;
}

.login-box input {
  width: 100%;
  padding: 13px;
  margin-bottom: 15px;
  border: 1px solid #30363d;
  border-radius: 7px;
  background: #0d1117;
  color: white;
}

.login-box button,
.section-heading button,
.form-actions button {
  padding: 11px 18px;
  border: 0;
  border-radius: 7px;
  background: #238636;
  color: white;
  font-weight: 600;
}

.login-box button {
  width: 100%;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  color: #ff7b72;
  font-size: 14px;
  margin-bottom: 15px;
}

.app {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 245px;
  min-width: 245px;
  min-height: 100vh;
  padding: 25px 15px;
  background: #161b22;
  border-right: 1px solid #30363d;
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  font-size: 23px;
  padding: 0 12px;
  margin: 0 0 30px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c9d1d9;
}

.nav-item:hover {
  background: #21262d;
}

.nav-item.active {
  background: #1f3b2b;
  color: #7ee787;
}

.logout {
  margin-top: auto;
  padding: 12px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 7px;
  color: #ff7b72;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid #30363d;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 27px;
}

.topbar p {
  margin: 0;
  color: #8b949e;
}

.topbar span {
  color: #8b949e;
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 22px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 11px;
  min-height: 115px;
}

.stat-card span {
  display: block;
  color: #8b949e;
  font-size: 13px;
  margin-bottom: 15px;
}

.stat-card strong {
  font-size: 24px;
}

.stat-card.profit {
  border-color: #238636;
  background: #14251b;
}

.stat-card.profit strong {
  color: #7ee787;
}

.hint {
  color: #8b949e;
  font-size: 13px;
  margin-top: 22px;
}

.data-section {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 11px;
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.message {
  padding: 12px;
  border-radius: 7px;
  background: #21262d;
  color: #7ee787;
}

.edit-form {
  padding: 20px;
  margin-bottom: 25px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 9px;
}

.edit-form h3 {
  margin: 0 0 20px;
}

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

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #c9d1d9;
  font-size: 13px;
}

.form-grid input:not([type="checkbox"]),
.form-grid select {
  width: 100%;
  padding: 11px;
  border: 1px solid #30363d;
  border-radius: 7px;
  background: #161b22;
  color: white;
}

.form-grid input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.form-actions .secondary {
  background: #30363d;
  color: white;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #30363d;
}

th {
  color: #8b949e;
  font-weight: 600;
  background: #0d1117;
}

td {
  color: #c9d1d9;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: #30363d;
  color: white;
  font-size: 12px;
}

.actions button.delete {
  color: #ff7b72;
}

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

@media (max-width: 700px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    min-height: auto;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logout {
    margin-top: 15px;
  }

  .content {
    padding: 18px;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* Фильтр дат */
.date-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: -10px 0 25px;
  padding: 16px 18px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
}

.date-filters select,
.date-filters input {
  min-width: 170px;
  padding: 11px 13px;
  border: 1px solid #30363d;
  border-radius: 7px;
  background: #0d1117;
  color: #e6edf3;
  outline: none;
}

.date-filters select:focus,
.date-filters input:focus {
  border-color: #388bfd;
}

.date-filters select {
  cursor: pointer;
}

@media (max-width: 700px) {
  .date-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .date-filters select,
  .date-filters input {
    width: 100%;
  }
}
/* Улучшенные таблицы */
.table-wrap {
  border: 1px solid #30363d;
  border-radius: 9px;
  background: #0d1117;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 15px;
  background: #21262d;
  color: #aab4c0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

td {
  padding: 14px 15px;
  border-bottom: 1px solid #21262d;
}

tbody tr:hover {
  background: #1c2129;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.actions button {
  transition: background 0.2s;
}

.actions button:hover {
  background: #484f58;
}

.actions button.delete:hover {
  background: #3d2024;
}
.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.export-button {
  padding: 11px 18px;
  border: 1px solid #30363d;
  border-radius: 7px;
  background: #21262d;
  color: #e6edf3;
  font-weight: 600;
  cursor: pointer;
}

.export-button:hover {
  background: #30363d;
}

@media (max-width: 700px) {
  .section-actions {
    width: 100%;
    flex-direction: column;
  }

  .section-actions button {
    width: 100%;
  }
}
/* Adapted from the uploaded finance-admin React stylesheet. */
.loading-page{display:grid;place-items:center;min-height:100vh;color:#8b949e}
.summary-section{margin-top:28px}
.summary-section h2{margin:28px 0 14px;font-size:18px}
.edit-form input[readonly]{opacity:.55;cursor:not-allowed}
.data-section .error{padding:12px;border:1px solid #7e2932;border-radius:6px}
.section-actions button:not(.export-button){background:#238636}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #58a6ff;outline-offset:2px}
