* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #28527e 0%, #234b74 55%, #1c3f63 100%);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  padding: 16px;
}
.auth-card {
  background: #eaf1f7;
  border: 1px solid #d7e3ee;
  border-radius: 8px;
  padding: 42px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 16px 40px rgba(10,25,45,.45);
  text-align: center;
}
.logo { max-width: 200px; margin-bottom: 20px; }
h1, h2 {
  color: #316397;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: .4px;
}
h1 { font-size: 18px; }
h2 { font-size: 20px; }
.muted { color: #5f7385; font-size: 14px; margin-bottom: 22px; }
input {
  width: 100%; padding: 13px 16px; margin-bottom: 14px;
  border: 1px solid #cddeeb; border-radius: 6px;
  font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
  background: #fff; color: #31506b;
}
input:focus { border-color: #5599c3; box-shadow: 0 0 0 3px rgba(85,153,195,.15); }
button {
  width: 100%; padding: 14px;
  border: none; border-radius: 6px;
  background: #5599c3;
  color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 14px rgba(85,153,195,.35);
  transition: transform .15s, box-shadow .15s, background .15s;
}
button:hover { background: #4a89b2; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(85,153,195,.45); }
button:active { transform: translateY(0); }
.error { color: #ff4650; font-size: 14px; min-height: 20px; margin-top: 10px; }

/* ===== Дашборд «Статистика платежей» — на всю ширину экрана ===== */
body.dash-page {
  display: block;
  background: #e6edf4;
  padding: 0;
  min-height: 100vh;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  height: 64px;
  padding: 0 24px;
  background: #28527e;
  box-shadow: 0 2px 12px rgba(10,25,45,.25);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo-top { max-height: 40px; }
.topbar-title { color: #fff; font-size: 20px; font-weight: 600; letter-spacing: .3px; }
.btn-ghost {
  width: auto; padding: 8px 18px;
  background: transparent; border: 1px solid rgba(255,255,255,.55); border-radius: 5px;
  color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); box-shadow: none; transform: none; }
.dash-main { padding: 22px 28px 40px; max-width: 100%; }
.period-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 20px; }
.period-presets { display: flex; gap: 8px; }
.period-btn {
  width: auto; padding: 9px 16px;
  background: #fff; color: #31506b; font-size: 14px; font-weight: 500;
  border: 1px solid #cddeeb; border-radius: 6px;
  box-shadow: none; cursor: pointer;
}
.period-btn:hover { background: #f2f7fb; box-shadow: none; transform: none; }
.period-btn.active { background: #5599c3; border-color: #5599c3; color: #fff; }
.period-custom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.period-custom label { color: #5f7385; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.period-custom input[type=date] {
  width: auto; padding: 8px 10px; margin-bottom: 0;
  border: 1px solid #cddeeb;
  background: #fff; border-radius: 5px;
}
.btn-small {
  width: auto; padding: 9px 18px; font-size: 14px;
  border-radius: 5px;
}
.table-card {
  background: #fff;
  border: 1px solid #d7e3ee;
  border-radius: 6px;
  overflow: hidden;
}
.table-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid #e4edf4;
}
.table-meta #range-label { color: #31506b; font-size: 15px; font-weight: 500; }
.table-scroll { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  text-align: left; padding: 11px 16px;
  border-bottom: 1px solid #eef3f8;
  white-space: nowrap;
}
th { background: #f2f7fb; color: #5f7385; font-weight: 600; position: sticky; top: 0; }
td { color: #31506b; }
tbody tr:hover td { background: #f7fafc; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.badge.ok { background: #eaf0db; color: #6a8a2a; }
.badge.bad { background: #fde7e8; color: #d84a52; }
.badge.warn { background: #fdf3e0; color: #b07a2a; }
.reason { color: #d84a52; white-space: normal; min-width: 140px; }
@media (max-width: 640px) {
  .period-row { flex-direction: column; align-items: stretch; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .dash-main { padding: 14px 12px 30px; }
}
/* ===== Таблица без горизонтального скролла: переносы в длинных колонках ===== */
.table-scroll { overflow-x: hidden; }
td:nth-child(3), th:nth-child(3),
td:nth-child(4), th:nth-child(4),
td:nth-child(5), th:nth-child(5),
td:nth-child(9), th:nth-child(9) {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
th:nth-child(1), td:nth-child(1) { width: 130px; }
th:nth-child(2), td:nth-child(2) { width: 110px; }
th:nth-child(3), td:nth-child(3) { width: 100px; }
th:nth-child(4), td:nth-child(4) { width: 200px; }
th:nth-child(5), td:nth-child(5) { width: 220px; }
th:nth-child(6), td:nth-child(6) { width: 90px; }
th:nth-child(7), td:nth-child(7) { width: 120px; }
th:nth-child(8), td:nth-child(8) { width: 110px; }
th:nth-child(9), td:nth-child(9) { width: 170px; }
