:root {
  --blue: #0b2a84;
  --muted: #8b8b8b;
  --border: #e9e9e9;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #fff;
  color: #111;
}

.auth-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 520px;
  max-width: 92vw;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: .2px;
}

.brand-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #5bc0ff 0 30%, #0b2a84 35% 100%);
}

.subtitle {
  margin: 0;
  color: #9aa7d6;
  font-size: 12px;
  line-height: 1.3;
}

.form {
  margin-top: 22px;
  text-align: left;
}

.label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 0 16px;
  outline: none;
  box-sizing: border-box;
  font-size: 14px;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 42, 132, .10);
}

.btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 23px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

.btn:hover {
  filter: brightness(1.03);
}

.row {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

.link {
  color: var(--blue);
  text-decoration: none;
}

.errors {
  margin: 10px 0 0;
  color: #b00020;
  font-size: 13px;
}

/* Кнопка "в режим админа" на странице логина */
.admin-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(11, 42, 132, .08);
}

.admin-toggle:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 22px rgba(11, 42, 132, .12);
}

/* Модалка */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 40, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 520px;
  max-width: 92vw;
  background: #fff;
  border-radius: 18px;
  padding: 16px 16px 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  color: var(--blue);
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 18px;
}

.modal-x {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #111;
}

.modal-x:hover {
  border-color: var(--blue);
}

.modal-subtitle {
  margin: 6px 0 0;
  color: #9aa7d6;
  font-size: 12px;
}

.modal-form {
  margin-top: 12px;
}

/* Плитки */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

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

.admin-tile {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 18px;
  padding: 14px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(11, 42, 132, .08);

  /* NEW: layout плитки + иконка справа */
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-tile:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 26px rgba(11, 42, 132, .12);
}

.tile-main {
  flex: 1;
}

.tile-title {
  color: var(--blue);
  font-weight: 800;
  font-size: 14px;
}

.tile-sub {
  margin-top: 6px;
  color: #9aa7d6;
  font-size: 12px;
}

/* NEW: иконка-стрелка и активность */
.tile-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  background: rgba(11, 42, 132, .06);
  transition: transform .18s ease, background .18s ease;
}

.admin-tile.is-active {
  border-color: var(--blue);
  box-shadow: 0 10px 26px rgba(11, 42, 132, .12);
}

.admin-tile.is-active .tile-icon {
  background: rgba(11, 42, 132, .10);
  transform: rotate(180deg);
}

/* Панель */
.admin-panel {
  margin-top: 14px;
  text-align: left;
  padding-top: 8px;
  border-top: 1px solid rgba(11, 42, 132, .12);
}

/* Ошибки поля */
.field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #b00020;
}

/* Пароль + глаз */
.pw-wrap {
  position: relative;
}

.pw-wrap .pw-input {
  padding-right: 44px;
}

.pw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #0b2a84;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.pw-eye:hover {
  background: rgba(11, 42, 132, .06);
}

/* NEW: Пользователи (2 колонки) */
.users-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.user-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(11, 42, 132, .06);
}

.user-name {
  font-weight: 800;
  color: var(--blue);
  font-size: 14px;
  line-height: 1.2;
}

.user-meta {
  margin-top: 6px;
  color: #9aa7d6;
  font-size: 12px;
  line-height: 1.35;
}

/* Корзинка */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #b00020;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  border-color: #b00020;
  box-shadow: 0 8px 22px rgba(176, 0, 32, .10);
}

/* Плавное раскрытие панелей */
.admin-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .28s ease, opacity .18s ease, transform .18s ease;
  pointer-events: none;

}

.admin-panel.is-open {
  max-height: 2000px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 23px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}