/* ============================================================
   UMKC VSA portal — "Lacquer & Gold" design system
   Deep ink-navy lacquer surfaces · warm gold accents · red actions
   Playfair Display display type · diamond-lattice motif
   Light: warm cream. Dark: rich ink. html.dark-mode ('vsa-theme')
   ============================================================ */
:root {
  --bg: #f6f2e9;
  --surface: #ffffff;
  --surface-2: #fbf8f1;
  --text: #1d2733;
  --muted: #6a7482;
  --navy: #14304a;
  --deep: #0a1a2b;
  --red: #c8202f;
  --red-deep: #a31824;
  --gold: #c99b3f;
  --gold-bright: #e0b45c;
  --line: #e7e0d0;
  --ok: #2f9e63;
  --warn: #e8a33d;
  --shadow-sm: 0 1px 2px rgba(10, 26, 43, .06), 0 4px 14px rgba(10, 26, 43, .05);
  --shadow-lg: 0 4px 10px rgba(10, 26, 43, .08), 0 18px 44px rgba(10, 26, 43, .12);
  --sidebar-width: 264px;
  --header-h: 72px;
  --serif: 'Playfair Display', serif;
  --sans: 'Source Sans 3', system-ui, sans-serif;
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 1L43 22L22 43L1 22Z' fill='none' stroke='%23c99b3f' stroke-opacity='.16'/%3E%3C/svg%3E");
}
html.dark-mode {
  --bg: #0a1420;
  --surface: #121f2e;
  --surface-2: #16273a;
  --text: #e4edf6;
  --muted: #92a4b7;
  --line: #24364a;
  --gold: #d9ac52;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, .35), 0 18px 44px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); color: var(--text); letter-spacing: .01em; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
::selection { background: rgba(201, 155, 63, .35); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: linear-gradient(140deg, #d42a3a, var(--red-deep));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(200, 32, 47, .28);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(200, 32, 47, .38); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: linear-gradient(140deg, #1d4265, var(--navy));
  box-shadow: 0 2px 8px rgba(20, 48, 74, .3);
}
.btn.secondary:hover { box-shadow: 0 4px 14px rgba(20, 48, 74, .4); }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { color: var(--text); border-color: var(--gold); box-shadow: none; }
.btn.sm { padding: 5px 12px; font-size: .8rem; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(224, 180, 92, .16), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(200, 32, 47, .22), transparent 36%),
    radial-gradient(circle at 50% 95%, rgba(184, 216, 248, .12), transparent 40%),
    linear-gradient(150deg, #061525 0%, #102a43 52%, #24101c 100%);
  position: relative;
}
.auth-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--lattice);
  opacity: .5;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.auth-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card .brand img {
  width: 46px; height: 46px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(224, 180, 92, .35);
}
.auth-card .brand span { font-family: var(--serif); font-weight: 700; font-size: 21px; }
.auth-card h1 { font-size: 1.65rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: .92rem; margin-bottom: 24px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--muted); }
.auth-alt a { color: var(--red); font-weight: 600; }
.auth-alt a:hover { color: var(--gold); }

/* ---------- form fields ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .95rem;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 155, 63, .22);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.auth-card .btn { width: 100%; margin-top: 8px; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-list label {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 11px;
  font-size: .85rem;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s;
}
.check-list label:hover { border-color: var(--gold); }

.notice { border-radius: 10px; padding: 11px 14px; font-size: .9rem; margin-bottom: 16px; display: none; }
.notice.error { display: block; background: rgba(200, 32, 47, .1); color: var(--red); border: 1px solid rgba(200, 32, 47, .35); }
.notice.ok { display: block; background: rgba(47, 158, 99, .12); color: #1d7a40; border: 1px solid rgba(47, 158, 99, .3); }
html.dark-mode .notice.ok { color: #7fd6a1; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(178deg, #0e2338 0%, #081524 100%);
  color: #d8e4f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width .32s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- collapse toggle (rides the content side of the edge) ---------- */
.side-toggle {
  position: fixed;
  top: 50%; left: var(--sidebar-width);
  transform: translateY(-50%);
  width: 20px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid rgba(201, 155, 63, .55);
  border-left: none;
  border-radius: 0 9px 9px 0;
  color: var(--gold);
  cursor: pointer;
  padding: 0;
  z-index: 45;
  box-shadow: var(--shadow-sm);
  transition: background .2s, width .2s, left .32s cubic-bezier(.4, 0, .2, 1);
}
.side-toggle:hover { background: var(--surface-2); width: 25px; color: var(--gold-bright); }
.shell.side-collapsed ~ .side-toggle,
.shell.side-collapsed .side-toggle { left: 76px; }
.side-toggle svg { width: 14px; height: 14px; transition: transform .32s cubic-bezier(.4, 0, .2, 1); }
.shell.side-collapsed .side-toggle svg { transform: rotate(180deg); }

/* collapsed: slim icon rail — everything flows, nothing teleports */
.shell.side-collapsed .sidebar { width: 76px; }
.shell.side-collapsed .brand-name,
.shell.side-collapsed .nav-lb {
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity .14s ease, transform .18s ease; /* out fast, no delay */
  pointer-events: none;
}
.shell.side-collapsed .sidebar .nav-label,
.shell.side-collapsed .sidebar .foot { opacity: 0; }
.shell.side-collapsed .sidebar .brand { padding: 0 0 0 17px; }
.shell.side-collapsed .sidebar nav { padding: 16px 8px; }
.shell.side-collapsed .sidebar nav a { padding: 10px 0 10px 18px; }
.sidebar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 240px;
  background-image: var(--lattice);
  opacity: .55;
  mask-image: linear-gradient(to top, black, transparent);
  pointer-events: none;
}
/* solid gold hairline along the sidebar's edge */
.sidebar::before {
  content: "";
  position: absolute; top: 0; bottom: 0; right: 0;
  width: 2px;
  background: var(--gold);
  opacity: .5;
  z-index: 2;
  pointer-events: none;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
  padding: 0 20px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(224, 180, 92, .22);
  transition: padding .32s cubic-bezier(.4, 0, .2, 1);
}
.sidebar .brand img {
  width: 42px; height: 42px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold-bright), 0 0 16px rgba(224, 180, 92, .3);
}
.sidebar .brand span { font-family: var(--serif); font-weight: 700; font-size: 18px; color: #fff; letter-spacing: .02em; }
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 16px 12px;
  position: relative;
  z-index: 1;
  transition: padding .32s cubic-bezier(.4, 0, .2, 1);
}
.sidebar nav::-webkit-scrollbar { display: none; }
.sidebar .nav-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold-bright);
  opacity: .75;
  padding: 16px 12px 7px;
  white-space: nowrap;
  transition: opacity .2s ease;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: .93rem;
  color: #c9d8e8;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s,
              padding .32s cubic-bezier(.4, 0, .2, 1);
}
.nav-lb {
  display: inline-block;
  opacity: 1;
  transform: translateX(0);
  transition: opacity .22s ease .14s, transform .3s cubic-bezier(.2, .7, .3, 1) .14s;
}
.brand-name {
  display: inline-block;
  opacity: 1;
  transform: translateX(0);
  transition: opacity .22s ease .14s, transform .3s cubic-bezier(.2, .7, .3, 1) .14s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(200, 32, 47, .28), rgba(200, 32, 47, .08));
  border-left-color: var(--gold-bright);
  color: #fff;
  font-weight: 600;
  animation: activePulse 3.6s ease-in-out infinite;
}
@keyframes activePulse {
  0%, 100% { box-shadow: inset 4px 0 10px -5px rgba(224, 180, 92, .55); }
  50%      { box-shadow: inset 5px 0 14px -4px rgba(224, 180, 92, .95); }
}
.sidebar nav a.disabled { opacity: .4; pointer-events: none; }

/* officer tools read red until you're on them */
.sidebar nav a.officer-link { color: #e2606d; }
.sidebar nav a.officer-link:hover { color: #f2919b; background: rgba(200, 32, 47, .14); }
.sidebar nav a.officer-link.active { color: #fff; }
.sidebar .foot {
  position: relative; z-index: 1;
  padding: 16px 20px;
  border-top: 1px solid rgba(224, 180, 92, .18);
  font-size: .78rem;
  color: rgba(216, 228, 240, .55);
  line-height: 1.5;
  white-space: nowrap;
  transition: opacity .2s ease;
}

/* ---------- topbar + content ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--header-h);
  padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: var(--surface); }
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg,
    var(--gold-bright) 0%, var(--red) 28%, #ffe9bd 50%, var(--red) 72%, var(--gold-bright) 100%);
  background-size: 200% 100%;
  animation: flowBar 7s linear infinite;
  box-shadow: 0 0 8px rgba(224, 180, 92, .45);
  pointer-events: none;
}
@keyframes flowBar {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}
.topbar .page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.28rem;
  position: relative;
  padding-left: 14px;
}
.topbar .page-title::before {
  content: "";
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-bright), var(--red));
}
.topbar .actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  transition: border-color .15s;
}
.theme-toggle:hover { border-color: var(--gold); }
.userchip { display: flex; align-items: center; gap: 10px; }
.userchip img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px var(--gold);
}
.userchip .name { font-size: .9rem; font-weight: 600; }
.content { padding: 28px; flex: 1; }

/* ---------- cards / stats ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 1.22rem; margin-bottom: 16px; }
.card.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(224, 180, 92, .2), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(200, 32, 47, .25), transparent 40%),
    linear-gradient(140deg, #0e2338, #143049 60%, #2a1220);
  border: 1px solid rgba(224, 180, 92, .3);
  color: #eef4fb;
  position: relative;
  overflow: hidden;
}
.card.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--lattice);
  opacity: .5;
  mask-image: linear-gradient(115deg, transparent 42%, black);
  pointer-events: none;
}
.card.hero h2 { color: #fff; font-size: 1.7rem; }
.card.hero > * { position: relative; }
.card.hero .stat { background: rgba(255, 255, 255, .07); border-color: rgba(224, 180, 92, .25); }
.card.hero .stat .num { color: var(--gold-bright); }
.card.hero .stat .lbl { color: rgba(238, 244, 251, .75); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  position: relative;
}
.stat::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--red));
}
.stat .num { font-size: 1.85rem; font-weight: 700; font-family: var(--serif); color: var(--navy); }
html.dark-mode .stat .num { color: var(--gold); }
.stat .lbl { font-size: .8rem; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .03em;
  margin-right: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: capitalize;
}
.badge.officer { background: rgba(200, 32, 47, .12); color: var(--red); border-color: rgba(200, 32, 47, .3); }
.badge.admin { background: rgba(201, 155, 63, .15); color: #9a7325; border-color: rgba(201, 155, 63, .4); }
html.dark-mode .badge.admin { color: var(--gold-bright); }

.loading {
  padding: 70px;
  text-align: center;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .04em;
}

/* ---------- member list ---------- */
.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
.member-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--gold); }
.member-card img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--gold); }
.member-card .mname { font-weight: 600; font-size: .95rem; }
.member-card .msub { color: var(--muted); font-size: .8rem; }
.searchbar {
  width: 100%;
  max-width: 340px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .95rem;
  margin-bottom: 18px;
  transition: border-color .15s, box-shadow .15s;
}
.searchbar:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 155, 63, .22); }

/* ---------- achievements / rewards tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px;
  position: relative;
  transition: transform .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tile h3 { font-family: var(--sans); font-size: 1rem; margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: .87rem; margin-bottom: 10px; }
.tile .pts { font-weight: 700; color: var(--red); font-size: .92rem; font-family: var(--serif); }
.tile.earned { border-color: rgba(201, 155, 63, .55); background: linear-gradient(160deg, var(--surface-2), rgba(201, 155, 63, .07)); }
.tile .earned-tag {
  position: absolute;
  top: 13px; right: 13px;
  background: linear-gradient(140deg, var(--gold-bright), var(--gold));
  color: #35270a;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .03em;
}

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.cal-head h2 { font-size: 1.35rem; }
.cal-nav { display: flex; gap: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 800; color: var(--gold); padding: 7px 0; text-transform: uppercase; letter-spacing: .1em; }
.cal-cell {
  min-height: 88px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px;
  font-size: .8rem;
}
.cal-cell.out { opacity: .35; }
.cal-cell.today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.cal-cell.today .d { color: var(--red); }
.cal-cell .d { font-weight: 700; margin-bottom: 4px; font-family: var(--serif); }
.cal-ev {
  display: block;
  background: linear-gradient(90deg, var(--navy), #1d4265);
  color: #fff;
  border-left: 3px solid var(--gold-bright);
  border-radius: 6px;
  padding: 3px 7px;
  margin-bottom: 3px;
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter .15s;
}
.cal-ev:hover { filter: brightness(1.25); }
.ev-detail { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.rsvp-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rsvp-row .btn.on { outline: 3px solid rgba(201, 155, 63, .5); }

/* ---------- profile ---------- */
.avatar-lg {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(201, 155, 63, .3);
}
.profile-head { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; flex-wrap: wrap; }

/* ---------- data tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--gold);
  padding: 9px 10px;
  border-bottom: 2px solid var(--line);
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .low td { background: rgba(200, 32, 47, .07); }
.tbl .actions { white-space: nowrap; }
.qty-ctl { display: inline-flex; align-items: center; gap: 8px; }
.qty-ctl button {
  width: 27px; height: 27px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition: border-color .15s;
}
.qty-ctl button:hover { border-color: var(--gold); }
.qty-ctl .q { min-width: 34px; text-align: center; font-weight: 700; font-family: var(--serif); }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(6, 21, 37, .62);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 16px;
  padding: 26px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h2 { margin-bottom: 18px; font-size: 1.25rem; }
.modal .row-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- task board ---------- */
.board-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.board {
  position: relative;
  width: 1600px; height: 900px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  background-color: var(--surface-2);
}
.board svg.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.task-card {
  position: absolute;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 12px;
  padding: 11px 13px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  user-select: none;
  transition: box-shadow .15s;
}
.task-card:hover { box-shadow: var(--shadow-lg); }
.task-card:active { cursor: grabbing; }
.task-card.prio-high { border-left-color: var(--red); }
.task-card.prio-medium { border-left-color: var(--warn); }
.task-card.prio-low { border-left-color: var(--ok); }
.task-card h4 { font-family: var(--sans); font-size: .92rem; margin-bottom: 5px; }
.task-card .meta { font-size: .75rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.task-card .st {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: .7rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.task-card .st.in-progress { background: rgba(232, 163, 61, .15); color: #b97b18; border-color: rgba(232, 163, 61, .4); }
.task-card .st.done { background: rgba(47, 158, 99, .15); color: var(--ok); border-color: rgba(47, 158, 99, .4); }
.task-card .edit-hit { position: absolute; top: 7px; right: 9px; cursor: pointer; opacity: .5; font-size: .85rem; }
.task-card .edit-hit:hover { opacity: 1; color: var(--gold); }

/* ---------- notes ---------- */
.notes-layout { display: grid; grid-template-columns: 215px 245px 1fr; gap: 16px; min-height: 480px; }
.pane { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-y: auto; }
.pane .item {
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  font-size: .9rem;
  margin-bottom: 2px;
  display: flex; justify-content: space-between; gap: 6px; align-items: center;
  transition: background .12s;
}
.pane .item:hover { background: var(--surface); }
.pane .item.sel {
  background: linear-gradient(90deg, var(--navy), #1d4265);
  color: #fff;
  border-left: 3px solid var(--gold-bright);
}
.pane .item .del { opacity: .45; cursor: pointer; }
.pane .item .del:hover { opacity: 1; }
.note-editor { display: flex; flex-direction: column; gap: 10px; }
.note-editor input {
  font-family: var(--serif);
  font-size: 1.15rem; font-weight: 700;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.note-editor input:focus, .note-editor textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 155, 63, .22);
}
.note-editor textarea {
  flex: 1; min-height: 360px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.6;
  resize: vertical;
}
@media (max-width: 900px) { .notes-layout { grid-template-columns: 1fr; } }

/* ---------- filter bar ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar select, .filter-bar input {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .9rem;
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--gold); }

/* ---------- nav icons ---------- */
.nav-ic { width: 18px; height: 18px; flex-shrink: 0; transition: transform .18s ease; }
.sidebar nav a:hover .nav-ic { transform: translateX(2px) scale(1.1); }
.sidebar nav a.active .nav-ic { color: var(--gold-bright); filter: drop-shadow(0 0 4px rgba(224, 180, 92, .5)); }

/* ---------- motion layer (subtle sci-fi) ---------- */
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroSweep {
  to { transform: translateX(100%); }
}
@keyframes latticeDrift {
  from { background-position: 0 0; }
  to   { background-position: 88px 88px; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 8px rgba(224, 180, 92, .2); }
  50%      { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(224, 180, 92, .5); }
}
@keyframes loadPulse {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}

/* staggered card entrance */
.content .card { animation: fadeRise .45s cubic-bezier(.2, .7, .3, 1) backwards; }
.content .card:nth-of-type(2) { animation-delay: .08s; }
.content .card:nth-of-type(3) { animation-delay: .16s; }
.content .card:nth-of-type(4) { animation-delay: .24s; }
.content .card:nth-of-type(n+5) { animation-delay: .3s; }

/* hero light-sweep (plays once) + drifting lattice */
.card.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(224, 180, 92, .17) 46%, transparent 60%);
  transform: translateX(-100%);
  animation: heroSweep 1.5s .35s cubic-bezier(.4, 0, .2, 1) forwards;
  pointer-events: none;
}
.card.hero::before,
.sidebar::after,
.auth-wrap::before { animation: latticeDrift 70s linear infinite; }

/* button sheen sweep on hover */
.btn { position: relative; overflow: hidden; }
.btn:not(.ghost)::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -80%;
  width: 55%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .32), transparent);
  transform: skewX(-20deg);
  transition: left .45s ease;
  pointer-events: none;
}
.btn:not(.ghost):hover::after { left: 125%; }

/* ambient glow on gold-ringed portraits */
.userchip img, .sidebar .brand img { animation: glowPulse 5s ease-in-out infinite; }
.avatar-lg { animation: glowPulse 5s ease-in-out infinite; }

/* micro-interactions */
.theme-toggle { transition: border-color .15s, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.theme-toggle:hover { transform: rotate(24deg); }
.loading { animation: loadPulse 1.6s ease-in-out infinite; }
.tile, .member-card, .task-card { will-change: transform; }

/* accessibility: honor reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .shell.side-collapsed .sidebar { width: 100%; }
  .sidebar::after { display: none; }
  .sidebar::before { display: none; }
  .side-toggle { display: none; }
  .shell.side-collapsed .brand-name,
  .shell.side-collapsed .nav-lb,
  .shell.side-collapsed .sidebar .nav-label,
  .shell.side-collapsed .sidebar .foot { opacity: 1; transform: none; pointer-events: auto; }
  .shell.side-collapsed .sidebar .brand { padding: 0 20px; }
  .shell.side-collapsed .sidebar nav a { padding: 10px 13px; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar .nav-label { width: 100%; }
  .sidebar .foot { display: none; }
  .content { padding: 18px; }
  .topbar { padding: 0 16px; height: 60px; }
  .sidebar .brand { height: 60px; }
  .userchip .name { display: none; }
}
