* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f4ff; min-height: 100vh; }

@keyframes spin { to { transform: rotate(360deg); } }

header {
  background: linear-gradient(135deg, #005bff, #0041c4);
  color: white;
  display: flex; align-items: center; gap: 16px; padding: 20px 24px;
}
header a { color: white; text-decoration: none; font-size: 22px; line-height: 1; }
header h1 { font-size: 17px; font-weight: 600; }

.btn-hdr {
  background: rgba(255,255,255,0.18); color: white; padding: 8px 18px;
  border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; white-space: nowrap; transition: background .2s;
}
.btn-hdr:hover { background: rgba(255,255,255,0.32); }

.container { max-width: 920px; margin: 0 auto; padding: 32px 16px; }

.card {
  background: white; border-radius: 16px; padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07); margin-bottom: 20px;
}

.flash { padding: 12px 16px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px; font-size: 14px; color: #856404; }

/* ── Подтверждение скрытия ── */
.confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 9998;
  background: rgba(10,20,60,0.45); backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
}
.confirm-overlay.active { display: flex; }
.confirm-box {
  background: white; border-radius: 16px; padding: 28px 32px;
  text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  max-width: 280px; width: 90%;
}
.confirm-box p { font-size: 15px; color: #222; margin-bottom: 20px; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }
.confirm-btns button {
  padding: 9px 24px; border-radius: 8px; font-size: 14px;
  font-weight: 600; border: none; cursor: pointer; transition: background .2s;
}
.btn-confirm-yes { background: #e03535; color: white; }
.btn-confirm-yes:hover { background: #c00; }
.btn-confirm-no  { background: #f0f4ff; color: #333; }
.btn-confirm-no:hover { background: #dde8ff; }

/* ── Toast-уведомление об ошибке ── */
.toast-error {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  background: #fff0f0; border: 1.5px solid #e03535; color: #c00;
  padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  opacity: 0; transform: translateX(20px);
  transition: opacity .3s, transform .3s;
  pointer-events: none; max-width: 300px;
}
.toast-error.show { opacity: 1; transform: translateX(0); pointer-events: auto; }

/* ── Оверлей загрузки ── */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,20,60,0.55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-box {
  background: white; border-radius: 20px; padding: 36px 44px;
  text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  max-width: 320px; width: 90%;
}
.spinner {
  width: 48px; height: 48px; margin: 0 auto 20px;
  border: 4px solid #e8eeff; border-top-color: #005bff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
.loading-title { font-size: 16px; font-weight: 700; color: #111; margin-bottom: 6px; }
.loading-sub   { font-size: 13px; color: #888; }

.ref-icon { display: inline-block; line-height: 1; }
