/* Palette + type matched to riya.natyagraphy.com (parchment & maroon, Cinzel + Cormorant). */
:root {
  --maroon: #5a0e16;
  --maroon-dark: #3f0810;
  --maroon-light: #7a2128;
  --gold: #b0782b;
  --gold-light: #d4a55a;
  --cream: #f6ecd2;
  --cream-2: #efe1c0;
  --paper-tint: #fbf3df;
  --ink: #4a1218;
  --muted: #854940;
  --line: #e0cfa2;
  --white: #fdf8ea;
  --night-1: #150609;
  --night-2: #0c0407;

  /* timing colors */
  --watch: #2f5a2f;
  --watch-bg: #e8efdf;
  --break: #9a6a1d;
  --break-bg: #f6ead0;
  --onduty: #7a2128;
  --onduty-bg: #f3e2dd;
  --after: #1d6672;
  --after-bg: #e2eef0;
  --other: #6a4a6f;
  --other-bg: #efe6ee;

  --radius: 12px;
  --shadow: 0 10px 30px rgba(74, 30, 10, 0.14);
  --shadow-sm: 0 2px 10px rgba(74, 30, 10, 0.08);
  --font: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-display: 'Cinzel', Georgia, serif;
  --font-sc: 'Cormorant SC', 'Cormorant Garamond', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(212,165,90,0.20), transparent 60%),
    linear-gradient(180deg, #fbf5e2 0%, #f3e7c8 100%);
  background-attachment: fixed;
  line-height: 1.55;
  font-size: 18px;
  font-weight: 500;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; }

a { color: var(--gold); }

[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[data-icon] svg { width: 1em; height: 1em; display: block; }

.admin-note {
  background: var(--paper-tint); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 10px; padding: 10px 14px; font-size: .95rem; color: var(--ink); margin: 0 0 16px;
}

/* ---------- Header ---------- */
.masthead {
  background:
    linear-gradient(160deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: var(--cream);
  border-bottom: 4px solid var(--gold);
  position: relative;
  overflow: hidden;
}
.masthead::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 12% 20%, rgba(230,193,90,0.14) 0 2px, transparent 2px),
                    radial-gradient(circle at 85% 60%, rgba(230,193,90,0.12) 0 2px, transparent 2px);
  background-size: 90px 90px;
  pointer-events: none;
}
.masthead-inner {
  max-width: 1080px; margin: 0 auto; padding: 26px 20px 22px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  position: relative; z-index: 1;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .mark {
  width: 46px; height: 46px; flex: 0 0 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(var(--gold-light), var(--gold));
  color: var(--maroon-dark); font-size: 24px; box-shadow: 0 0 0 4px rgba(230,193,90,0.25);
}
.brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: .3px; font-weight: 700; }
.brand .sub { margin: 2px 0 0; font-size: .82rem; opacity: .85; letter-spacing: .5px; text-transform: uppercase; }
.nav-links { display: flex; gap: 10px; align-items: center; }
.nav-links a {
  color: var(--cream); text-decoration: none; font-size: .88rem; font-weight: 600;
  padding: 8px 14px; border: 1px solid rgba(230,193,90,0.4); border-radius: 999px;
  transition: background .15s;
}
.nav-links a:hover { background: rgba(230,193,90,0.18); }
.nav-links a.primary { background: var(--gold); color: var(--maroon-dark); border-color: var(--gold); }

/* ---------- Dates strip ---------- */
.dates {
  background: var(--cream-2);
  border-bottom: 1px solid var(--line);
}
.dates-inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 20px;
  display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .84rem; color: var(--muted);
}
.dates-inner b { color: var(--maroon); }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 20px 80px; }

/* ---------- Progress ---------- */
.progress-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.progress-top h2 { margin: 0; font-size: 1.05rem; }
.progress-stats { font-size: .9rem; color: var(--muted); }
.progress-stats b { color: var(--maroon); font-size: 1.05rem; }
.bar { height: 12px; background: var(--cream-2); border-radius: 999px; margin-top: 12px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); width: 0; transition: width .4s ease; }

/* ---------- Controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.controls .search {
  flex: 1 1 220px; min-width: 180px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .92rem; background: var(--white); color: var(--ink);
}
.controls select {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  font-size: .9rem; color: var(--ink);
}
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.toggle input { accent-color: var(--maroon); width: 16px; height: 16px; }

/* ---------- Legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 20px; font-size: .8rem; color: var(--muted); }
.legend .dot { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- Area section ---------- */
.area { margin-bottom: 26px; scroll-margin-top: 20px; }
.area-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.area-head h3 { margin: 0; font-size: 1.15rem; color: var(--maroon); }
.area-head .count {
  font-size: .78rem; background: var(--cream-2); color: var(--maroon); font-weight: 600;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.area-head .rule { flex: 1; height: 1px; background: var(--line); }

/* ---------- Task group ---------- */
.group {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 12px;
}
.group-head { padding: 12px 16px; display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line);
  background: linear-gradient(0deg, #fff, #fffdf9); }
.group-title { flex: 1; min-width: 0; }
.group-title .cat { font-weight: 700; font-size: .98rem; }
.group-title .post { font-size: .82rem; color: var(--muted); }
.group-title .covers { font-size: .82rem; color: var(--muted); margin-top: 3px; font-style: italic; }

.timing-pill {
  flex: 0 0 auto; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; align-self: flex-start;
}
.timing-watch { color: var(--watch); background: var(--watch-bg); }
.timing-break { color: var(--break); background: var(--break-bg); }
.timing-onduty { color: var(--onduty); background: var(--onduty-bg); }
.timing-after { color: var(--after); background: var(--after-bg); }
.timing-other { color: var(--other); background: var(--other-bg); }

/* role rows */
.roles { display: flex; flex-direction: column; }
.role-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid #f4ecdd; }
.role-row:first-child { border-top: none; }
.role-badge {
  flex: 0 0 84px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 6px; text-align: center;
}
.role-Primary { background: var(--maroon); color: #fff; }
.role-Secondary { background: var(--gold); color: var(--maroon-dark); }
.role-Backup { background: var(--cream-2); color: var(--maroon); border: 1px solid var(--line); }

.role-fill { flex: 1; min-width: 0; font-size: .9rem; }
.role-fill .name { font-weight: 600; }
.role-fill .contact { color: var(--muted); font-size: .82rem; }
.role-fill .open-label { color: var(--watch); font-weight: 600; }

.role-action { flex: 0 0 auto; display: flex; gap: 6px; }
.btn {
  border: none; border-radius: 999px; padding: 8px 16px; font-size: .85rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: transform .05s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn-signup { background: var(--maroon); color: #fff; }
.btn-signup:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--maroon); border-color: var(--maroon); }
.filled-tag { font-size: .78rem; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(43,26,30,0.55); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-back.show { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius); width: 100%; max-width: 440px;
  box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--gold);
}
.modal-head { padding: 18px 22px 6px; }
.modal-head h3 { margin: 0 0 2px; color: var(--maroon); }
.modal-head p { margin: 0; font-size: .85rem; color: var(--muted); }
.modal-body { padding: 12px 22px 6px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; }
.field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: .95rem; font-family: inherit; color: var(--ink);
}
.field input:focus { outline: 2px solid var(--gold-light); border-color: var(--gold); }
.modal-foot { padding: 8px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-error { color: var(--onduty); font-size: .85rem; padding: 0 22px; min-height: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--maroon-dark); color: var(--cream); padding: 12px 22px; border-radius: 999px;
  box-shadow: var(--shadow); font-size: .9rem; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60;
  border: 1px solid var(--gold);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #7a1c15; border-color: #d98a1f; }

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

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

/* ---------- Admin ---------- */
.admin-login { max-width: 380px; margin: 60px auto; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 6px; color: var(--maroon); }
.card p.muted { color: var(--muted); font-size: .88rem; margin-top: 0; }

.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; min-width: 120px; box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 1.6rem; font-weight: 700; color: var(--maroon); }
.stat .l { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.admin { border-collapse: collapse; width: 100%; font-size: .86rem; min-width: 820px; }
table.admin th, table.admin td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin th { background: var(--cream-2); color: var(--maroon); position: sticky; top: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; }
table.admin tr:hover td { background: #fffdf8; }
table.admin input {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: .84rem; width: 100%; font-family: inherit;
}
.status-badge { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.status-Filled { background: var(--watch-bg); color: var(--watch); }
.status-Open { background: var(--cream-2); color: var(--muted); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white);
  cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--maroon); color: #fff; border-color: var(--maroon); }

@media (max-width: 560px) {
  .brand h1 { font-size: 1.2rem; }
  .role-row { flex-wrap: wrap; }
  .role-action { width: 100%; justify-content: flex-end; }
  .role-badge { flex-basis: 74px; }
}
