/* ===== Theme tokens ===== */
:root {
  --brand: #1b5e20;
  --brand-2: #2e7d32;
  --accent: #fbc02d;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #2c2f33;
  --muted: #7b8794;
  --border: #e6e9ef;
  --shadow: 0 6px 24px rgba(20, 40, 30, .08);
}
[data-bs-theme="dark"] {
  --brand: #66bb6a;
  --brand-2: #43a047;
  --accent: #ffca28;
  --bg: #15191e;
  --card: #1e242b;
  --text: #e4e7ea;
  --muted: #9aa5b1;
  --border: #2c343d;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

* { transition: background-color .35s ease, color .25s ease, border-color .35s ease; }
body {
  font-family: 'Public Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-2); --bs-btn-hover-border-color: var(--brand-2); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color:#fff; }
a { color: var(--brand); }

/* ===== Theme toggle button ===== */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 1050;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer; font-size: 18px;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); }

/* ===== Auth ===== */
.auth-body { display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(27,94,32,.18), transparent),
              radial-gradient(1000px 500px at 110% 110%, rgba(251,192,45,.18), transparent), var(--bg); }
.auth-wrap { width: 100%; max-width: 420px; padding: 16px; }
.auth-card { background: var(--card); border:1px solid var(--border); border-radius: 18px; padding: 34px; box-shadow: var(--shadow); }
.auth-brand { text-align: center; }
.auth-brand img { height: 70px; object-fit: contain; }
.auth-brand h3 { color: var(--brand); margin: 12px 0 0; font-weight: 700; }
.btn-glow { box-shadow: 0 8px 20px rgba(27,94,32,.35); }
.cursor-pointer { cursor: pointer; }

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex: 0 0 260px; background: var(--card);
  border-right: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { display:flex; align-items:center; gap:10px; padding: 6px 8px 18px; font-weight:700; color: var(--brand); }
.sidebar .brand img { height: 38px; }
.nav-link-side { display:flex; align-items:center; gap:12px; padding: 11px 14px; border-radius: 10px; color: var(--text); text-decoration: none; margin-bottom: 4px; font-weight: 500; }
.nav-link-side i { font-size: 18px; }
.nav-link-side:hover { background: rgba(27,94,32,.08); color: var(--brand); transform: translateX(3px); }
.nav-link-side.active { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display:flex; align-items:center; gap:12px; padding: 14px 22px; background: var(--card); border-bottom:1px solid var(--border); position: sticky; top:0; z-index: 20; }
.content { padding: 22px; flex: 1; }

/* ===== Cards / motion ===== */
.card { background: var(--card); border:1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.stat-card { padding: 18px; border-radius: 14px; }
.stat-card .icon { width: 46px; height: 46px; border-radius: 12px; display:grid; place-items:center; font-size: 22px; }
.stat-card h3 { margin: 10px 0 0; font-weight: 700; }
.animate-pop { animation: pop .5s cubic-bezier(.2,.8,.2,1) both; }
.fade-up { opacity: 0; transform: translateY(14px); animation: fadeUp .55s ease forwards; }
.fade-up:nth-child(2){animation-delay:.06s}.fade-up:nth-child(3){animation-delay:.12s}.fade-up:nth-child(4){animation-delay:.18s}
@keyframes pop { from { opacity:0; transform: scale(.94) } to { opacity:1; transform: scale(1) } }
@keyframes fadeUp { to { opacity:1; transform: none } }
@media (prefers-reduced-motion: reduce) { *{ animation: none !important; transition: none !important } }

/* ===== Gallery ===== */
.gallery-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 16px; }
.gallery-item { position: relative; border-radius: 12px; overflow: hidden; border:1px solid var(--border); background: var(--card); cursor: grab; box-shadow: var(--shadow); }
.gallery-item img { width: 100%; height: 150px; object-fit: cover; display:block; }
.gallery-item .meta { padding: 8px 10px; font-size: 13px; display:flex; justify-content:space-between; align-items:center; }
.gallery-item.sortable-ghost { opacity: .4; }
.gallery-item .drag-badge { position:absolute; top:8px; left:8px; background: rgba(0,0,0,.55); color:#fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 30px; text-align:center; color: var(--muted); cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: rgba(27,94,32,.06); color: var(--brand); }

/* ===== Mobile ===== */
.menu-btn { display:none; background:none; border:none; font-size:22px; color: var(--text); }
@media (max-width: 992px) {
  .sidebar { position: fixed; left: -280px; z-index: 1040; transition: left .3s ease; }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-block; }
  .backdrop { position: fixed; inset:0; background: rgba(0,0,0,.4); z-index: 1030; display:none; }
  .backdrop.show { display:block; }
}
