:root {
  --brand-blue: #2e9bff;
  --brand-blue-dark: #1d7fe0;
  --navy: #0f1e44;
  --navy-soft: #26355e;
  --ink: #1c2536;
  --muted: #667089;
  --bg: #eef2f8;
  --surface: #ffffff;
  --line: #dbe2ee;
  --danger-bg: #fdecec;
  --danger-line: #f3b4b4;
  --danger-ink: #a12626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 30, 68, .06), 0 8px 24px rgba(15, 30, 68, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* ---------- Шапка ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 30, 68, .03);
}
.topbar__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--brand-blue);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--navy);
  min-width: 0;
}
.brand__logo {
  height: 40px;
  width: auto;
  display: block;
  flex: none;
}
.brand__title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .1px;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 2px;
}

/* ---------- Основная область ---------- */
.content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ---------- Дашборд ---------- */
.dashboard__head { margin-bottom: 28px; }
.dashboard__title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
}
.dashboard__sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  display: flex;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-blue);
  box-shadow: 0 2px 4px rgba(15,30,68,.08), 0 14px 32px rgba(15,30,68,.12);
}
.card__accent {
  flex: none;
  width: 6px;
  background: var(--brand-blue);
}
.card__body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card__title {
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
}
.card__desc {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Пустое состояние ---------- */
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
}
.empty__title {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
}
.empty__text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Вход ---------- */
.page-login .content {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login { width: 100%; display: flex; justify-content: center; }
.login__card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 30px;
}
.login__heading {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.login__hint {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-soft);
}
.field__input {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field__input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(46, 155, 255, .18);
  background: #fff;
}

/* ---------- Кнопки ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 18px;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn--primary {
  background: var(--brand-blue);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-blue-dark); }
.btn--primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(46,155,255,.35);
}
.btn--block { width: 100%; }
.btn--ghost {
  background: transparent;
  color: var(--navy-soft);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue-dark);
}

/* ---------- Оповещения ---------- */
.alert {
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}
.alert--error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  color: var(--danger-ink);
}

/* ---------- Подвал ---------- */
.footer {
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer span {
  display: block;
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 24px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 560px) {
  .brand__title { font-size: 15px; white-space: normal; }
  .content { padding: 28px 16px; }
  .topbar__inner { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
