* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

.container-narrow {
  max-width: 420px;
}

h1 {
  margin: 0 0 16px 0;
  font-size: 28px;
}

.desc {
  margin: 0 0 32px 0;
  color: #555;
  white-space: pre-wrap;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 14px 20px;
  background: #0b5fff;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
}

.btn:hover { background: #094ad1; }

.btn-disabled {
  background: #c9c9c9;
  color: #fff;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}

.form label {
  font-weight: 600;
  margin-top: 8px;
}

.form input[type="text"],
.form input[type="password"],
.form textarea {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
}

.form input[type="file"] {
  padding: 6px 0;
}

.fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px 16px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fieldset legend {
  font-weight: 700;
  padding: 0 6px;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

.alert-success {
  background: #e6f7ec;
  color: #1d6f3a;
  border: 1px solid #b6e1c5;
}

.alert-error {
  background: #fdecec;
  color: #a3221c;
  border: 1px solid #f3b9b6;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.inline-form { margin: 0; }

.btn-link {
  background: none;
  border: none;
  color: #0b5fff;
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  text-decoration: underline;
}

.current-file {
  margin: 4px 0 0 0;
  font-size: 14px;
}

.current-file a {
  color: #0b5fff;
  word-break: break-all;
}

.muted { color: #888; }

.btn-danger {
  align-self: flex-start;
  background: #fff;
  color: #a3221c;
  border: 1px solid #f3b9b6;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}

.btn-danger:hover {
  background: #fdecec;
}

.hidden-form { display: none; }

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stats {
  margin-top: 32px;
  background: #fff;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}

.stats h2 {
  margin: 0 0 12px 0;
  font-size: 20px;
}

.stats-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.stats-list li {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.stats-list li:last-child { border-bottom: none; }
