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

.wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}

h1 {
  text-align: center;
  margin-bottom: 28px;
}

/* ---------- главная ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 24px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 15px;
  color: #555;
  text-align: center;
  max-width: 220px;
}

.footer {
  margin-top: 32px;
  text-align: center;
}

.footer a,
.footer .logout-link {
  color: #444;
  text-decoration: none;
}

.footer a:hover,
.footer .logout-link:hover {
  text-decoration: underline;
}

.logout-form {
  display: inline;
}

.logout-link {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-family: inherit;
  line-height: inherit;
  vertical-align: baseline;
  cursor: pointer;
}

.back-link {
  display: inline-flex;
  margin-bottom: 12px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  color: #111827;
  text-decoration: underline;
}

/* ---------- panel ---------- */

.panel {
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-title {
  margin: 0;
  font-size: 20px;
}

/* ---------- table ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.table th {
  font-weight: 600;
}

.money-suffix {
  color: #6b7280;
}

/* ---------- buttons ---------- */

.button-secondary,
.button-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  box-sizing: border-box;
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.button-secondary {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  box-shadow: none;
}

.button-success {
  border: 1px solid #15803d;
  background: #16a34a;
  color: #fff;
  box-shadow: 0 5px 14px rgba(0,0,0,0.16);
}

.button-secondary:hover {
  background: #f9fafb;
  box-shadow: 0 5px 14px rgba(0,0,0,0.08);
}

.button-secondary:hover,
.button-success:hover {
  transform: translateY(-2px);
}

.button-success:hover {
  box-shadow: 0 5px 14px rgba(0,0,0,0.19);
}

/* ---------- form ---------- */

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  box-sizing: border-box;
}

.form-group select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ddd;
  box-sizing: border-box;
  background: #fff;
}




/* ---------- messages ---------- */

.messages {
  margin: 0;
  padding-left: 20px;
}

/* ---------- responsive ---------- */

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

  .card {
    min-height: 180px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    padding: 18px;
    border-radius: 16px;
  }

  h1 {
    font-size: 22px;
  }

  .card-title {
    font-size: 18px;
  }

  .card-desc {
    font-size: 14px;
  }

  .footer {
    margin-top: 18px;
  }

  .panel {
    padding: 18px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  max-width: 420px;
  width: 90%;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.16);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  color: #555;
}

.modal-close:hover {
  transform: none;
  box-shadow: none;
  color: #111;
}

.table-row {
  position: relative;
  transition: background 0.12s ease;
}

.table-row:hover {
  background: #f9fafb;
}

.row-actions {
  width: 40px;
  text-align: right;
}

.delete-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.table-row:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  color: #374151;
}

.filters-panel {
  margin-bottom: 20px;
}

.filters-grid {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.filters-grid .form-group {
  flex: 1 1 220px;
  margin-bottom: 0;
}

.total-profit {
  margin: 18px 0 0;
}
