:root {
  --accent: #8B4513;
  --accent-dark: #6b3410;
  --accent-light: #F5E6D3;
  --gold: #C9A227;
  --dark: #2B2B2B;
  --gray: #666;
  --bg: #FBF7F1;
  --ok: #2E7D32;
  --warn: #B45309;
  --danger: #C0392B;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', 'Noto Sans Tamil', sans-serif;
  background: var(--bg);
  color: var(--dark);
}

.site-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 18px 24px;
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.temple-name-ta {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
.temple-name-en {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.92;
  margin-top: 2px;
}
.temple-address {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.btn-link {
  color: #fff;
  text-decoration: underline;
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--gray);
  font-size: 12px;
}

/* ---------- Cards / Panels ---------- */
.panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}
.panel h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 19px;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 10px;
}

/* ---------- Login ---------- */
.login-wrap {
  max-width: 420px;
  margin: 40px auto;
}
.login-wrap .panel { text-align: center; }
.demo-hint {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--accent-dark);
  text-align: left;
  margin-top: 16px;
  line-height: 1.6;
}

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
}
.btn:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
.btn-secondary:hover { background: var(--accent-light); }
.btn-block { width: 100%; text-align: center; }

.error-box {
  background: #FDECEA;
  color: var(--danger);
  border: 1px solid #f5c6cb;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}
.success-box {
  background: #E8F5E9;
  color: var(--ok);
  border: 1px solid #c3e6cb;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}

/* ---------- Webcam ---------- */
.webcam-box {
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  max-width: 360px;
  aspect-ratio: 4/3;
}
.webcam-box video, .webcam-box canvas, .webcam-box img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.webcam-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ---------- Token / Receipt ---------- */
.token-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  padding: 8px 18px;
  border-radius: 8px;
  letter-spacing: 1px;
}
.receipt {
  max-width: 340px;
  margin: 0 auto;
  background: #fff;
  border: 1px dashed #999;
  padding: 18px;
  text-align: center;
  font-family: 'Courier New', monospace;
}
.receipt .temple-name-ta { color: var(--dark); font-size: 15px; }
.receipt hr { border: none; border-top: 1px dashed #999; margin: 10px 0; }
.receipt .row { display: flex; justify-content: space-between; font-size: 13px; margin: 4px 0; text-align: left; }
.receipt-photo { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; margin: 8px auto; display: block; }
#qrcode { display: flex; justify-content: center; margin: 10px 0; }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th, table.data-table td {
  padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left;
}
table.data-table th { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; }
.status-pill { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-held { background: #FFF3CD; color: var(--warn); }
.status-returned { background: #E8F5E9; color: var(--ok); }

/* ---------- Dashboard stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-card .label { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* ---------- Checklist ---------- */
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.checklist-item input { width: auto; }

.nav-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.nav-tabs a {
  padding: 8px 16px; border-radius: 20px; text-decoration: none;
  background: #fff; color: var(--accent); border: 1px solid var(--accent-light); font-size: 14px; font-weight: 500;
}
.nav-tabs a.active { background: var(--accent); color: #fff; }

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .receipt { border: none; }
}
