:root {
  --ink: #241d18;
  --muted: #7a6f65;
  --line: #e6ddd2;
  --bg: #faf7f2;
  --panel: #ffffff;
  --brand: #8a6d3b;
  --brand-dark: #6b5229;
  --accent: #c9a15a;
  --success: #2f7a4a;
  --danger: #b23b3b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Jost', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3, h4, .brand .label {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 600;
}

a { color: var(--brand-dark); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Public header/footer ---------- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center;
  padding: 4px 12px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 64px; border-radius: 0; image-rendering: -webkit-optimize-contrast; }
.brand .label { font-size: 20px; font-weight: 700; letter-spacing: .3px; }

.hero {
  background-color: var(--ink);
  background-size: cover; background-position: center;
  height: 260px;
}

.site-footer { padding: 30px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 24px; border-radius: var(--radius);
  background: var(--brand); color: #fff; text-decoration: none; font-weight: 600;
  border: none; cursor: pointer; font-size: 15px;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: transparent; color: var(--brand-dark); border: 1px solid var(--brand); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Cards / forms ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.card.narrow { max-width: 460px; margin: 60px auto; }
.card.medium { max-width: 720px; margin: 40px auto; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #cdbfa4; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #f6f0e6; color: var(--ink);
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=number]:focus,
input[type=tel]:focus, input[type=date]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(138, 109, 59, .15);
}
textarea { min-height: 90px; }
input[readonly] { background: #ece4d6; color: var(--muted); cursor: not-allowed; }
.radio-group { display: flex; gap: 20px; flex-wrap: wrap; }
.radio-group label { font-weight: 500; display: flex; align-items: center; gap: 6px; }

.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert.success { background: #e7f4ec; color: var(--success); border: 1px solid #bfe3cb; }
.alert.error { background: #fbeaea; color: var(--danger); border: 1px solid #f0c4c4; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.pending { background: #fdf1d8; color: #8a6d1e; }
.badge.approved { background: #e2f3e6; color: var(--success); }
.badge.rejected { background: #fbeaea; color: var(--danger); }
.badge.cheque-disbursed { background: #dde8f7; color: #2a5a9c; }
.badge.paid { background: #eee3d0; color: var(--brand-dark); }
.badge.inactive { background: #ececec; color: #666; }

.tab-bar { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab-bar .tab { padding: 10px 16px; color: var(--muted); text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; }
.tab-bar .tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.tab-bar .tab:hover { color: var(--brand-dark); }

/* ---------- Admin/Member shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--ink); color: #fff; padding: 22px 0; flex-shrink: 0;
}
.sidebar .brand-row { padding: 0 22px 22px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.sidebar .brand-row .label { font-weight: 700; font-size: 16px; }
.sidebar .brand-row .role { color: #cbb98a; font-size: 12px; margin-top: 4px; }
.sidebar nav a {
  display: block; padding: 11px 22px; color: #d8d2c8; text-decoration: none; font-size: 14px;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-section-label {
  padding: 18px 22px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: #8f8578; font-weight: 700;
}
.main { flex: 1; padding: 30px 34px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-header h1 { font-size: 22px; margin: 0; }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
table th, table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
table th { background: #f4efe7; font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card .num { font-size: 28px; font-weight: 700; }
a.stat-card .num, .stat-card a.num { display: inline-block; color: var(--ink); text-decoration: none; }
.stat-card a.num:hover { color: var(--brand); text-decoration: underline; }
.stat-card .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.doc-thumb { display: inline-block; margin: 6px 10px 6px 0; }
.doc-thumb img { max-width: 220px; border: 1px solid var(--line); border-radius: 6px; }

.otp-input { letter-spacing: 8px; font-size: 22px; text-align: center; }

/* ---------- Mobile responsiveness (phones/small tablets) ---------- */
@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .card { padding: 20px; }
  .card.medium { margin: 20px auto; }
  .card.narrow { margin: 30px auto; }

  .form-row { flex-direction: column; gap: 0; }

  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; padding: 12px 0; }
  .sidebar .brand-row { padding: 0 16px 12px; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { padding: 8px 14px; font-size: 13px; }
  .sidebar .nav-section-label { width: 100%; padding: 10px 16px 4px; }
  .main { padding: 18px 16px; }

  .page-header { flex-wrap: wrap; gap: 10px; }

  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  .doc-thumb img { max-width: 100%; }
}

@media (max-width: 480px) {
  .brand .label { font-size: 15px; }
  .brand img { height: 46px; }
  .hero { height: 200px; }
  .btn { padding: 11px 18px; font-size: 14px; }
}
