:root {
  --sage: #8ba888;
  --sage-dark: #6d8a6a;
  --champagne: #f3e9dc;
  --white: #ffffff;
  --text: #3a3a35;
  --error: #b3564a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--champagne) 0%, var(--white) 40%);
  color: var(--text);
  min-height: 100vh;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.page-wide { max-width: 900px; }

.hero {
  text-align: center;
  padding: 24px 0 12px;
}

.hero-compact { padding: 12px 0; }

.hero h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
  color: var(--sage-dark);
}

.subtitle {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 14px;
}

.btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--sage-dark);
  color: white;
}

.btn-secondary {
  background: var(--champagne);
  color: var(--text);
}

.btn-link {
  background: none;
  color: var(--sage-dark);
  text-decoration: underline;
  font-weight: 500;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
}

.file-label { text-align: center; }

.hint {
  text-align: center;
  color: #777;
  font-size: 0.85rem;
  margin: 6px 0;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: -6px;
}

.message {
  text-align: center;
  font-weight: 600;
  padding: 10px;
  border-radius: 10px;
  background: var(--champagne);
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  gap: 8px;
}

.file-list .file-status { font-size: 0.8rem; color: #888; white-space: nowrap; }
.file-list .file-status.ok { color: var(--sage-dark); }
.file-list .file-status.error { color: var(--error); }

.progress-wrap { margin-bottom: 14px; }

.progress-bar {
  background: #eee;
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
}

.progress-fill {
  background: var(--sage-dark);
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
}

.progress-label {
  font-size: 0.8rem;
  color: #777;
  margin: 6px 0 0;
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.gallery-grid .thumb {
  position: relative;
  padding-top: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  cursor: pointer;
}

.gallery-grid .thumb img,
.gallery-grid .thumb video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.gallery-grid .video-badge {
  position: absolute;
  bottom: 4px; right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 92vw;
  max-height: 88vh;
}

.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
}

.stats-card {
  display: flex;
  gap: 24px;
  justify-content: space-around;
  text-align: center;
}

.stats-card strong {
  display: block;
  font-size: 1.4rem;
  color: var(--sage-dark);
}

.stats-card span {
  font-size: 0.8rem;
  color: #777;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-actions .btn { margin-bottom: 0; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.admin-table .small-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  margin-right: 4px;
}
