:root {
  --saffron: #e85d04;
  --saffron-dark: #c2410c;
  --maroon: #7b1e1e;
  --gold: #d4a017;
  --cream: #fff8f0;
  --paper: #fffdf9;
  --ink: #1f1308;
  --muted: #6b5344;
  --line: #edd9c4;
  --card: #ffffff;
  --ok: #166534;
  --err: #b91c1c;
  --shadow: 0 10px 30px rgba(123, 30, 30, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans Devanagari", "Noto Sans", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--saffron-dark); text-decoration: none; }
a:hover { color: var(--maroon); }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

/* Header */
.site-header {
  background: linear-gradient(135deg, #7b1e1e 0%, #c2410c 55%, #e85d04 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, #ffcc33, #fff, #138808);
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0 8px;
  font-size: 0.92rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.brand-mark {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.28);
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 1.15rem;
}
.brand h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: .2px; line-height: 1.2; }
.brand small { display: block; opacity: .88; font-weight: 500; font-size: .78rem; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero {
  padding: 18px 0 28px;
}
.hero h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  font-weight: 800;
  margin-bottom: 6px;
}
.hero p { max-width: 720px; opacity: .93; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-family: inherit;
  font-size: .95rem;
}
.btn-light { background: #fff; color: var(--maroon); }
.btn-light:hover { background: #fff3e6; color: var(--maroon); }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.btn-primary { background: var(--saffron); color: #fff; }
.btn-primary:hover { background: var(--saffron-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--maroon); border: 1px solid var(--line); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

/* Layout */
.main { padding: 28px 0 48px; }

.toolbar {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
}
.search, select.input, .input, textarea.input {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.search { flex: 1; min-width: 220px; }
textarea.input { min-height: 160px; resize: vertical; width: 100%; }
.input, select.input { width: 100%; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.card-body { padding: 18px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: .8rem;
}
.badge {
  background: #fff1e6;
  color: var(--saffron-dark);
  border: 1px solid #ffd7b5;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
}
.date { color: var(--muted); }
.card h3 { font-size: 1.12rem; line-height: 1.45; margin-bottom: 8px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--saffron-dark); }
.summary { color: var(--muted); flex: 1; }
.card-foot { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; }

.article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.article h1 { font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.4; margin: 10px 0 14px; }
.article .body { white-space: pre-wrap; font-size: 1.05rem; }
.source { margin-top: 22px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .92rem; }

/* Admin */
.admin-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fff3e8; font-size: .9rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  max-width: 820px;
}
.form label { display: block; font-weight: 700; margin: 12px 0 6px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.login-box {
  max-width: 420px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-box h2 { margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

.flash {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-weight: 600;
}
.flash.ok { background: #dcfce7; color: var(--ok); }
.flash.err { background: #fee2e2; color: var(--err); }

.empty {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  background: #2a140c;
  color: #f6e7d8;
  padding: 22px 0;
  font-size: .9rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: #ffd7a8; }

@media (max-width: 720px) {
  .form .row { grid-template-columns: 1fr; }
  .article { padding: 18px; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
