:root {
  /* Janapriya Upscale brand palette (from logo) */
  --navy: #2A3887;
  --navy-deep: #262262;
  --blue: #29A9DF;
  --blue-tint: #E2F1FC;
  --red: #E91E3D;
  --grey: #64748b;
  --ink: #1e2a4a;
  --bg: #f4f8fc;
  --card: #ffffff;
  --line: #d9e2ec;
  --ok: #1a8f5a;
  --err: #c0392b;
  --grad: linear-gradient(135deg, #2A3887, #29A9DF);
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
a { color: var(--navy); }

header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: #fff;
  border-bottom: 3px solid transparent; border-image: var(--grad) 1;
  box-shadow: 0 1px 6px rgba(38,34,98,.08);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 34px; display: block; }
.brand .tag {
  color: var(--navy); font-size: 12px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; border-left: 2px solid var(--line); padding-left: 12px;
}
header.site a { color: var(--navy); text-decoration: none; font-size: 14px; font-weight: 700; }
header.site a:hover { color: var(--blue); }
header.site nav a { margin-left: 16px; }
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
main.narrow { max-width: 480px; }
footer { text-align: center; color: var(--grey); font-size: 13px; padding: 24px 16px 40px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: 0 2px 10px rgba(38,34,98,.05); margin-bottom: 16px;
}
h1 { font-size: 22px; margin: 0 0 6px; color: var(--navy-deep); }
h2 { font-size: 17px; margin: 0 0 12px; color: var(--navy-deep); }
.sub { color: var(--grey); margin: 0 0 18px; }

label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 5px; color: var(--navy-deep); }
input, select {
  width: 100%; padding: 11px 12px; font-size: 15px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
select:disabled { background: #eef3f8; color: var(--grey); }
.hint { font-size: 12px; color: var(--grey); margin-top: 4px; }

button, .btn {
  display: inline-block; width: 100%; margin-top: 20px; padding: 13px 16px;
  font-size: 15px; font-weight: 800; color: #fff; background: var(--grad);
  border: 0; border-radius: 10px; cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: 0 4px 12px rgba(41,169,223,.25);
}
button:hover, .btn:hover { filter: brightness(1.05); }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); box-shadow: none; }
.btn.small { width: auto; margin: 0; padding: 8px 12px; font-size: 13px; }
button.big, .btn.big { padding: 18px 22px; font-size: 19px; border-radius: 12px; letter-spacing: .3px; }
.btn.danger { background: var(--err); box-shadow: none; }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 8px; }
.alert.error { background: #fdecef; color: var(--err); border: 1px solid #f5c6c0; }
.alert.ok { background: #e3f5e9; color: var(--ok); border: 1px solid #bfe6cf; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 2px 10px rgba(38,34,98,.05);
}
.stat .n { font-size: 30px; font-weight: 800; color: var(--navy); }
.stat .l { font-size: 13px; color: var(--grey); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--grey); }
.tablewrap { overflow-x: auto; }

.bar { background: var(--blue-tint); border-radius: 999px; height: 8px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--grad); transition: width .6s ease; }

.live { font-size: 12px; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--grey); }
.pill { font-size: 12px; background: var(--blue-tint); color: var(--navy-deep); padding: 3px 9px; border-radius: 999px; font-weight: 700; }

/* Live submission feed (dashboard) */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; background: #fff;
}
.feed li.new { animation: flashin 2s ease; }
@keyframes flashin {
  0% { background: var(--blue-tint); transform: translateY(-6px); box-shadow: 0 6px 18px rgba(41,169,223,.35); }
  100% { background: #fff; transform: none; box-shadow: none; }
}
.feed .who { font-weight: 800; color: var(--navy-deep); }
.feed .meta { font-size: 13px; color: var(--grey); }
.feed .when { margin-left: auto; font-size: 12px; color: var(--grey); white-space: nowrap; }

/* Toast for a brand new consent */
#toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 340px;
  background: var(--grad); color: #fff; padding: 14px 18px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(38,34,98,.35); font-weight: 700;
  transform: translateY(140%); transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
#toast.show { transform: none; }
#toast small { display: block; font-weight: 400; opacity: .9; margin-top: 2px; }

/* Camera */
.camera { display: grid; gap: 12px; }
video, #preview { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; object-fit: contain; }
.camera .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.camera .actions button { margin-top: 0; }
.hide { display: none !important; }
canvas { display: none; }
.masters-tower { margin-bottom: 22px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form input, .inline-form select { width: auto; }
