@font-face {
  font-family: 'July';
  src: url('/assets/fonts/July-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'July';
  src: url('/assets/fonts/July-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'July';
  src: url('/assets/fonts/July-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'July';
  src: url('/assets/fonts/July-Bold-Italic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
}
@font-face {
  font-family: 'AbuSayed';
  src: url('/assets/fonts/Abu-Sayed.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'MainakSignature';
  src: url('/assets/fonts/Mainak-Signature-Font.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

:root {
  --ncp-green: #0a6b3d;
  --ncp-green-dark: #075129;
  --ncp-red: #e21f26;
  --ncp-cream: #fdfaf3;
  --ncp-ink: #14231b;
  --ncp-muted: #5b6b62;
  --ncp-border: #e3e7de;
  --ncp-card: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(10, 107, 61, 0.08);
}

* { box-sizing: border-box; }

.icon { vertical-align: middle; display: inline-block; flex-shrink: 0; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ncp-cream);
  color: var(--ncp-ink);
  font-family: 'July', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, .headline {
  font-family: 'AbuSayed', 'July', sans-serif;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: var(--ncp-green-dark);
  margin: 0 0 0.4em;
}

.tagline {
  font-family: 'MainakSignature', cursive;
  color: var(--ncp-red);
  font-size: 1.4rem;
}

a { color: var(--ncp-green); }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ncp-border);
  background: #fff;
}
.topbar img.logo { width: 42px; height: 42px; object-fit: contain; }
.topbar .brand-name { font-family: 'AbuSayed', 'July'; font-size: 1.1rem; color: var(--ncp-green-dark); }
.topbar .brand-sub { font-size: 0.78rem; color: var(--ncp-muted); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 40px 0 24px;
}
.hero img.hero-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 18px;
}
.hero h1 { font-size: 1.9rem; }
.hero p.lead { color: var(--ncp-muted); font-size: 1.02rem; max-width: 560px; margin: 10px auto 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 13px 28px;
  font-family: 'July';
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ncp-green); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--ncp-green-dark); }
.btn-outline { background: transparent; color: var(--ncp-green); border: 1.5px solid var(--ncp-green); }
.btn-danger { background: var(--ncp-red); color: #fff; }
.btn-ghost { background: transparent; color: var(--ncp-muted); padding: 8px 12px; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Card / Form ---------- */
.card {
  background: var(--ncp-card);
  border: 1px solid var(--ncp-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.92rem; color: var(--ncp-ink); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ncp-border);
  border-radius: 10px;
  font-family: 'July';
  font-size: 0.98rem;
  background: #fff;
  color: var(--ncp-ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--ncp-green);
}
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { font-size: 0.78rem; color: var(--ncp-muted); margin-top: 4px; }

.form-section { display: none; margin-top: 28px; }
.form-section.open { display: block; }

/* ---------- Status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-pending { background: #fff4d6; color: #8a6400; }
.badge-accepted { background: #dff5e6; color: var(--ncp-green-dark); }
.badge-rejected { background: #fde3e3; color: #a31f1f; }

/* ---------- Post view ---------- */
.post-statement {
  font-size: 1.15rem;
  line-height: 1.8;
  white-space: pre-wrap;
  margin: 18px 0;
}
.vote-row { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--ncp-border);
  background: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  font-family: 'July';
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ncp-ink);
}
.vote-btn.active-like { border-color: var(--ncp-green); color: var(--ncp-green); background: #eefaf1; }
.vote-btn.active-dislike { border-color: var(--ncp-red); color: var(--ncp-red); background: #fdeeee; }

.history-list { margin-top: 20px; border-top: 1px dashed var(--ncp-border); padding-top: 14px; }
.history-item { padding: 10px 0; border-bottom: 1px solid var(--ncp-border); font-size: 0.9rem; color: var(--ncp-muted); }
.history-item:last-child { border-bottom: none; }
.history-item .time { font-size: 0.76rem; opacity: 0.75; margin-top: 4px; }

.success-box {
  text-align: center;
  padding: 20px 4px;
}
.success-box .check {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ncp-green); color: #fff; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 1.6rem;
}
.link-box {
  display: flex; gap: 8px; align-items: center;
  background: #f4f8f2; border: 1px dashed var(--ncp-border); border-radius: 10px; padding: 10px 12px; margin-top: 14px;
}
.link-box input { border: none; background: transparent; flex: 1; font-family: monospace; font-size: 0.85rem; }

.error-text { color: var(--ncp-red); font-size: 0.85rem; margin-top: 8px; }
.muted { color: var(--ncp-muted); font-size: 0.85rem; }

footer.site-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--ncp-muted);
  font-size: 0.8rem;
}

/* ---------- Admin ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: var(--ncp-green-dark);
  color: #fff;
  padding: 20px 14px;
  flex-shrink: 0;
}
.admin-sidebar .logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.admin-sidebar .logo-row img { width: 36px; height: 36px; }
.admin-sidebar .logo-row span { font-family: 'AbuSayed'; font-size: 1rem; }
.admin-nav button {
  display: block; width: 100%; text-align: right; background: transparent; border: none;
  color: #d7e9dd; padding: 11px 12px; border-radius: 8px; font-family: 'July'; font-size: 0.92rem;
  cursor: pointer; margin-bottom: 4px;
}
.admin-nav button.active, .admin-nav button:hover { background: rgba(255,255,255,0.12); color: #fff; }
.admin-main { flex: 1; padding: 26px 30px; max-width: 980px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.who { font-size: 0.85rem; color: var(--ncp-muted); }
.who b { color: var(--ncp-ink); }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  border: 1.5px solid var(--ncp-border); background: #fff; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; font-family: 'July'; font-size: 0.85rem; color: var(--ncp-muted);
}
.tab-btn.active { border-color: var(--ncp-green); color: var(--ncp-green); background: #eefaf1; font-weight: 700; }

.post-row {
  background: #fff; border: 1px solid var(--ncp-border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px;
  position: relative;
}
.post-row .top-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.post-row .statement-text { flex: 1; white-space: pre-wrap; }
.post-row .meta { font-size: 0.76rem; color: var(--ncp-muted); margin-top: 8px; }
.post-row .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

.icon-btn {
  border: 1px solid var(--ncp-border); background: #fff; border-radius: 8px; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.95rem;
  color: var(--ncp-ink);
}
.icon-btn:hover { background: #f4f8f2; }

.menu-wrap { position: relative; display: inline-block; }
.menu-dropdown {
  display: none; position: absolute; right: 0; top: 40px; background: #fff; border: 1px solid var(--ncp-border);
  border-radius: 10px; box-shadow: var(--shadow); min-width: 150px; z-index: 20; overflow: hidden;
}
.menu-dropdown.open { display: block; }
.menu-dropdown button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: right; background: none; border: none; padding: 10px 14px;
  cursor: pointer; font-family: 'July'; font-size: 0.85rem; color: var(--ncp-ink);
}
.menu-dropdown button:hover { background: #f4f8f2; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,35,27,0.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 24px; max-width: 460px; width: 100%; max-height: 85vh; overflow-y: auto; }
.modal-box h3 { margin-bottom: 14px; }
.contact-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--ncp-border); font-size: 0.92rem; }
.contact-row:last-child { border-bottom: none; }
.contact-row .label { color: var(--ncp-muted); }
.wa-link { color: var(--ncp-green); font-weight: 700; text-decoration: none; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { max-width: 380px; width: 100%; text-align: center; }
.login-card img { width: 80px; margin-bottom: 14px; }
.login-card .field { text-align: left; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute; top: 50%; left: auto; right: 10px; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; color: var(--ncp-muted);
  display: flex; align-items: center; justify-content: center; padding: 4px;
}
.password-toggle:hover { color: var(--ncp-green); }

table.simple-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.simple-table th, table.simple-table td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--ncp-border); }
table.simple-table th { color: var(--ncp-muted); font-weight: 700; }

.role-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; }
.role-pill.master_admin { background: #fde3e3; color: var(--ncp-red); }
.role-pill.admin { background: #dff5e6; color: var(--ncp-green-dark); }

.empty-state { text-align: center; padding: 40px 10px; color: var(--ncp-muted); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Mobile-first tweaks ---------- */
@media (max-width: 720px) {
  .admin-shell { flex-direction: column; min-height: auto; }
  .admin-sidebar {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; position: sticky; top: 0; z-index: 30;
  }
  .admin-nav { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; padding-bottom: 2px; }
  .admin-nav button { width: auto; white-space: nowrap; text-align: center; padding: 9px 12px; }
  .admin-main { padding: 16px 14px 40px; }
  .admin-topbar { flex-direction: column; align-items: flex-start; }
  table.simple-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 480px) {
  .container { padding: 16px 14px 48px; }
  .hero { padding: 24px 0 16px; }
  .hero img.hero-logo { width: 84px; height: 84px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p.lead { font-size: 0.95rem; }
  .tagline { font-size: 1.15rem; }
  .card { padding: 18px; }
  .btn { width: 100%; }
  .btn.btn-sm { width: auto; }
  .topbar { padding: 12px 14px; }
  .topbar img.logo { width: 34px; height: 34px; }
  .modal-box { padding: 18px; }
  .post-row .top-line { flex-direction: column; }
  .post-row .actions { justify-content: flex-start; }
  .post-row .actions .menu-wrap { margin-right: 0; order: -1; }
  .link-box { flex-direction: column; align-items: stretch; }
  .link-box input { text-align: center; margin-bottom: 6px; }
  .vote-row { flex-wrap: wrap; }
  .login-card img { width: 64px; }
  .icon-btn { width: 38px; height: 38px; font-size: 1.05rem; }
  .vote-btn, .tab-btn { padding: 9px 14px; font-size: 0.88rem; }
}

/* Comfortable tap targets on touch devices */
@media (hover: none) and (pointer: coarse) {
  .btn, .icon-btn, .vote-btn, .tab-btn, .menu-dropdown button, .admin-nav button {
    min-height: 40px;
  }
}
