/* Shanti Dham admin: calm, legible, built for daily use. Brand tokens shared with the site. */
:root {
  --night: #0a0807; --night-2: #17110e; --bone: #ede5d8; --smoke: #a39889;
  --bg: #f4f0e9; --card: #fffdf9; --ink: #1d1612; --muted: #6f6359; --line: #e6ddd0; --line-2: #d9cdbd;
  --ember: #e36a1e; --ember-ink: #a8470d; --ember-soft: #fbe7d8;
  --ok: #2f7d4f; --ok-soft: #e1f1e6; --warn: #9a5b00; --warn-soft: #fbedd2; --bad: #b42318; --bad-soft: #fde4e1; --blue: #2e5aac; --blue-soft: #e3ebfa;
  --f: "Instrument Sans", system-ui, -apple-system, sans-serif; --fd: "Bodoni Moda", Georgia, serif; --fdeva: "Tiro Devanagari Sanskrit", "Kohinoor Devanagari", serif;
  --r: 12px; --side: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--f); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2 { margin: 0; font-weight: 400; }
p { margin: 0; }
.i { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: fixed; left: 12px; top: 10px; z-index: 99; background: var(--ember); color: #fff; padding: 8px 14px; border-radius: 8px; translate: 0 -200%; }
.skip:focus { translate: 0 0; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.grow { flex: 1; min-width: 0; }

/* ---------- Shell ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--night); color: var(--bone); display: flex; flex-direction: column; padding: 20px 14px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand .om { width: 40px; height: 40px; border-radius: 50%; background: var(--bone); color: var(--night); display: grid; place-items: center; font: 400 24px/1 var(--fdeva); padding-top: 3px; }
.brand b { display: block; font: 500 18px/1 var(--fd); letter-spacing: -0.01em; }
.brand small { color: var(--smoke); font-size: 12px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfc4b6; font-weight: 500; transition: background .2s, color .2s; }
.side nav a:hover { background: rgba(237, 229, 216, .07); color: var(--bone); }
.side nav a.on { background: rgba(227, 106, 30, .16); color: #fff; }
.side nav a.on .i { color: var(--ember); }
.side nav .count { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; background: var(--ember); color: var(--night); border-radius: 999px; padding: 1px 8px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(237, 229, 216, .12); }
.me .who { flex: 1; min-width: 0; }
.me b { display: block; font-size: 14px; }
.me small { display: block; color: var(--smoke); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me form { margin: 0; }
.iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: inherit; }
.iconbtn:hover { background: rgba(127, 110, 95, .14); }
.main { margin-left: var(--side); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(244, 240, 233, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.menu-toggle { display: none; }
.gsearch, .search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 42px; flex: 1; max-width: 520px; transition: border-color .2s, box-shadow .2s; }
.gsearch:focus-within, .search:focus-within { border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.gsearch input, .search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; }
.gsearch .i, .search .i { color: var(--muted); }
.viewsite { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: 14px; }
.viewsite:hover { color: var(--ink); }
.viewsite .i { width: 15px; height: 15px; }
.content { padding: 28px 32px 80px; max-width: 1400px; }
.flash { margin-bottom: 20px; padding: 12px 16px; background: var(--ok-soft); color: var(--ok); border-radius: 10px; font-weight: 500; animation: flash-in .4s ease; }
@keyframes flash-in { from { opacity: 0; translate: 0 -6px; } }

/* ---------- Headings ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
h1 { font: 400 clamp(30px, 3vw, 40px)/1.05 var(--fd); letter-spacing: -0.02em; }
h2 { font: 600 16px/1.3 var(--f); }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s, translate .15s; }
.btn:hover { border-color: var(--ink); }
.btn:active { translate: 0 1px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: #000; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted); padding: 0 10px; }
.btn.subtle:hover { color: var(--ink); background: rgba(127, 110, 95, .1); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn .i { width: 16px; height: 16px; }
.link { color: var(--ember-ink); font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }

/* ---------- Cards & KPIs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 4px; transition: border-color .2s, translate .2s, box-shadow .2s; }
.kpi:hover { border-color: var(--line-2); translate: 0 -2px; box-shadow: 0 10px 24px -18px rgba(29, 22, 18, .5); }
.kpi .lab { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi b { font: 400 34px/1.1 var(--fd); letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi.hot { border-color: var(--ember); background: linear-gradient(var(--card), var(--ember-soft)); }
.kpi.warn b { color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.stats > div { background: var(--card); padding: 16px 18px; display: grid; gap: 2px; }
.stats .lab { font-size: 12px; color: var(--muted); font-weight: 500; }
.stats b { font: 400 24px/1.2 var(--fd); letter-spacing: -0.01em; }
.stats small { font-size: 12px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.two.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.two > .card, .stack > .card { margin-bottom: 0; }
.stack { display: grid; gap: 20px; }
.empty { padding: 32px 20px; color: var(--muted); text-align: center; }

/* chart */
.bars { display: grid; grid-template-columns: repeat(30, 1fr); align-items: end; gap: 4px; height: 140px; }
.bars span { height: 100%; display: flex; align-items: flex-end; }
.bars i { display: block; width: 100%; height: max(var(--h), 2px); background: var(--ember); border-radius: 4px 4px 1px 1px; opacity: .85; transition: opacity .2s; transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.bars span:hover i { opacity: 1; }
@keyframes grow { from { scale: 1 0; } }
.bars-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* rows list */
.rows { list-style: none; margin: 0 -8px; padding: 0; }
.rows a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; transition: background .15s; }
.rows a:hover { background: var(--bg); }
.rows b { display: block; font-weight: 600; font-size: 14px; }
.rows small { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* avatars & badges */
.av { width: 40px; height: 40px; border-radius: 50%; background: var(--ember-soft); color: var(--ember-ink); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.av.lg { width: 64px; height: 64px; font-size: 22px; font-family: var(--fd); }
.side .av { background: rgba(227, 106, 30, .2); color: var(--ember); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.s-new { background: var(--ember-soft); color: var(--ember-ink); }
.badge.s-contacted { background: var(--blue-soft); color: var(--blue); }
.badge.s-booked { background: var(--ok-soft); color: var(--ok); }
.badge.s-closed { background: var(--bg); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.s-new { background: var(--ember); } .dot.s-contacted { background: var(--blue); } .dot.s-booked { background: var(--ok); }

/* ---------- Toolbar, tabs, table ---------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar .search { max-width: 340px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.tabs a { padding: 7px 14px; border-radius: 7px; font-weight: 500; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--ink); color: var(--bg); }
.tabs em { font-style: normal; font-size: 12px; opacity: .7; margin-left: 2px; }
.filters { justify-content: flex-start; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters select, .filters input { height: 38px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; background: var(--card); color: var(--ink); font-weight: 400; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fbf8f3; white-space: nowrap; }
.table th.r { text-align: right; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; transition: background .15s; }
.table tr[data-href]:hover { background: #faf6ef; }
.table tr.unread .person b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--ember); vertical-align: middle; }
.table tr.unread b { font-weight: 700; }
.table tr.dim { opacity: .55; }
.table .clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person b { display: block; font-weight: 600; }
.person small { display: block; color: var(--muted); font-size: 13px; }
.card:not(.flush) .table th, .card:not(.flush) .table td { padding-left: 0; }
.card:not(.flush) .table th { background: transparent; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.pager a { font-weight: 600; color: var(--ink); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); }

/* ---------- Profile pages ---------- */
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 22px; }
.profile-head h1 { margin-bottom: 4px; }
.profile-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form { display: grid; gap: 14px; }
.form label, .note-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input, .form select, .form textarea, .note-form textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--ink); font-weight: 400; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.form input, .form select { height: 44px; }
.form input:focus, .form select:focus, .form textarea:focus, .note-form textarea:focus { outline: 0; border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.form .btn { justify-self: start; }
.hint { font-size: 13px; color: var(--muted); }
.card form.inline .btn { margin-top: 10px; }
.note-form { display: grid; gap: 10px; margin-bottom: 18px; }
.note-form .btn { justify-self: start; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 16px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 3px var(--card); }
.timeline li.origin::before { background: var(--line-2); }
.timeline p { white-space: pre-line; margin-bottom: 2px; }
.message { font-size: 16px; line-height: 1.6; padding: 16px; background: var(--bg); border-radius: 10px; margin-bottom: 18px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.pipeline { display: grid; gap: 6px; margin-bottom: 12px; }
.pipeline button { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 600; cursor: pointer; text-align: left; transition: border-color .2s, background .2s; }
.pipeline button:hover { border-color: var(--line-2); background: var(--bg); }
.pipeline button.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
details.card summary { cursor: pointer; font-weight: 600; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card[open] summary { margin-bottom: 14px; }
details.danger summary { color: var(--bad); }

/* toggle */
.switch { width: 40px; height: 24px; border-radius: 999px; border: 0; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; }
.switch span { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: translate .25s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch.on { background: var(--ok); }
.switch.on span { translate: 16px 0; }

/* ---------- Login ---------- */
.login-page { background: var(--night); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(360px, 480px); }
.login-art { position: relative; overflow: hidden; background: radial-gradient(55% 55% at 50% 50%, rgba(227, 106, 30, .32), transparent 70%), var(--night); display: grid; place-items: center; }
.login-art .om { translate: 0 8%; font: 400 min(30vw, 380px)/1 var(--fdeva); color: rgba(237, 229, 216, .1); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 50% { scale: 1.04; color: rgba(237, 229, 216, .16); } }
.login-card { background: var(--bg); padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.login-card h1 { font-size: 52px; margin-bottom: 10px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-card input { height: 48px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 14px; background: #fff; font-size: 15px; }
.login-card input:focus { outline: 0; border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.login-card .btn { height: 48px; margin-top: 6px; }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 10px; font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two, .two.wide-left { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .side { translate: -100% 0; visibility: hidden; transition: translate .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; }
  body.nav-open .side { translate: 0 0; visibility: visible; transition: translate .3s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 40px rgba(0, 0, 0, .3); }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .top { padding: 10px 16px; }
  .viewsite { display: none; }
  .content { padding: 20px 16px 64px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { padding: 40px 24px; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } .kpi b { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Website pages + blog editors */
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.imgs figure { margin: 0; display: grid; gap: 8px; align-content: start; }
.imgs img, .cover-prev { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--line); display: block; }
.imgs figcaption { font-size: 12px; color: var(--muted); word-break: break-all; }
.imgs input[type=file] { font-size: 13px; max-width: 100%; }
.check-row, .form .check-row { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 400; color: var(--muted); }
.segs { display: grid; gap: 14px; }
.seg { display: grid; gap: 6px; }
.seg textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; resize: vertical; field-sizing: content; }
.seg.changed textarea { border-color: var(--ember); background: var(--ember-soft); }
.seg small { color: var(--muted); font-size: 12px; }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 -8px 24px -16px rgba(0, 0, 0, 0.25); }
.body-input { min-height: 320px; font: 400 15px/1.6 var(--f); }
.form .check-row input, .imgs .check-row input { width: auto; height: auto; accent-color: var(--ember); }
.form .imgs input[type=file] { height: auto; padding: 6px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
