* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #222;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Верхняя панель */
.topbar {
  background: #111827;
  color: #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.logo a {
  font-weight: 700;
  color: #e5e7eb;
  font-size: 20px;
}

.nav-links a {
  margin-left: 16px;
  color: #e5e7eb;
}

.nav-username {
  margin-right: 16px;
  opacity: 0.8;
}

/* Основная область */
.page {
  padding: 32px 0 48px;
}

/* Карточки */
.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}

.card-title {
  font-size: 22px;
  margin: 0 0 16px;
}

.card-subtitle {
  margin-top: -8px;
  margin-bottom: 16px;
  color: #6b7280;
  font-size: 14px;
}

/* Формы */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #374151;
}

input[type="text"],
input[type="password"],
textarea,
input[type="file"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: #6b7280;
}

.btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.btn + .btn {
  margin-left: 8px;
}

/* Сообщения */
.flash-container {
  margin-bottom: 16px;
}

.flash {
  background: #ecfdf3;
  border: 1px solid #4ade80;
  color: #166534;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
}

/* Списки файлов/обзоров */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item span {
  word-break: break-all;
}

/* Низ страницы */
.footer {
  border-top: 1px solid #e5e7eb;
  padding: 12px 0 20px;
  font-size: 13px;
  color: #6b7280;
  background: #f9fafb;
}

/* Центрирование формы логина */
.page-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.progress-modal {
  background: #ffffff;
  padding: 24px 28px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.progress-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-inner {
  position: absolute;
  left: -40%;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 999px;
  background: #3b82f6;
  animation: progress-stripes 1.1s linear infinite;
}

.progress-hint {
  font-size: 13px;
  color: #6b7280;
}

@keyframes progress-stripes {
  0%   { left: -40%; }
  100% { left: 100%; }
}

