/* =====================================================================
   Bhutan Guide — design system
   Contemplative Himalayan palette: monastery maroon, saffron & gilt,
   parchment cream; serif display type; labyrinth & lotus motifs.
   ===================================================================== */

:root {
  --maroon: #7a1f1f;
  --maroon-700: #631818;
  --maroon-900: #3f0e0e;
  --saffron: #e0a526;
  --saffron-soft: #fbefd2;
  --gold: #b8892d;
  --gold-soft: #e9d6a6;
  --cream: #faf6ec;
  --parchment: #f3eadb;
  --paper: #fffdf8;
  --ink: #2a1c14;
  --ink-2: #4b3a2d;
  --muted: #7d6c5b;
  --line: #e6d9bf;
  --line-2: #d9c79f;
  --jade: #2f6b5a;
  --jade-soft: #dcefe7;
  --sky: #2c5e8a;
  --sky-soft: #dde9f5;
  --red: #a8352b;
  --red-soft: #f7e0dc;
  --live: #0f8a5f;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(63, 14, 14, .06), 0 8px 24px -12px rgba(63, 14, 14, .18);
  --shadow-lg: 0 24px 48px -24px rgba(63, 14, 14, .35);

  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Mulish", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}
img { max-width: 100%; display: block; }
a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-900); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--maroon-900); line-height: 1.15; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.eyebrow {
  font-family: var(--font-body); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin-bottom: .6rem; display: inline-flex; align-items: center; gap: .6rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

/* ---------- Ornaments ---------- */
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold); margin: 1.2rem auto; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: min(120px, 20vw); background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament::after { transform: scaleX(-1); }
.ornament svg { width: 26px; height: 26px; }
.prayer-flags { height: 6px; background: linear-gradient(90deg, #2c5e8a 0 20%, #f4f1ea 20% 40%, #a8352b 40% 60%, #2f6b5a 60% 80%, #e0a526 80% 100%); }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--paper); --fg: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.15rem; border-radius: 999px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font: 600 .9rem/1.2 var(--font-body);
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--fg); }
.btn:active { transform: none; }
.btn-primary { --bg: var(--maroon); --fg: #fff7e6; --bd: var(--maroon); }
.btn-primary:hover { --bg: var(--maroon-700); }
.btn-gold { --bg: var(--saffron); --fg: var(--maroon-900); --bd: var(--saffron); }
.btn-jade { --bg: var(--jade); --fg: #fff; --bd: var(--jade); }
.btn-danger { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn-ghost { --bg: transparent; --bd: transparent; --fg: var(--maroon); }
.btn-outline { --bg: transparent; --fg: var(--maroon); --bd: var(--maroon); }
.btn-sm { padding: .38rem .8rem; font-size: .8rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.inline { display: inline; }

/* ---------- Cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.4rem; }
.card-head { padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-head h3 { margin: 0; font-size: 1.25rem; }
.card-foot { padding: .9rem 1.4rem; border-top: 1px solid var(--line); background: var(--cream); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .62rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; background: var(--parchment); color: var(--ink-2); border: 1px solid var(--line); }
.tone-green { background: var(--jade-soft); color: var(--jade); border-color: #bfdccf; }
.tone-red { background: var(--red-soft); color: var(--red); border-color: #ecc3bc; }
.tone-saffron { background: var(--saffron-soft); color: #8a5a00; border-color: #f0d79a; }
.tone-blue { background: var(--sky-soft); color: var(--sky); border-color: #c3d6ea; }
.tone-maroon { background: var(--maroon); color: #fff7e6; border-color: var(--maroon); }
.tone-live { background: #dff5ea; color: var(--live); border-color: #b5e3cc; }
.tone-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(15,138,95,.6); } 70% { box-shadow: 0 0 0 7px rgba(15,138,95,0); } 100% { box-shadow: 0 0 0 0 rgba(15,138,95,0); } }

.chip { display: inline-block; padding: .14rem .55rem; border-radius: 6px; background: var(--parchment); border: 1px solid var(--line); font-size: .75rem; color: var(--ink-2); margin: 0 .25rem .25rem 0; }

/* ---------- Stars & rank ---------- */
.stars { color: var(--saffron); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #dccfb4; }
.rank-medal {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #f6dc8f, var(--gold)); color: var(--maroon-900);
  font: 700 1.05rem var(--font-display); border: 2px solid #fff3cf; box-shadow: 0 2px 6px rgba(0,0,0,.15); flex: none;
}
.rank-medal.r1 { background: radial-gradient(circle at 35% 30%, #ffe9a3, #d4a017); }
.rank-medal.plain { background: var(--parchment); border-color: var(--line); }
.score { font: 700 1.8rem/1 var(--font-display); color: var(--maroon); }
.score small { font: 600 .75rem var(--font-body); color: var(--muted); }
.meter { height: 8px; border-radius: 99px; background: var(--parchment); overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--saffron)); border-radius: 99px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .label { font-size: .8rem; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.input, .select, .textarea {
  width: 100%; padding: .65rem .85rem; font: 400 .95rem var(--font-body); color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224,165,38,.22); }
.field .error, .error-text { color: var(--red); font-size: .8rem; }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--red); }
.hint { color: var(--muted); font-size: .78rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--maroon); width: 16px; height: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .45rem .9rem; padding: .7rem .9rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 1; }

.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { display: none; }
.star-input label { font-size: 1.9rem; color: #dccfb4; cursor: pointer; line-height: 1; transition: color .1s; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--saffron); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: var(--cream); white-space: nowrap; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fffaf0; }
.who { display: flex; align-items: center; gap: .7rem; }
.who img, .avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold-soft); flex: none; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold-soft); }
.who strong { display: block; line-height: 1.2; }
.actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty svg { width: 54px; height: 54px; margin: 0 auto .6rem; color: var(--gold-soft); }

/* ---------- Alerts ---------- */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1.2rem; font-size: .92rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert-success { background: var(--jade-soft); border-color: #bfdccf; color: #1f4c3f; }
.alert-error { background: var(--red-soft); border-color: #ecc3bc; color: #7d241c; }
.alert-info { background: var(--saffron-soft); border-color: #f0d79a; color: #6b4600; }
.alert ul { margin: 0; padding-left: 1.1rem; }

/* =====================================================================
   PUBLIC SITE
   ===================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 246, 236, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--maroon-900); }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font: 600 1.55rem/1 var(--font-display); letter-spacing: .01em; }
.brand-sub { display: block; font: 700 .58rem/1 var(--font-body); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a:not(.btn) { color: var(--ink-2); font-weight: 600; font-size: .9rem; position: relative; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--saffron); transition: width .2s; }
.nav a:not(.btn):hover::after, .nav a.active::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 76px; left: 0; right: 0; flex-direction: column; background: var(--cream); padding: 1.2rem; border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
}

.hero {
  position: relative; overflow: hidden; color: #fdf3dc;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(224,165,38,.28), transparent 60%),
    linear-gradient(160deg, var(--maroon-900) 0%, var(--maroon) 55%, #8e2a1c 100%);
}
.hero::before { /* labyrinth rings */
  content: ""; position: absolute; right: -180px; top: 50%; width: 760px; height: 760px; transform: translateY(-50%);
  background: repeating-radial-gradient(circle, rgba(243,227,181,.16) 0 1px, transparent 1px 34px);
  -webkit-mask: radial-gradient(circle, #000 0 62%, transparent 63%); mask: radial-gradient(circle, #000 0 62%, transparent 63%);
  border-radius: 50%;
}
.hero .container { position: relative; padding: 6.5rem 0 7rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff7e6; font-weight: 500; }
.hero h1 em { font-style: italic; color: var(--saffron); }
.hero p.lead { font-size: 1.12rem; color: #f0dcc0; max-width: 560px; }
.hero .eyebrow { color: var(--saffron); }
.hero-card { background: rgba(255, 247, 230, .08); border: 1px solid rgba(243,227,181,.25); border-radius: 22px; padding: 1.6rem; backdrop-filter: blur(4px); }
.hero-card .stat-num { font: 600 2.3rem/1 var(--font-display); color: var(--saffron); }
.hero-card .stat-lbl { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #ecd6b4; }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; padding: 4rem 0; } }

.section { padding: 5.5rem 0; }
.section-alt { background: var(--parchment); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-head .eyebrow { justify-content: center; }
.section-head .eyebrow::after { content: ""; width: 26px; height: 1px; background: currentColor; }

.feature { padding: 1.8rem; text-align: center; }
.feature .icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--saffron-soft); color: var(--maroon); border: 1px solid var(--gold-soft); }
.feature .icon svg { width: 30px; height: 30px; }

.guide-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.guide-card .top { position: relative; padding: 1.4rem 1.4rem 1rem; display: flex; gap: 1rem; align-items: center; background: linear-gradient(180deg, var(--parchment), var(--paper)); }
.guide-card .top img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--gold-soft); }
.guide-card .rank-medal { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; font-size: .95rem; }
.guide-card h3 { font-size: 1.35rem; margin: 0; }
.guide-card .body { padding: 0 1.4rem 1.2rem; flex: 1; }
.guide-card .foot { padding: .9rem 1.4rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .5rem; }

.cat-tile { padding: 1.3rem 1.4rem; display: flex; justify-content: space-between; align-items: center; }
.cat-tile h4 { margin: 0; font-size: 1.2rem; }

.cta { background: var(--maroon-900); color: #f3e3c4; border-radius: 26px; padding: 3.2rem; text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 120%, rgba(224,165,38,.12) 0 1px, transparent 1px 28px); }
.cta > * { position: relative; }
.cta h2 { color: #fff7e6; }

.site-footer { background: var(--maroon-900); color: #d9c3a3; padding: 3.5rem 0 1.6rem; margin-top: 0; }
.site-footer h4 { color: var(--saffron); font-size: 1.1rem; }
.site-footer a { color: #ecd6b4; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff7e6; }
.site-footer .copyright { border-top: 1px solid rgba(243,227,181,.15); margin-top: 2.5rem; padding-top: 1.3rem; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 82px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; background: linear-gradient(160deg, var(--maroon-900), var(--maroon)); color: #f3e3c4; padding: 4rem; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; left: 50%; top: 40%; width: 640px; height: 640px; transform: translate(-50%, -50%); border-radius: 50%; background: repeating-radial-gradient(circle, rgba(243,227,181,.14) 0 1px, transparent 1px 30px); }
.auth-art > * { position: relative; }
.auth-art h2 { color: #fff7e6; font-weight: 500; font-size: 2.4rem; }
.auth-form { display: grid; place-items: center; padding: 3rem 1.5rem; }
.auth-form .panel { width: min(470px, 100%); }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.4rem; }
.role-tabs label { border: 1px solid var(--line-2); border-radius: 12px; padding: .8rem .5rem; text-align: center; cursor: pointer; background: #fff; transition: all .15s; }
.role-tabs label strong { display: block; font-family: var(--font-display); font-size: 1.15rem; color: var(--maroon-900); }
.role-tabs label span { font-size: .72rem; color: var(--muted); }
.role-tabs input { display: none; }
.role-tabs input:checked + label { border-color: var(--maroon); background: var(--saffron-soft); box-shadow: 0 0 0 2px rgba(122,31,31,.15); }
.demo-box { margin-top: 1.4rem; padding: 1rem 1.1rem; border: 1px dashed var(--gold); border-radius: 12px; background: var(--saffron-soft); font-size: .85rem; }
.demo-box code { background: #fff; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* =====================================================================
   APP SHELL (dashboards)
   ===================================================================== */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: var(--maroon-900); color: #e8d4b4; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar::after { content: ""; position: absolute; }
.sidebar .brand { padding: 1.4rem 1.4rem 1.2rem; color: #fff7e6; border-bottom: 1px solid rgba(243,227,181,.12); }
.sidebar .role-pill { margin: 1rem 1.4rem .4rem; font-size: .66rem; letter-spacing: .25em; text-transform: uppercase; color: var(--saffron); font-weight: 800; }
.side-nav { padding: .3rem .8rem 1rem; display: flex; flex-direction: column; gap: 2px; }
.side-nav .group { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: #a98d6c; margin: 1.1rem .7rem .4rem; font-weight: 700; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px; color: #ead8ba; font-weight: 600; font-size: .9rem; }
.side-nav a svg { width: 18px; height: 18px; opacity: .85; flex: none; }
.side-nav a:hover { background: rgba(243,227,181,.08); color: #fff; }
.side-nav a.active { background: linear-gradient(90deg, rgba(224,165,38,.25), rgba(224,165,38,.06)); color: #fff7e6; box-shadow: inset 3px 0 0 var(--saffron); }
.side-nav .count { margin-left: auto; background: var(--saffron); color: var(--maroon-900); border-radius: 99px; font-size: .7rem; padding: 0 .5rem; font-weight: 800; }
.sidebar .side-foot { margin-top: auto; padding: 1rem 1.4rem 1.4rem; border-top: 1px solid rgba(243,227,181,.12); font-size: .8rem; color: #b79d7c; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; gap: 1rem; }
.topbar .crumb { font: 600 1.3rem var(--font-display); color: var(--maroon-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: .6rem; background: none; border: 1px solid var(--line); border-radius: 99px; padding: .25rem .8rem .25rem .25rem; cursor: pointer; font: 600 .88rem var(--font-body); color: var(--ink); }
.user-menu > button img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.user-menu .dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 210px; padding: .4rem; display: none; }
.user-menu.open .dropdown { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: .55rem .8rem; border-radius: 8px; color: var(--ink); background: none; border: 0; font: 500 .9rem var(--font-body); cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--parchment); }
.content { padding: 2rem; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-head h1 { font-size: 2.1rem; margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 4px; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: block; }
  .content { padding: 1.2rem; }
  .topbar { padding: 0 1rem; }
}

.stat { padding: 1.3rem 1.4rem; position: relative; overflow: hidden; }
.stat .lbl { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat .num { font: 600 2.3rem/1.1 var(--font-display); color: var(--maroon-900); margin-top: .3rem; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: repeating-radial-gradient(circle, rgba(184,137,45,.18) 0 1px, transparent 1px 12px); }
.stat.accent { background: linear-gradient(150deg, var(--maroon), var(--maroon-900)); border-color: var(--maroon-900); }
.stat.accent .lbl, .stat.accent .sub { color: #e6cfa9; }
.stat.accent .num { color: var(--saffron); }

.bars { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 1rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .bar span.fill { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--saffron), var(--gold)); min-height: 4px; }
.bars .bar small { color: var(--muted); font-size: .75rem; }
.bars .bar b { font-size: .8rem; color: var(--maroon-900); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .85rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .9rem; justify-content: space-between; }
.list li:last-child { border-bottom: 0; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: .55rem 1rem; font-size: .92rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }

.review { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review blockquote { margin: .4rem 0 0; font-family: var(--font-display); font-size: 1.15rem; font-style: italic; color: var(--ink-2); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.2rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -1.62rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--line-2); border: 2px solid var(--paper); }
.timeline li.done::before { background: var(--jade); }
.timeline li.now::before { background: var(--saffron); box-shadow: 0 0 0 4px rgba(224,165,38,.25); }

/* ---------- Maps / live tracking ---------- */
.map { height: 460px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); z-index: 1; }
.map-full { height: calc(100vh - 70px - 4rem); min-height: 520px; }
.track-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.2rem; }
@media (max-width: 1100px) { .track-layout { grid-template-columns: 1fr; } .map-full { height: 60vh; } }
.track-panel .big { font: 600 2rem/1 var(--font-display); color: var(--maroon-900); }
.guide-pin { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--maroon), 0 6px 14px rgba(0,0,0,.35); overflow: hidden; background: var(--maroon); }
.guide-pin img { width: 100%; height: 100%; object-fit: cover; }
.guide-pin.offline { box-shadow: 0 0 0 3px #9b8b78, 0 6px 14px rgba(0,0,0,.3); filter: grayscale(.6); }
.pulse-ring { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(15,138,95,.35); animation: ring 1.8s ease-out infinite; }
@keyframes ring { from { transform: scale(.8); opacity: .8; } to { transform: scale(2.4); opacity: 0; } }
.place-pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.place-pin.start { background: var(--jade); }
.place-pin.end { background: var(--maroon); }
.leaflet-popup-content { font-family: var(--font-body); }

.live-phone { max-width: 520px; margin: 0 auto; text-align: center; }
.gps-dot { width: 120px; height: 120px; margin: 1.5rem auto; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #e7f7ef, #c3ead6); position: relative; color: var(--live); }
.gps-dot.off { background: radial-gradient(circle, #f6efe4, #e8dcc6); color: var(--muted); }
.gps-dot svg { width: 46px; height: 46px; }
.gps-dot:not(.off)::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--live); animation: ring 2s ease-out infinite; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 .7rem; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.pagination .active { background: var(--maroon); color: #fff7e6; border-color: var(--maroon); }
.pagination .disabled { opacity: .45; }

/* ---------- Misc ---------- */
.profile-hero { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.kv { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.kv div span { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.kv div strong { font: 600 1.3rem var(--font-display); color: var(--maroon-900); }
.doc-row { display: flex; align-items: center; gap: .9rem; padding: .8rem 0; border-bottom: 1px dashed var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-icon { width: 40px; height: 46px; border-radius: 6px; background: var(--parchment); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: .62rem; font-weight: 800; color: var(--maroon); flex: none; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; flex-wrap: wrap; }
.tabs a { padding: .6rem 1rem; color: var(--muted); font-weight: 700; font-size: .88rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--maroon); border-color: var(--maroon); }
.notice-bar { background: var(--saffron-soft); border-bottom: 1px solid #f0d79a; padding: .7rem 2rem; font-size: .88rem; color: #6b4600; }
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 3rem 1rem; }
.error-page .code { font: 600 7rem/1 var(--font-display); color: var(--gold-soft); }
[x-cloak], [hidden] { display: none !important; }

/* =====================================================================
   v2 features: notifications, chat, itinerary, safety, calendar, payments
   ===================================================================== */
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.bell { position: relative; }
.bell > button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--maroon); }
.bell > button svg { width: 20px; height: 20px; }
.bell .dot { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font: 800 .68rem/19px var(--font-body); text-align: center; border: 2px solid var(--paper); }
.bell .panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(370px, calc(100vw - 32px)); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); display: none; overflow: hidden; z-index: 70; }
.bell.open .panel { display: block; }
.bell .panel header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.bell .panel header strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--maroon-900); }
.notif { display: flex; gap: .7rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink); align-items: flex-start; }
.notif:hover { background: #fffaf0; color: var(--ink); }
.notif.unread { background: #fff8e8; }
.notif .lvl { width: 9px; height: 9px; border-radius: 50%; margin-top: .45rem; flex: none; background: var(--sky); }
.notif .lvl.success { background: var(--jade); } .notif .lvl.warning { background: var(--saffron); } .notif .lvl.danger { background: var(--red); }
.notif strong { display: block; font-size: .9rem; line-height: 1.3; }
.notif p { margin: .15rem 0 0; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.notif small { color: var(--muted); font-size: .74rem; }
.bell .panel footer { padding: .6rem 1rem; text-align: center; font-size: .85rem; background: var(--cream); }

/* Chat */
.chat { display: flex; flex-direction: column; height: 460px; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; background: linear-gradient(180deg, var(--cream), var(--paper)); }
.msg { display: flex; gap: .55rem; max-width: 85%; }
.msg img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.msg .bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: .5rem .75rem; font-size: .9rem; white-space: pre-wrap; word-wrap: break-word; }
.msg .meta { font-size: .7rem; color: var(--muted); margin-bottom: 2px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--maroon); color: #fff7e6; border-color: var(--maroon); border-radius: 14px 4px 14px 14px; }
.msg.mine .meta { text-align: right; }
.msg.system { align-self: center; max-width: 95%; }
.msg.system .bubble { background: var(--saffron-soft); border-color: #f0d79a; color: #6b4600; font-size: .8rem; border-radius: 99px; padding: .3rem .9rem; text-align: center; }
.chat-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); }
.chat-form textarea { flex: 1; min-height: 42px; height: 42px; resize: none; }

/* Itinerary */
.day-block + .day-block { border-top: 1px solid var(--line); }
.day-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.4rem; background: var(--cream); }
.day-head h4 { margin: 0; font-size: 1.15rem; }
.stop { display: flex; gap: .8rem; padding: .75rem 1.4rem; align-items: flex-start; border-top: 1px dashed var(--line); }
.stop .num { width: 28px; height: 28px; border-radius: 50%; background: var(--parchment); border: 1px solid var(--line-2); display: grid; place-items: center; font: 700 .8rem var(--font-body); color: var(--maroon); flex: none; }
.stop.done .num { background: var(--jade); color: #fff; border-color: var(--jade); }
.stop.done .title { text-decoration: line-through; color: var(--muted); }
.stop .title { font-weight: 700; }
.stop .body { flex: 1; min-width: 0; }
.stop-pin { width: 26px; height: 26px; border-radius: 50%; background: var(--saffron); color: var(--maroon-900); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; font: 800 .75rem var(--font-body); }
.stop-pin.done { background: var(--jade); color: #fff; }
details.inline-form > summary { cursor: pointer; list-style: none; }
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form[open] > summary { margin-bottom: .8rem; }

/* Safety */
.sos-banner { background: var(--red); color: #fff; border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; animation: sosflash 1.6s ease-in-out infinite; }
.sos-banner strong { font-size: 1.05rem; }
@keyframes sosflash { 50% { box-shadow: 0 0 0 6px rgba(168,53,43,.25); } }
.alert-row { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1.4rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.alert-row:first-child { border-top: 0; }
.btn-sos { --bg: var(--red); --fg: #fff; --bd: var(--red); font-size: 1.05rem; padding: 1rem 1.6rem; letter-spacing: .08em; }
.sos-pin { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font: 800 .7rem var(--font-body); border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(168,53,43,.35); animation: pulse 1.2s infinite; }

/* Calendar */
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; padding: .3rem 0; }
.cal td { height: 64px; vertical-align: top; border-radius: 9px; padding: .3rem .4rem; font-size: .8rem; background: var(--cream); border: 1px solid var(--line); position: relative; overflow: hidden; }
.cal td .d { font-weight: 800; }
.cal td .lbl { display: block; font-size: .64rem; line-height: 1.2; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal td.out { opacity: .35; }
.cal td.free { background: #fff; }
.cal td.booked { background: var(--maroon); color: #fff7e6; border-color: var(--maroon); }
.cal td.pending { background: var(--saffron-soft); border-color: #f0d79a; color: #6b4600; }
.cal td.blocked { background: repeating-linear-gradient(135deg, #efe5d3 0 6px, #e6d8bf 6px 12px); color: var(--muted); }
.cal td.past { background: var(--parchment); color: var(--muted); }
.cal td.today { box-shadow: inset 0 0 0 2px var(--saffron); }
.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }
@media (max-width: 640px) { .cal td { height: 46px; } .cal td .lbl { display: none; } }

/* Payments & invoice */
.pay-meter { height: 10px; border-radius: 99px; background: var(--parchment); overflow: hidden; }
.pay-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--jade), #4f9b84); }
.money { font: 700 1.5rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--maroon-900); }
.num-right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 3rem; }
.invoice table { width: 100%; border-collapse: collapse; }
.invoice th { text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--maroon); padding: .6rem .4rem; }
.invoice td { padding: .65rem .4rem; border-bottom: 1px solid var(--line); }
.invoice .stamp { display: inline-block; border: 3px solid currentColor; border-radius: 8px; padding: .3rem 1rem; font: 800 1.1rem var(--font-body); letter-spacing: .2em; text-transform: uppercase; transform: rotate(-6deg); }
@media print {
  body { background: #fff; }
  .no-print, .prayer-flags { display: none !important; }
  .invoice { border: 0; padding: 0; }
}

/* Reports */
.hbar { display: grid; grid-template-columns: 140px 1fr 48px; gap: .6rem; align-items: center; font-size: .85rem; padding: .3rem 0; }
.hbar .track { height: 10px; background: var(--parchment); border-radius: 99px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--saffron)); }
.bars.dual .bar { flex-direction: row; align-items: flex-end; gap: 3px; position: relative; }
.bars.dual .bar .fill { width: 45%; max-width: 22px; border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bars.dual .fill.a { background: linear-gradient(180deg, var(--saffron), var(--gold)); }
.bars.dual .fill.b { background: linear-gradient(180deg, #4f9b84, var(--jade)); }
.bars.dual .bar small { position: absolute; bottom: -1.4rem; left: 0; right: 0; text-align: center; }
.export-grid a { display: flex; gap: .8rem; align-items: center; padding: 1rem 1.2rem; }
.export-grid a:hover { background: #fffaf0; }

/* Hire-form itinerary builder */
.itin-grid { display: grid; grid-template-columns: 150px 110px minmax(0, 1fr); gap: .6rem; }
.itin-grid .itin-place { grid-column: 1 / 3; }
@media (max-width: 640px) { .itin-grid { grid-template-columns: 1fr; } .itin-grid .itin-place { grid-column: auto; } }
