.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 3rem;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 72px;
}

.admin-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* Form fields */
.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.field input[type="text"],
.field input[type="date"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--text-muted);
}

.field textarea {
  resize: vertical;
  line-height: 1.65;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a7570'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* Upload zone */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: 5px;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.upload-zone.drag-over {
  border-color: var(--text-muted);
  background: rgba(0, 0, 0, 0.02);
}

.upload-zone button {
  font-family: 'Lora', serif;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  padding: 0;
}

.upload-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.upload-preview-item {
  position: relative;
}

.upload-preview-item img,
.upload-preview-item video {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.preview-caption {
  width: 100%;
  font-family: 'Lora', serif;
  font-size: 0.72rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 3px 3px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

/* Links */
.link-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}

.link-row input {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.link-row input:focus {
  border-color: var(--text-muted);
}

.link-row-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
  line-height: 1;
  transition: color 0.15s;
}

.link-row-remove:hover {
  color: #c05050;
}

/* Buttons */
.btn-primary {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.15s;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  opacity: 0.85;
}

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

.btn-ghost {
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  align-items: center;
}

#form-status {
  margin-top: 0.75rem;
  font-size: 0.84rem;
  min-height: 1.2em;
}

.status-ok  { color: #4a8a4a; }
.status-err { color: #c05050; }

/* Admin event list */
.admin-event {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.admin-event:first-child {
  padding-top: 0;
}

.admin-event-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  letter-spacing: 0.02em;
}

.admin-event-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.admin-event-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-edit,
.btn-delete {
  font-family: 'Lora', serif;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-edit {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-edit:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-delete {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
}

.btn-delete:hover {
  color: #c05050;
  border-color: #e8c0c0;
}

#event-count {
  font-weight: 400;
  font-size: 0.9em;
}

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

  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 600px) {
  .admin-main {
    padding: 1.5rem 1rem;
  }
}
