/* The Oak & Bean — admin panel */
:root {
  --a-green-900: #14251d;
  --a-green-700: #244433;
  --a-green-500: #3c6b52;
  --a-gold: #c9a24b;
  --a-bg: #f4f2ec;
  --a-ink: #23211c;
  --a-muted: #77756c;
  --a-line: #e2ddd0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--a-bg);
  color: var(--a-ink);
  line-height: 1.55;
}
a { color: var(--a-green-500); }

.admin-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--a-green-900);
  color: #e9e3d5;
  padding: 26px 18px;
  display: flex; flex-direction: column;
}
.sidebar .logo {
  font-family: 'Iowan Old Style', Palatino, Georgia, serif;
  font-size: 1.25rem; color: #fff; margin-bottom: 4px;
}
.sidebar .logo .mark { color: var(--a-gold); }
.sidebar .sub { font-size: 0.75rem; color: rgba(233,227,213,0.55); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 28px; }
.sidebar nav a {
  display: flex; align-items: center; justify-content: space-between;
  color: #d6cfbe; text-decoration: none;
  padding: 11px 14px; border-radius: 6px; margin-bottom: 4px;
  font-size: 0.94rem;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: var(--a-green-500); color: #fff; }
.sidebar .badge {
  background: var(--a-gold); color: #23180a; font-size: 0.72rem; font-weight: 700;
  border-radius: 20px; padding: 1px 8px;
}
.sidebar .spacer { flex: 1; }
.sidebar .foot { font-size: 0.8rem; }
.sidebar .foot a { color: rgba(233,227,213,0.7); }
.sidebar form { margin: 0; }
.sidebar .logout {
  width: 100%; text-align: left; background: none; border: 0; color: #d6cfbe;
  padding: 11px 14px; border-radius: 6px; cursor: pointer; font-size: 0.94rem;
}
.sidebar .logout:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* Content */
.content { flex: 1; padding: 34px 40px; max-width: 900px; }
.content h1 { font-family: 'Iowan Old Style', Palatino, Georgia, serif; font-size: 1.9rem; margin: 0 0 4px; color: var(--a-green-900); }
.page-sub { color: var(--a-muted); margin: 0 0 28px; }

.card {
  background: #fff; border: 1px solid var(--a-line); border-radius: 10px;
  padding: 24px 26px; margin-bottom: 22px;
}
.card h2 { font-size: 1.1rem; margin: 0 0 16px; color: var(--a-green-700); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: #444; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d5cfc2; border-radius: 6px;
  font-family: inherit; font-size: 0.95rem; background: #fbfaf6; color: var(--a-ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--a-green-500); box-shadow: 0 0 0 3px rgba(60,107,82,0.12); }
.field textarea { min-height: 92px; resize: vertical; }

.btn {
  display: inline-block; background: var(--a-green-500); color: #fff; border: 1px solid var(--a-green-500);
  padding: 10px 22px; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.92rem; text-decoration: none;
}
.btn:hover { background: var(--a-green-700); border-color: var(--a-green-700); }
.btn-gold { background: var(--a-gold); border-color: var(--a-gold); color: #23180a; }
.btn-gold:hover { background: #b78f38; border-color: #b78f38; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-outline { background: transparent; color: var(--a-green-500); }
.btn-outline:hover { background: #eef3ef; color: var(--a-green-700); }
.btn-danger { background: transparent; color: #a33; border-color: #d9b4b4; }
.btn-danger:hover { background: #fbeaea; }

.notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 0.92rem; }
.notice.success { background: #e7f2ea; color: #235c3b; border: 1px solid #b9dcc4; }
.notice.error { background: #fbeaea; color: #8a2b2b; border: 1px solid #e6c1c1; }

/* Dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 8px; }
.tile { background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 22px; text-decoration: none; color: inherit; display: block; transition: transform .15s ease, box-shadow .15s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20,37,29,0.1); }
.tile .k { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--a-muted); }
.tile .v { font-family: 'Iowan Old Style', Palatino, Georgia, serif; font-size: 1.4rem; color: var(--a-green-700); margin-top: 4px; }

/* Tables / lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border: 1px solid var(--a-line); border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; background: #fff; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.msg-head .who { font-weight: 700; color: var(--a-green-700); }
.msg-head .when { color: var(--a-muted); font-size: 0.82rem; }
.msg-meta { font-size: 0.86rem; color: var(--a-muted); margin: 4px 0 8px; }
.msg-body { white-space: pre-wrap; margin: 8px 0 12px; }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--a-gold); margin-right: 6px; }
.muted { color: var(--a-muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { font-size: 0.72rem; padding: 2px 10px; border-radius: 20px; background: #eef3ef; color: var(--a-green-700); }
.pill.active { background: var(--a-gold); color: #23180a; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #14251d, #244433); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 12px; padding: 38px 34px; box-shadow: 0 30px 60px rgba(0,0,0,0.3); }
.login-card .logo { text-align: center; font-family: 'Iowan Old Style', Palatino, Georgia, serif; font-size: 1.5rem; color: var(--a-green-900); margin-bottom: 4px; }
.login-card .logo .mark { color: var(--a-gold); }
.login-card .tag { text-align: center; color: var(--a-muted); font-size: 0.85rem; margin-bottom: 26px; }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px 18px; }
  .sidebar .sub, .sidebar .spacer, .sidebar .foot { display: none; }
  .sidebar nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .sidebar nav a { margin: 0; padding: 8px 12px; }
  .content { padding: 22px; }
}

/* ---------- Gallery manager ---------- */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gal-item {
  border: 1px solid var(--a-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.gal-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eee;
  display: block;
}
.gal-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.gal-body .field { margin: 0; }
.gal-body input[type="text"] {
  width: 100%; padding: 8px 10px; font-size: 0.85rem;
  border: 1px solid #d8d2c4; border-radius: 6px;
}
.gal-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gal-actions form { display: inline; }
.gal-pos { font-size: 0.75rem; color: var(--a-muted); margin-left: auto; }
