:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --ink: #2b2b2b;
  --muted: #6b6b6b;
  --accent: #3a6b5e;
  --accent-dark: #2c544a;
  --danger: #b3433a;
  --border: #e2ddd4;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); }

/* ---- Hero / home ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #3a6b5e, #2c544a);
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card h1 { margin: 0 0 6px; font-size: 1.6rem; }
.card .welcome { color: var(--muted); margin: 0 0 22px; white-space: pre-wrap; }

/* ---- Forms ---- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin: 14px 0 6px; }
input[type="text"], input[type="password"], input[type="url"], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button.secondary, .btn.secondary { background: #e9e4db; color: var(--ink); }
button.secondary:hover { background: #ddd6ca; }
button.danger { background: var(--danger); }
button.full { width: 100%; margin-top: 18px; }

.msg { margin-top: 14px; font-size: 0.9rem; min-height: 1.2em; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--accent); }

/* ---- App layout (dashboard / admin) ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar a, .topbar button { font-size: 0.9rem; padding: 8px 12px; }

.container { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }

.links-grid { display: grid; gap: 12px; margin-top: 18px; }
.link-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.link-tile:hover { border-color: var(--accent); }
.link-tile .arrow { margin-left: auto; color: var(--accent); }

/* ---- Admin ---- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs button { background: #e9e4db; color: var(--ink); }
.tabs button.active { background: var(--accent); color: #fff; }
.panel { display: none; }
.panel.active { display: block; }

.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.section h2 { margin: 0 0 14px; font-size: 1.15rem; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; }
.row .small { font-size: 0.8rem; color: var(--muted); }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline > div { flex: 1; min-width: 140px; }

.badge { font-size: 0.7rem; background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 999px; }

.hero-thumbs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-thumb { position: relative; }
.hero-thumb img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.hero-thumb button {
  position: absolute; top: -8px; right: -8px;
  width: 26px; height: 26px; padding: 0; border-radius: 50%;
  background: var(--danger); font-size: 0.9rem; line-height: 1;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
