:root {
  --primary: #007445;
  --primary-dark: #005c37;
  --secondary: #FFF200;
  --bg: #f5f7f6;
  --card-bg: #ffffff;
  --text: #1e2a26;
  --text-muted: #667770;
  --border: #e2e8e5;
  --danger: #d33;
  --radius: 0.65rem;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header.topbar {
  background: var(--primary);
  color: #fff;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
}

header.topbar .brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--secondary);
}

header.topbar nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 1.2rem;
  font-size: 0.92rem;
  opacity: 0.9;
}
header.topbar nav a:hover { opacity: 1; text-decoration: underline; }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.search-box {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #1e2a26; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform .12s ease;
}
.card:hover { transform: translateY(-2px); }

.card .thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: #eef1f0 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.card .body { padding: 0.8rem 0.9rem; }
.card .title { font-weight: 700; font-size: 0.95rem; margin: 0 0 0.25rem; }
.card .meta { font-size: 0.8rem; color: var(--text-muted); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-green { background: #e5f5ee; color: var(--primary); }
.badge-yellow { background: #fffbdb; color: #8a7c00; }
.badge-red { background: #fdeaea; color: var(--danger); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}
.gallery .thumb-item {
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef1f0 center/cover no-repeat;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 4px; }
.lightbox .close {
  position: absolute; top: 1.2rem; right: 1.5rem;
  color: #fff; font-size: 1.8rem; cursor: pointer; background: none; border: none;
}
.lightbox .cap { color: #fff; margin-top: 0.8rem; font-size: 0.85rem; text-align: center; max-width: 80vw; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
}
table.data-table th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 0.6rem 0.8rem;
}
table.data-table td { padding: 0.55rem 0.8rem; border-top: 1px solid var(--border); }
table.data-table tr:hover td { background: #f7faf8; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 22px; height: 22px;
  border: 3px solid #dde5e2;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 1.2rem; right: 1.2rem;
  background: var(--text);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: all .2s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--danger); }

form.admin-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
form.admin-form label { font-size: 0.85rem; font-weight: 600; }
form.admin-form input, form.admin-form select, form.admin-form textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
}
.drop-zone.drag { border-color: var(--primary); background: #f2f9f5; }

.preview-strip { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.preview-strip img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow); }
