/* ============================================================
   Parivartanam — premium wellness design system
   Palette drawn from the logo: copper coin + lotus-flame petals
   (copper · saffron-gold · deep green · blue · red · purple · cream)
   ============================================================ */
:root {
  --bg:        #FBF6EE;
  --bg-2:      #F3ECE1;
  --surface:   #FFFFFF;
  --surface-2: #F4EDE2;
  --ink:       #2B211A;
  --ink-2:     #4A3E33;
  --muted:     #7C6C5B;
  --line:      rgba(43,33,26,.09);
  --line-2:    rgba(43,33,26,.06);

  /* copper coin — brand mark accent */
  --copper:    #B87A52;
  --copper-2:  #9C6845;
  --copper-soft:#F4E7DB;

  /* gold petal (saffron) */
  --saffron:   #D9931E;
  --saffron-2: #B27714;
  --saffron-soft:#F8ECD2;
  --amber:     #E9AB43;

  /* green petal — primary brand */
  --green:     #1F7A43;
  --green-2:   #175E34;
  --green-bright:#37A85C;
  --green-soft:#E7F0E7;

  /* lotus accents */
  --terra:     #C24A34;
  --terra-soft:#F7DCD1;
  --red:       #D8382F;
  --red-soft:  #F8DBD5;
  --blue:      #3E74E0;
  --blue-soft: #DDE4F6;
  --purple:    #8E3FB0;
  --purple-soft:#ECDFF3;
  --cream:     #EAD6B2;

  --danger:    #D8382F;
  --ok:        var(--green);

  --radius:   22px;
  --radius-sm:15px;
  --radius-lg:28px;
  --shadow:   0 1px 3px rgba(58,40,24,.05), 0 8px 22px rgba(58,40,24,.06);
  --shadow-lg:0 12px 36px rgba(58,40,24,.13);
  --nav-h:    70px;
  --maxw:     1120px;

  --brand-grad: linear-gradient(140deg,#F3D9C4 0%,#D49A72 46%,#B87A52 100%);
  --hero-grad:  radial-gradient(130% 130% at 18% 0%,#2A9358 0%,#1F7A43 48%,#175E34 100%);

  --font:    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;

  color-scheme: light;
}

/* ---------- dark mode (JS sets data-theme; "system" resolves to light/dark) ---------- */
:root[data-theme="dark"] {
    --bg:        #161210;
    --bg-2:      #211B16;
    --surface:   #211B16;
    --surface-2: #2C241C;
    --ink:       #F3E9DC;
    --ink-2:     #DBCDBB;
    --muted:     #B0A08D;
    --line:      rgba(255,255,255,.10);
    --line-2:    rgba(255,255,255,.06);

    --copper:    #D49A72;
    --copper-2:  #E0AF8A;
    --copper-soft:rgba(212,154,114,.16);

    --saffron:   #F0B845;
    --saffron-2: #F6C63D;
    --saffron-soft:rgba(240,184,69,.16);
    --amber:     #F0B845;

    --green:     #43B96A;
    --green-2:   #5BCF82;
    --green-bright:#5BCF82;
    --green-soft:rgba(67,185,106,.16);

    --terra:     #E8776A;
    --terra-soft:rgba(216,56,47,.18);
    --red:       #F0655B;
    --red-soft:  rgba(216,56,47,.18);
    --blue:      #6E9BF0;
    --blue-soft: rgba(62,116,224,.18);
    --purple:    #B673D6;
    --purple-soft:rgba(142,63,176,.20);

    --danger:    #F0655B;
    --shadow:    0 1px 3px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.35);
    --shadow-lg: 0 14px 40px rgba(0,0,0,.55);
    --brand-grad: linear-gradient(140deg,#E7B896 0%,#C68E66 50%,#9C6845 100%);
    --hero-grad:  radial-gradient(130% 130% at 18% 0%,#2A9358 0%,#1E6E3D 52%,#124026 100%);

    color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Prevent horizontal page jiggle WITHOUT turning the root into a scroll
   container. `overflow-x: hidden` on html/body forces overflow-y to compute
   to `auto`, which on iOS Safari freezes vertical touch-scrolling on any page
   that has horizontally-overflowing content to clip (e.g. the admin Users
   view's wide filter-tab strip). `overflow-x: clip` clips the same overflow
   but keeps overflow-y `visible`, so normal viewport scrolling is preserved.
   The `hidden` line is a fallback for browsers without `clip` support. */
html, body { margin: 0; padding: 0; overflow-x: hidden; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1,h2,h3,h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--ink); font-family: var(--display); }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-2); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 2px; border-radius: 8px; }

/* ---------- layout ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.screen { max-width: var(--maxw); margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 28px); }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .screen { padding: 28px 34px 40px; }
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px){ .topbar { padding: 16px 34px; } }
.topbar .brand-mark { width: 34px; height: 34px; }
.topbar h1 { font-size: 1.15rem; }
.topbar .spacer { flex: 1; }

/* ---------- sidebar (desktop) / bottom nav (mobile) ---------- */
.sidebar { display: none; }
@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    padding: 22px 16px; position: sticky; top: 0; height: 100vh;
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
  .sidebar .logo b { font-size: 1.15rem; letter-spacing: -.02em; }
  .sidebar a.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--ink-2); font-weight: 600; font-size: .94rem; }
  .sidebar a.nav-item svg { width: 20px; height: 20px; opacity: .8; }
  .sidebar a.nav-item:hover { background: var(--surface-2); }
  .sidebar a.nav-item.active { background: var(--green-soft); color: var(--green); }
  .sidebar a.nav-item.active svg { opacity: 1; }
  .sidebar .side-foot { margin-top: auto; }
}

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: center;
  height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px){ .bottomnav { display: none; } }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: .66rem; font-weight: 700; flex: 1; padding: 6px 0; transition: color .2s; }
.bottomnav a svg { width: 22px; height: 22px; transition: transform .25s; }
.bottomnav a.active { color: var(--green); }
.bottomnav a.active svg { transform: translateY(-1px) scale(1.08); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card.pad-lg { padding: 22px; }
.card.tight { padding: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.card-h h3 { font-size: 1.02rem; }
.grid { display: grid; gap: 14px; }
.grid > *, .row > * { min-width: 0; }  /* responsive: never let a child force horizontal overflow */
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
/* Small screens: stack image tiles vertically (one per row) instead of a
   cramped 2-up row that clips on narrow phones. */
@media (max-width: 480px){ .grid.cols-2 { grid-template-columns: 1fr; } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 680px){ .grid.cols-4 { grid-template-columns: repeat(4,1fr);} .grid.auto { grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); } }
@media (min-width: 900px){ .grid.md-2 { grid-template-columns: 1.5fr 1fr; } .grid.md-3 { grid-template-columns: repeat(3,1fr);} }
.grid.auto { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px){ .grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); } }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }
.section-title h2 { font-size: 1.12rem; }
.hello { margin: 4px 2px 18px; }
.hello .greet { color: var(--muted); font-weight: 600; font-size: .9rem; }
.hello h1 { font-size: 1.7rem; margin-top: 2px; }

/* ---------- stat tiles ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow); }
.stat .lbl { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 1.6rem; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; font-family: var(--display); }
.stat .val small { font-size: .8rem; font-weight: 600; color: var(--muted); font-family: var(--font); }
.stat .sub { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.stat.accent { background: var(--brand-grad); border: none; color: #fff; }
.stat.accent .lbl, .stat.accent .sub { color: rgba(255,255,255,.92); }
.stat.green { background: var(--hero-grad); border: none; color: #fff; }
.stat.green .lbl, .stat.green .sub { color: rgba(255,255,255,.88); }
.stat .icn { width: 16px; height: 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer;
  font-weight: 700; font-size: .92rem; padding: 11px 18px; border-radius: 13px; transition: transform .05s, filter .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-2); }
.btn.green { background: var(--green); color: #fff; }
.btn.green:hover { background: var(--green-2); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.soft { background: var(--copper-soft); color: var(--copper-2); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 13px; font-size: .84rem; border-radius: 11px; }
.btn.icon { padding: 9px; border-radius: 11px; }
.btn.danger { background: var(--terra-soft); color: var(--terra); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---- action-in-progress cue (double-submit guard, wired in app.js) ---- */
.is-busy { pointer-events: none; }
.is-busy::before {
  content: ''; width: 15px; height: 15px; flex: 0 0 auto; box-sizing: border-box;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  opacity: .9; animation: pari-spin .6s linear infinite;
}
@keyframes pari-spin { to { transform: rotate(360deg); } }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); cursor: pointer; }
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.chip.on { background: var(--saffron-soft); color: var(--saffron-2); border-color: transparent; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; }
.badge.green { background: var(--green-soft); color: var(--green-2); }
.badge.saffron { background: var(--saffron-soft); color: var(--saffron-2); }
.badge.red { background: var(--terra-soft); color: var(--terra); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.grey { background: var(--bg-2); color: var(--muted); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
textarea { resize: vertical; min-height: 78px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

/* ---------- progress visuals ---------- */
.bar { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--amber), var(--saffron)); transition: width .5s ease; }
.bar.green > span { background: linear-gradient(90deg, var(--green-bright), var(--green)); }
.bar.blue > span { background: linear-gradient(90deg, #6FA0BE, var(--blue)); }
.bar.copper > span { background: linear-gradient(90deg, #D49A72, var(--copper)); }
.macro-row { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; margin-bottom: 5px; }
.macro-row span:last-child { color: var(--muted); }

.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 118px; height: 118px; flex: none; }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .center b { font-size: 1.6rem; font-weight: 600; font-family: var(--display); }
.ring .center small { font-size: .68rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }

/* ---------- avatars & lists ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex: none; font-size: .95rem; }
.avatar.lg { width: 62px; height: 62px; font-size: 1.3rem; }
.avatar.sm { width: 34px; height: 34px; font-size: .8rem; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow .t { font-weight: 700; font-size: .92rem; }
.list-item .grow .s { font-size: .8rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { white-space: nowrap; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .86rem; color: var(--muted); cursor: pointer; background: var(--surface-2); border: 1px solid var(--line); }
.tabs .tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.tabs .tab .pill-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; font-size: .68rem; font-weight: 800; background: rgba(0,0,0,.08); }
.tabs .tab.active .pill-count { background: rgba(255,255,255,.22); }

/* ---------- user management ---------- */
.user-row .user-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.role-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.role-seg.block { display: flex; }
.role-seg.block button { flex: 1; }
.role-seg button { border: none; background: none; cursor: pointer; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .8rem; color: var(--muted); transition: background .15s, color .15s; }
.role-seg button.on { background: var(--green); color: #fff; box-shadow: var(--shadow); }
.role-seg button:not(.on):hover { color: var(--ink); }
.role-seg.locked { opacity: .7; }
.role-seg button[disabled] { cursor: default; }
@media (max-width: 560px) {
  .user-row { flex-wrap: wrap; }
  .user-row .user-actions { width: 100%; margin-top: 8px; justify-content: space-between; }
}

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.4; }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble .when { display: block; font-size: .64rem; opacity: .7; margin-top: 3px; }

/* ---------- table ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); }
table.data tr:hover td { background: var(--surface-2); }

/* ---------- modal / sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgba(43,38,32,.42); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
@media (min-width: 700px){ .overlay { align-items: center; } }
.sheet { background: var(--surface); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; max-height: 92dvh; overflow-y: auto; animation: slideup .22s ease; }
@media (min-width: 700px){ .sheet { border-radius: 22px; } }
.sheet .sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
@keyframes slideup { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: calc(var(--nav-h) + 16px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 13px; font-weight: 600; font-size: .88rem; box-shadow: var(--shadow-lg); animation: slideup .2s; max-width: 90%; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--danger); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden;
  background: var(--hero-grad); }
/* soft light pooling so the large desktop field reads as depth, not flat paint */
.auth-wrap::before { content: ''; position: absolute; inset: -20%; pointer-events: none;
  background:
    radial-gradient(42% 46% at 22% 26%, rgba(255,255,255,.16), transparent 70%),
    radial-gradient(38% 42% at 82% 78%, rgba(198,124,58,.22), transparent 72%),
    radial-gradient(60% 60% at 50% 120%, rgba(0,0,0,.30), transparent 70%); }
.auth-wrap .auth-theme { position: fixed; top: calc(18px + env(safe-area-inset-top)); right: 18px; z-index: 5; color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); backdrop-filter: blur(8px); }
.auth-wrap .auth-theme:hover { background: rgba(255,255,255,.24); }
.auth-shell { position: relative; z-index: 1; width: 100%; max-width: 420px; display: flex; justify-content: center; }
.auth-aside { display: none; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px 26px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.12); }

/* desktop: two-column composition — brand story left, form right */
@media (min-width: 900px) {
  .auth-wrap { padding: 40px; }
  .auth-shell { max-width: 1000px; display: grid; grid-template-columns: 1fr 420px; align-items: center; gap: 72px; }
  .auth-aside { display: block; color: #fff; }
  /* the mark is a copper coin on an off-white plate: crop the plate away and
     ring the coin so it reads cleanly against the dark green field */
  .auth-aside-mark { width: 88px; height: 88px; margin-bottom: 28px; border-radius: 50%; overflow: hidden; position: relative;
    box-shadow: 0 0 0 1px rgba(255,255,255,.30), 0 14px 34px -8px rgba(0,0,0,.55); }
  .auth-aside-mark svg, .auth-aside-mark img { width: 100%; height: 100%; border-radius: 50%; display: block;
    object-fit: cover; transform: scale(1.14);
    /* decorative mark (the h1 below carries the name) — never let alt text spill */
    font-size: 0; color: transparent; }
  .auth-aside h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 3.6vw, 3.4rem); line-height: 1.04; letter-spacing: -.025em; margin: 0 0 14px; }
  .auth-aside-about { display: flex; align-items: baseline; gap: 10px; margin: 0 0 22px; font-size: .82rem; letter-spacing: .14em;
    text-transform: uppercase; color: rgba(255,255,255,.55); }
  .auth-aside-about span { font-size: 1.02rem; letter-spacing: 0; text-transform: none; color: var(--saffron, #e0a33c); font-family: var(--display); }
  .auth-aside-about em { font-style: normal; color: rgba(255,255,255,.82); }
  .auth-aside-tag { font-size: 1.06rem; line-height: 1.6; color: rgba(255,255,255,.78); max-width: 30ch; margin: 0 0 30px; text-wrap: pretty; }
  .auth-aside-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
  .auth-aside-list li { position: relative; padding-left: 22px; font-size: .94rem; color: rgba(255,255,255,.68); }
  .auth-aside-list li::before { content: ''; position: absolute; left: 0; top: .52em; width: 7px; height: 7px; border-radius: 50%; background: var(--saffron, #e0a33c); }
  .auth-card { padding: 38px 34px; border-radius: 24px; }
  .auth-wrap .auth-card .brand { display: none; }
  .auth-wrap .auth-card .tag { font-size: 1.05rem; color: var(--ink); font-family: var(--display); font-weight: 600; margin-bottom: 24px; }
}
.auth-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-card .brand b { font-size: 1.5rem; letter-spacing: -.02em; font-family: var(--display); font-weight: 600; }
.auth-card .tag { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.role-toggle { display: flex; gap: 8px; margin-bottom: 18px; }
.role-toggle button { flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; cursor: pointer; color: var(--ink-2); }
.role-toggle button.active { background: var(--green); color: #fff; border-color: var(--green); }
.demo-note { margin-top: 16px; font-size: .78rem; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
.link-btn { background: none; border: none; color: var(--green-2); font-weight: 700; cursor: pointer; padding: 0; font-size: .9rem; }
.auth-recover { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.auth-recover .link-btn { color: var(--copper-2); font-size: .85rem; }
.auth-recover .link-btn:hover { color: var(--copper); }
.auth-recover .auth-dot { color: var(--muted); font-size: .85rem; }
.auth-card .brand-mark { box-shadow: 0 4px 14px rgba(140,80,40,.28); }
.auth-site { text-align: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.auth-site a { color: var(--copper-2); font-weight: 700; font-size: .84rem; }
.auth-site a:hover { color: var(--copper); }
.pending-check { width: 64px; height: 64px; margin: 18px auto 6px; border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; box-shadow: 0 6px 18px rgba(46,107,78,.35); animation: slideup .3s ease; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 10px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center-col { display: flex; flex-direction: column; align-items: center; }
.notif-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; background: var(--terra); border-radius: 50%; border: 2px solid var(--surface); }
.iconbtn { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px; cursor: pointer; display: inline-flex; }
.iconbtn svg { width: 20px; height: 20px; }
.skeleton { background: linear-gradient(90deg, var(--line-2), var(--surface-2), var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px); z-index: 35; width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff; border: none; box-shadow: var(--shadow-lg); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px){ .fab { display: none; } }

/* Temporary-password display (admin reset) */
.temp-pw { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--surface-2, #f3ece0); border: 1px dashed var(--line, #d9cdb8); border-radius: 12px; padding: 12px 14px; }
.temp-pw code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; font-weight: 700; letter-spacing: .5px; color: var(--ink, #2a231b); word-break: break-all; }


/* --- Mood & energy quick-log pickers ------------------------------------- */
.mood-pick { display: flex; gap: 8px; }
.mood-opt { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 4px 9px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1.5px solid var(--line); cursor: pointer; transition: transform .1s, background .15s, border-color .15s; }
.mood-opt .e { font-size: 1.7rem; line-height: 1; filter: grayscale(.4) opacity(.8); transition: filter .15s, transform .15s; }
.mood-opt .l { font-size: .7rem; font-weight: 700; color: var(--muted); }
.mood-opt:hover { border-color: var(--green-bright); }
.mood-opt:active { transform: scale(.95); }
.mood-opt.sel { background: var(--green-soft); border-color: var(--green); }
.mood-opt.sel .e { filter: none; transform: scale(1.14); }
.mood-opt.sel .l { color: var(--green-2); }

.energy-read { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.energy-read .ev { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--saffron-2); }
.energy-read .emax { font-size: .85rem; font-weight: 700; color: var(--muted); }
.energy-read .eword { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--saffron-2);
  background: var(--saffron-soft); padding: 4px 12px; border-radius: 999px; }
.energy-range { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 999px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--saffron) var(--pct, 66%), var(--surface-2) var(--pct, 66%)); }
.energy-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 4px solid var(--saffron); box-shadow: var(--shadow); cursor: pointer; }
.energy-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid var(--saffron); cursor: pointer; box-shadow: var(--shadow); }
.energy-scale { display: flex; justify-content: space-between; margin-top: 7px; font-size: .72rem; font-weight: 600; color: var(--muted); }
