/**
 * epulse.css — Central design system for Epulse Events
 *
 * Every organiser page includes this file. Page-specific CSS is minimal and
 * only overrides or extends what's here. Design language: claymorphism dark,
 * mobile-first, no borders (depth via layered box-shadow), warm clay light mode.
 *
 * Theme: html.dark (default) / html.light (set from profile.html toggle)
 * Applied before paint by inline <script> in each page's <head>.
 */

/* ─────────────────────────────────────────────
   DARK THEME (default — values live in :root so
   they apply even before the class is set)
   ───────────────────────────────────────────── */
:root,
html.dark {
  --bg:        #0D0D0F;
  --surface:   #1A1A1F;
  --surface-2: #222228;
  --surface-3: #2C2C34;
  --surface-4: #36363F;

  --text:   #F2F2F3;
  --text-2: #9898A6;
  --muted:  #55555F;

  --inset:   rgba(0,0,0,.38);
  --inset-2: rgba(0,0,0,.55);
  --highlight: rgba(255,255,255,.055);

  /* Claymorphism shadows */
  --clay-xs:  0 2px 8px rgba(0,0,0,.5),  inset 0 1px 0 rgba(255,255,255,.05);
  --clay-sm:  0 4px 16px rgba(0,0,0,.55), 0 1px 4px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
  --clay:     0 8px 28px rgba(0,0,0,.6),  0 2px 8px rgba(0,0,0,.4),  inset 0 1px 0 rgba(255,255,255,.06);
  --clay-lg:  0 16px 48px rgba(0,0,0,.7), 0 4px 14px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.07);
  --clay-accent: 0 6px 24px rgba(255,92,40,.4), 0 2px 8px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2);
  --clay-nav: 0 -4px 20px rgba(0,0,0,.45), 0 8px 28px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08);

  /* Icon chip backgrounds */
  --chip-orange: rgba(255,92,40,.18);
  --chip-blue:   rgba(59,130,246,.18);
  --chip-green:  rgba(34,197,94,.18);
  --chip-gold:   rgba(245,158,11,.18);
  --chip-purple: rgba(139,92,246,.18);
  --chip-red:    rgba(239,68,68,.18);
}

/* ─────────────────────────────────────────────
   LIGHT THEME (warm clay)
   ───────────────────────────────────────────── */
html.light {
  --bg:        #EBE7E0;
  --surface:   #FAFAF8;
  --surface-2: #F0EDE7;
  --surface-3: #E4E0D8;
  --surface-4: #D4CFCA;

  --text:   #1C1917;
  --text-2: #6B6560;
  --muted:  #A39D97;

  --inset:   rgba(0,0,0,.06);
  --inset-2: rgba(0,0,0,.1);
  --highlight: rgba(255,255,255,.9);

  --clay-xs:  0 2px 8px rgba(0,0,0,.08),  0 1px 2px rgba(0,0,0,.04);
  --clay-sm:  0 4px 16px rgba(0,0,0,.1),  0 2px 5px rgba(0,0,0,.06);
  --clay:     0 8px 28px rgba(0,0,0,.12), 0 3px 10px rgba(0,0,0,.07);
  --clay-lg:  0 16px 48px rgba(0,0,0,.14),0 6px 16px rgba(0,0,0,.08);
  --clay-accent: 0 6px 24px rgba(255,92,40,.3), 0 2px 8px rgba(255,92,40,.12), inset 0 1px 0 rgba(255,255,255,.4);
  --clay-nav: 0 -2px 12px rgba(0,0,0,.06),0 8px 28px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.95);

  --chip-orange: rgba(255,92,40,.12);
  --chip-blue:   rgba(59,130,246,.12);
  --chip-green:  rgba(34,197,94,.12);
  --chip-gold:   rgba(245,158,11,.12);
  --chip-purple: rgba(139,92,246,.12);
  --chip-red:    rgba(239,68,68,.12);
}

/* ─────────────────────────────────────────────
   BRAND / ACCENT TOKENS (theme-invariant)
   ───────────────────────────────────────────── */
:root {
  --accent:      #FF5C28;
  --accent-2:    #FF7A4D;
  --accent-soft: rgba(255,92,40,.14);
  --accent-glow: rgba(255,92,40,.3);

  --green:       #22C55E;
  --green-soft:  rgba(34,197,94,.14);
  --blue:        #3B82F6;
  --blue-soft:   rgba(59,130,246,.14);
  --gold:        #F59E0B;
  --gold-soft:   rgba(245,158,11,.14);
  --purple:      #8B5CF6;
  --danger:      #EF4444;
  --danger-light: rgba(239,68,68,.14);

  /* Radius scale */
  --r-sm:   10px;
  --r:      14px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-2xl:  32px;
  --r-full: 9999px;

  /* Type scale */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-lg:   17px;
  --text-xl:   21px;
  --text-2xl:  26px;
  --text-3xl:  34px;

  --ease: .2s cubic-bezier(.4,0,.2,1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top:    env(safe-area-inset-top,    0px);

  /* Legacy aliases — older page <style> blocks reference these. Map them
     onto the claymorphism system so borders disappear (depth via shadow)
     and colours stay consistent. */
  --border:       transparent;
  --border-2:     transparent;
  --err:          var(--danger);
  --err-soft:     var(--danger-light);
  --ink:          var(--surface);
  --ink-2:        var(--surface-3);
}

/* ─────────────────────────────────────────────
   RESET
   ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: none; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(88px + var(--safe-bottom));
  transition: background .25s ease, color .25s ease;
}

a    { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; color: inherit; }
img  { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; }

/* Ambient glow – dark only */
html.dark body::before {
  content: '';
  position: fixed; top: -15vh; left: -5vw; right: -5vw; height: 55vh;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,92,40,.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ─────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────── */
header.top {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 20px 14px;
  gap: 12px;
  background: var(--bg);
}
html.dark header.top {
  background: rgba(13,13,15,.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Header layout helpers — guarantee the logo + title sit on one row and the
   actions hug the right, on every page (some pages only defined these in their
   own legacy CSS). */
header.top .header-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
header.top .header-right { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

.logo-mark {
  font-size: 17px; font-weight: 800; letter-spacing: -.04em;
  color: var(--text); flex-shrink: 0;
  background: var(--surface); padding: 6px 10px;
  border-radius: var(--r); box-shadow: var(--clay-xs);
}
.logo-mark span { color: var(--accent); }

.page-title {
  font-size: var(--text-xl); font-weight: 700;
  letter-spacing: -.02em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.page-title em { font-style: normal; color: var(--accent); }

.hdr-btn {
  width: 40px; height: 40px;
  background: var(--surface); border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 16px;
  box-shadow: var(--clay-xs); transition: all var(--ease); cursor: pointer;
}
.hdr-btn:active { transform: scale(.92); }

.avatar-hdr {
  width: 40px; height: 40px;
  background: var(--surface-3); border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  box-shadow: var(--clay-xs); transition: all var(--ease);
}

/* ─────────────────────────────────────────────
   CONTENT WRAPPER
   ───────────────────────────────────────────── */
.content {
  padding: 14px 16px;
  max-width: 820px;
  margin: 0 auto;
  position: relative; z-index: 1;
}

/* ─────────────────────────────────────────────
   CARD / PANEL
   ───────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 20px; margin-bottom: 12px;
  box-shadow: var(--clay); position: relative; overflow: hidden;
}
/* top-highlight handled by inset shadow inside --clay / --clay-sm / --clay-xs */

.panel-head {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 16px;
  flex-wrap: wrap; gap: 8px;
}
.panel-head h3 { font-size: var(--text-lg); font-weight: 700; letter-spacing: -.01em; }
.panel-head h3 em { font-style: normal; color: var(--accent); }
.panel-head .meta {
  font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); font-weight: 700;
}

/* ─────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────── */
.btn {
  font-size: var(--text-sm); font-weight: 700;
  padding: 10px 18px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; min-height: 42px; white-space: nowrap;
  transition: all var(--ease); cursor: pointer; border: none;
  font-family: 'Space Grotesk', sans-serif;
}
.btn:active { transform: scale(.95); }

.btn-accent  { background: var(--accent);  color: #fff; box-shadow: var(--clay-accent); }
.btn-accent:hover { background: var(--accent-2); }
.btn-primary { background: var(--text);    color: var(--bg); box-shadow: var(--clay-sm); }
.btn-ghost   { background: var(--surface-2); color: var(--text-2); box-shadow: var(--clay-xs); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-outline { background: var(--surface-2); color: var(--text); box-shadow: var(--clay-xs); }
.btn-outline:hover { background: var(--surface-3); }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: var(--text-xs); }

/* ─────────────────────────────────────────────
   FORM INPUTS
   ───────────────────────────────────────────── */
input, select, textarea {
  background: var(--surface-2); color: var(--text); border: none;
  border-radius: var(--r); padding: 11px 14px;
  font-size: var(--text-sm); font-weight: 500;
  outline: none; min-height: 42px; width: 100%;
  box-shadow: inset 0 2px 6px var(--inset), inset 0 1px 3px var(--inset-2);
  transition: box-shadow var(--ease);
  font-family: 'Space Grotesk', sans-serif;
}
input:focus, select:focus, textarea:focus {
  box-shadow: inset 0 2px 6px var(--inset), 0 0 0 2.5px var(--accent-soft);
}
select {
  cursor: pointer; -webkit-appearance: none; appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
textarea { min-height: auto; height: auto; resize: vertical; }

/* ─────────────────────────────────────────────
   SKELETON LOADER
   ───────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: ep-shimmer 1.5s infinite linear;
  border-radius: var(--r-sm);
}
@keyframes ep-shimmer { to { background-position: -200% 0; } }

/* ─────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────── */
.empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty .glyph { font-size: 40px; color: var(--surface-4); margin-bottom: 12px; }
.empty .ttl   { font-size: var(--text-base); color: var(--text); font-weight: 700; margin-bottom: 6px; }
.empty p      { font-size: var(--text-sm); }

/* ─────────────────────────────────────────────
   STATUS BADGES
   ───────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 9px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 9px; border-radius: var(--r-full);
}
.badge-green  { background: var(--green-soft);   color: var(--green); }
.badge-blue   { background: var(--blue-soft);    color: var(--blue); }
.badge-gold   { background: var(--gold-soft);    color: var(--gold); }
.badge-red    { background: var(--danger-light); color: var(--danger); }
.badge-muted  { background: var(--surface-3);    color: var(--muted); }

/* ─────────────────────────────────────────────
   BOTTOM NAVIGATION (shared across ALL pages)
   ───────────────────────────────────────────── */
.bnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px 20px calc(10px + var(--safe-bottom));
  pointer-events: none;
}

.nav-pill {
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border-radius: var(--r-2xl);
  box-shadow: var(--clay-nav);
  display: flex; align-items: center;
  height: 66px; padding: 0 8px;
  pointer-events: auto; flex: 1; max-width: 380px;
  position: relative; overflow: visible;
}
html.light .nav-pill { background: rgba(250,250,248,.97); }
html.dark  .nav-pill { background: rgba(22,22,27,.95); }

.nav-pill::before {
  content: ''; position: absolute;
  top: 0; left: 20px; right: 20px; height: 1px; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--highlight), transparent);
  pointer-events: none;
}

/* Standard nav item — icon only, no label */
.ni {
  display: flex; align-items: center; justify-content: center;
  flex: 1; height: 50px;
  border-radius: var(--r-lg); color: var(--muted);
  transition: all var(--ease); cursor: pointer; user-select: none;
  position: relative; -webkit-tap-highlight-color: transparent;
}
.ni i { font-size: 22px; transition: transform var(--ease), color var(--ease); }
.ni.active { color: var(--accent); }
.ni.active i { transform: translateY(-1px); }
.ni.active::after {
  content: ''; position: absolute; bottom: 5px;
  width: 4px; height: 4px; background: var(--accent);
  border-radius: 50%; box-shadow: 0 0 5px var(--accent);
}
.ni:active { background: var(--surface-2); }

/* Centre create button */
.ni.nc {
  width: 48px; height: 48px; flex: none;
  border-radius: 50%; margin: 0 4px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 4px 18px rgba(255,92,40,.45), 0 1px 4px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.2);
  position: relative; overflow: hidden;
}
.ni.nc::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.2) 0%, transparent 60%);
  border-radius: 50%; pointer-events: none;
}
.ni.nc i { font-size: 20px; position: relative; }
.ni.nc:active { transform: scale(.88); box-shadow: 0 2px 8px rgba(255,92,40,.4); }
.ni.nc::after { display: none; } /* no dot indicator on create */

/* ─────────────────────────────────────────────
   MENU OVERLAY (shared across ALL pages)
   ───────────────────────────────────────────── */
.menu-ov {
  position: fixed; inset: 0; z-index: 500;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.menu-ov.open { opacity: 1; visibility: visible; }

.menu-bd {
  position: absolute; inset: 0;
  background: rgba(8,8,10,.88);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
html.light .menu-bd { background: rgba(80,70,60,.5); }

.menu-sheet {
  position: relative; margin-top: auto;
  width: 100%; /* Force it to take full width up to max-width */
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: var(--clay-lg); max-height: 91vh;
  display: flex; flex-direction: column;
  transform: translateY(28px);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.menu-ov.open .menu-sheet { transform: translateY(0); }
.menu-sheet::before {
  content: ''; position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--highlight), transparent);
}

.m-handle {
  width: 34px; height: 4px; background: var(--surface-3);
  border-radius: 99px; margin: 13px auto 0; flex-shrink: 0;
}
.m-top {
  display: flex; align-items: center;
  justify-content: space-between; padding: 14px 22px; flex-shrink: 0;
}
.m-logo { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.m-logo span { color: var(--accent); }
.m-close {
  width: 34px; height: 34px; border-radius: var(--r-full);
  background: var(--surface-2); box-shadow: var(--clay-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 14px; cursor: pointer;
  transition: all var(--ease);
}
.m-close:active { transform: scale(.9); }

.m-body {
  overflow-y: auto; flex: 1;
  padding: 0 14px calc(24px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}
.m-body::-webkit-scrollbar { display: none; }

.m-sec {
  font-size: 10px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); font-weight: 800; padding: 14px 6px 7px;
}
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 7px; }
.m-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 12px; background: var(--surface-2);
  border-radius: var(--r-lg); color: var(--text-2);
  font-size: var(--text-sm); font-weight: 600;
  box-shadow: var(--clay-xs); cursor: pointer;
  text-decoration: none; transition: all var(--ease);
}
.m-item i { width: 16px; text-align: center; font-size: 14px; flex-shrink: 0; }
.m-item:active { transform: scale(.95); background: var(--surface-3); color: var(--text); }

.m-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 7px; }
.m-wide {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface-2);
  border-radius: var(--r-lg); color: var(--text-2);
  font-size: var(--text-sm); font-weight: 600;
  box-shadow: var(--clay-xs); cursor: pointer;
  text-decoration: none; transition: all var(--ease);
}
.m-wide:active { background: var(--surface-3); color: var(--text); }
.m-ic {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-2);
}
.m-divider {
  height: 1px; margin: 10px 0;
  background: linear-gradient(90deg, transparent, rgba(128,128,128,.12), transparent);
}

/* ─────────────────────────────────────────────
   MODALS (bottom-sheet style on mobile)
   ───────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(8,8,10,.82); z-index: 600;
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
html.light .modal-bg { background: rgba(60,50,40,.55); }
.modal-bg.show { display: flex; }

.modal {
  background: var(--surface); width: 100%; max-width: 600px;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: 28px 22px calc(28px + var(--safe-bottom));
  box-shadow: var(--clay-lg);
  animation: ep-slideup .28s cubic-bezier(.4,0,.2,1);
  max-height: 91vh; overflow-y: auto; position: relative;
}
.modal::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--highlight), transparent);
}
@keyframes ep-slideup {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.m-handle2 {
  width: 34px; height: 4px; background: var(--surface-3);
  border-radius: 99px; margin: -12px auto 18px;
}
.modal h2 { font-size: var(--text-2xl); font-weight: 800; margin-bottom: 7px; letter-spacing: -.02em; }
.modal h2 em { font-style: normal; color: var(--accent); }
.modal > p { color: var(--text-2); margin-bottom: 18px; font-size: var(--text-sm); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding-top: 18px; flex-wrap: wrap;
  border-top: 1px solid rgba(128,128,128,.08);
}
.code-block {
  background: var(--surface-2); padding: 18px;
  border-radius: var(--r-lg); font-family: ui-monospace, monospace;
  font-size: var(--text-xs); line-height: 1.7;
  overflow-x: auto; margin-bottom: 18px; position: relative;
  box-shadow: inset 0 2px 8px var(--inset);
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: var(--surface-3); color: var(--text);
  padding: 6px 13px; border-radius: var(--r-full);
  font-size: var(--text-xs); font-weight: 700;
  box-shadow: var(--clay-xs); transition: all var(--ease); cursor: pointer;
}
.copy-btn:hover { background: var(--text); color: var(--bg); }

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (min-width: 768px) {
  .content { padding: 20px 24px; }
  .m-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
  .m-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
}
@media (min-width: 1024px) {
  .modal { border-radius: var(--r-2xl); }
  .modal-bg { align-items: center; }
  .menu-sheet { max-width: 820px; margin: auto; border-radius: var(--r-2xl); max-height: 85vh; }
  .menu-ov .menu-sheet { transform: scale(.96); }
  .menu-ov.open .menu-sheet { transform: scale(1); }
  .m-top { padding: 20px 32px; }
  .m-body { padding: 0 32px 40px; }
  .m-sec { font-size: 11px; padding: 24px 6px 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL POLISH & LEGACY OVERRIDE LAYER
   ───────────────────────────────────────────────────────────────
   Many organiser pages still carry an older page-level <style> block
   (flat shadows, 1px borders, a duplicate sidebar/header, an old
   bottom-nav). Those rules load AFTER this file, so to re-assert the
   claymorphism system we win on SPECIFICITY instead of source order:
   `html body .x` (0,1,2) beats a page's bare `.x` (0,1,0).

   This single block brings every legacy page up to the new design
   without per-page surgery. Page-unique layout is untouched.
   ═══════════════════════════════════════════════════════════════ */

/* 1 ── Neutralise leftover OLD chrome from the half-migrated pages.
   The NEW header is the first <header class="top"> child of <body>;
   the old duplicate lives inside .content/.page/main-wrapper or has
   id="topNav". Old desktop sidebar + old bottom-nav are removed too. */
html body header#topNav,
html body .content header.top,
html body .page > header.top,
html body main-wrapper > header.top,
html body aside.sb,
html body .sb-overlay,
html body .bottom-nav,
html body .mobile-menu-toggle { display: none !important; }

/* Old pages wrapped content in .page / <main> / a nested .content (its own
   max-width + padding). Inside our .content wrapper that double-pads — flatten
   those leftover wrappers so spacing matches the rest of the app. */
html body .content .page,
html body .content main-wrapper,
html body .content > main,
html body .content .content { padding: 0 !important; max-width: none !important; margin: 0 !important; width: 100% !important; }

/* Old full-height flex wrapper shouldn't force its own min-height inside our
   normal document flow (canvas tools like floorplan opt out via their own id). */
html body .content .app { min-height: 0 !important; height: auto !important; }

/* 2 ── Buttons: claymorphism, no borders. */
html body .btn {
  font-family: 'Space Grotesk', sans-serif;
  border: none; border-radius: var(--r-full);
  font-weight: 700; transition: all var(--ease);
}
html body .btn-accent  { background: var(--accent); color: #fff; box-shadow: var(--clay-accent); }
html body .btn-accent:hover { background: var(--accent-2); }
html body .btn-primary { background: var(--text); color: var(--bg); box-shadow: var(--clay-sm); }
html body .btn-ghost   { background: var(--surface-2); color: var(--text-2); box-shadow: var(--clay-xs); }
html body .btn-ghost:hover { background: var(--surface-3); color: var(--text); }
html body .btn-outline { background: var(--surface-2); color: var(--text); box-shadow: var(--clay-xs); }
html body .btn-outline:hover { background: var(--surface-3); }
html body .btn-danger  { background: var(--danger-light); color: var(--danger); box-shadow: var(--clay-xs); }
html body .btn-danger:hover { background: var(--danger); color: #fff; }

/* 3 ── Cards / panels / stats: clay shadow, no border, surface bg. */
html body .panel,
html body .stat,
html body .card,
html body .balance-card { border: none !important; }
html body .panel { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--clay); }
html body .panel:hover { box-shadow: var(--clay-lg); }
html body .stat  { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--clay-sm); }
html body .stat:hover { box-shadow: var(--clay); }
html body .card  { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--clay-sm); }

/* Headings/dividers inside legacy panels lose their underline borders. */
html body .panel h3,
html body .panel-h,
html body .panel-head { border-bottom: none !important; }

/* 4 ── Modals: clay depth, no border. */
html body .modal { border: none !important; box-shadow: var(--clay-lg); }
html body .modal-foot { border-top: 1px solid rgba(128,128,128,.10); }

/* 5 ── List rows: keep a hairline divider (reads as a divider, not a
   card border) but make it the soft gradient-style separator. */
html body .row { border-bottom: none !important; position: relative; }
html body .row + .row::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(128,128,128,.12), transparent);
}

/* 6 ── Header avatar: support a real profile photo, not just initials. */
html body .avatar-hdr { overflow: hidden; }
html body .avatar-hdr img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-full); }

/* 7 ── "Upgrade to Pro" entry injected into every page's menu by config.js. */
.m-pro {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; margin: 4px 0 8px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; font-size: var(--text-sm); font-weight: 700;
  box-shadow: var(--clay-accent); text-decoration: none;
  transition: transform var(--ease);
}
.m-pro:active { transform: scale(.97); }
.m-pro .m-ic { background: rgba(255,255,255,.22); color: #fff; flex-shrink: 0; }
.m-pro .m-pro-txt small { display: block; font-weight: 500; opacity: .92; font-size: 11px; line-height: 1.3; }
.m-pro .m-pro-arrow { margin-left: auto; opacity: .85; }

/* 8 ── Generic toast used by legacy pages (kept consistent + clay). */
html body .toast { box-shadow: var(--clay-lg); border: none; }
