/* ═══════════════════════════════════════════════════════
   FAITH & GROWTH — SHARED STYLES
   Dark luxury theme with slate + gold accents
═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg:         #0D0F14;
  --bg2:        #111318;
  --surface:    #161920;
  --surface2:   #1C2029;
  --surface3:   #222632;
  --gold:       #C9952A;
  --gold-lt:    #E5AE3A;
  --gold-dim:   rgba(201,149,42,0.12);
  --gold-dim2:  rgba(201,149,42,0.06);
  --slate:      #8FA3C0;
  --slate-lt:   #B4C5D8;
  --blue-acc:   #4A90E2;
  --green:      #3DB87A;
  --red:        #E05252;
  --amber:      #F5A623;
  --text:       #E8ECF2;
  --text-mid:   #9DAABB;
  --text-dim:   #5A6A7E;
  --border:     rgba(255,255,255,0.07);
  --border-md:  rgba(255,255,255,0.12);
  --border-gold:rgba(201,149,42,0.25);
  --sh-sm:      0 1px 4px rgba(0,0,0,0.4);
  --sh-md:      0 4px 20px rgba(0,0,0,0.5);
  --sh-lg:      0 12px 48px rgba(0,0,0,0.6);
  --radius:     10px;
  --radius-lg:  16px;
  --sidebar-w:  260px;
  --topbar-h:   60px;

  /* ROLE COLORS */
  --role-owner:   #C9952A;
  --role-manager: #4A90E2;
  --role-staff:   #3DB87A;
  --role-trainee: #9B6EF5;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── TYPOGRAPHY ── */
h1,h2,h3 { font-family: 'Libre Baskerville', serif; }

/* ── UTILITY ── */
.hide { display: none !important; }
.muted { color: var(--text-dim); }
.text-sm { font-size: .8rem; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* ── SHELL ── */
#shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── TOPBAR ── */
#topbar {
  grid-column: 1/-1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem 0 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  backdrop-filter: blur(10px);
}

.brand-block {
  display: flex;
  align-items: center;
  width: var(--sidebar-w);
  height: 100%;
  padding: 0 1.4rem;
  border-right: 1px solid var(--border);
  text-decoration: none;
  gap: .7rem;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #8B6010);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-text .name {
  font-family: 'Libre Baskerville', serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.brand-text .sub {
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.topbar-btn {
  position: relative;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface2);
  transition: all .15s;
  color: var(--text-mid);
}
.topbar-btn:hover { background: var(--surface3); color: var(--text); border-color: var(--border-md); }
.topbar-btn .dot {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--red); border-radius: 50%;
  border: 2px solid var(--surface);
  display: none;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .75rem .3rem .4rem;
  border: 1px solid var(--border-md);
  border-radius: 8px;
  background: var(--surface2);
  cursor: pointer;
  transition: all .15s;
}
.user-pill:hover { background: var(--surface3); }

.user-pill-av {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--gold-dim);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-pill-av img { width: 100%; height: 100%; object-fit: cover; }

.user-pill-info { display: flex; flex-direction: column; gap: 1px; }
.user-pill-name { font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1; }
.user-pill-role { font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1; }

/* ── SIDEBAR ── */
#sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-head {
  padding: 1.1rem 1.1rem .9rem;
  border-bottom: 1px solid var(--border);
}

.side-av-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .7rem;
}

.side-av {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gold-dim);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-gold);
}
.side-av img { width: 100%; height: 100%; object-fit: cover; }
.side-info-name { font-weight: 700; font-size: .92rem; line-height: 1.1; color: var(--text); }
.side-info-job { font-size: .75rem; color: var(--text-dim); margin-top: 2px; }

.side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .6rem;
}
.side-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .6rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-stat-label { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.side-stat-val { font-family: 'Libre Baskerville', serif; font-size: 1.1rem; font-weight: 700; color: var(--gold); line-height: 1; }

.nav-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: .9rem 1.1rem .3rem;
}

.navlist { padding: .3rem .6rem .5rem; }

.navitem {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .62rem .75rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-mid);
  font-size: .84rem;
  font-weight: 500;
  user-select: none;
  transition: all .12s;
  position: relative;
  margin-bottom: 2px;
}
.navitem svg { width: 16px; height: 16px; opacity: .7; flex-shrink: 0; }
.navitem .ni-badge {
  margin-left: auto;
  font-size: .68rem;
  font-weight: 700;
  background: rgba(224,82,82,0.2);
  color: var(--red);
  padding: .08rem .45rem;
  border-radius: 99px;
}
.navitem .ni-dot {
  margin-left: auto;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  display: none;
}
.navitem:hover { background: var(--surface2); color: var(--text); }
.navitem:hover svg { opacity: 1; }
.navitem.active {
  background: var(--gold-dim);
  color: var(--gold-lt);
  border: 1px solid var(--border-gold);
}
.navitem.active svg { opacity: 1; }

.side-footer {
  margin-top: auto;
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-footer-ver { font-size: .68rem; color: var(--text-dim); }

/* ── MAIN ── */
#main {
  grid-column: 2;
  grid-row: 2;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
}

.page-section { display: none; flex-direction: column; flex: 1; }
.page-section.active { display: flex; }

.page-header {
  padding: 1.5rem 2rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
  line-height: 1.1;
}
.page-header .ph-sub {
  font-size: .8rem;
  color: var(--text-dim);
  margin-top: .2rem;
  font-style: italic;
  font-family: 'Libre Baskerville', serif;
}

.page-body { padding: 1.75rem 2rem 3rem; flex: 1; }

/* ── GRID ── */
.g { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.2rem; }
.g-12 { grid-column: span 12; }
.g-8  { grid-column: span 8; }
.g-7  { grid-column: span 7; }
.g-6  { grid-column: span 6; }
.g-5  { grid-column: span 5; }
.g-4  { grid-column: span 4; }
.g-3  { grid-column: span 3; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.card-title {
  font-family: 'Libre Baskerville', serif;
  font-size: .97rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.card-title svg { width: 15px; height: 15px; color: var(--gold); opacity: .85; flex-shrink: 0; }
.card-sub { font-size: .8rem; color: var(--text-dim); line-height: 1.6; margin-top: -.3rem; margin-bottom: .9rem; }

/* ── KPI ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.kpi {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.3rem;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.kpi-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .4rem;
}
.kpi-label svg { width: 12px; height: 12px; color: var(--gold); }
.kpi-val {
  font-family: 'Libre Baskerville', serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.kpi-hint { font-size: .76rem; color: var(--text-dim); margin-top: .3rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: none;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: .8rem;
  padding: .6rem 1rem;
  border-radius: 8px;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  letter-spacing: .01em;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary {
  background: var(--gold);
  color: #0D0F14;
  border: 1px solid var(--gold);
}
.btn-primary:hover { background: var(--gold-lt); border-color: var(--gold-lt); box-shadow: 0 4px 16px rgba(201,149,42,0.3); }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border-md);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger { background: rgba(224,82,82,0.15); color: var(--red); border: 1px solid rgba(224,82,82,0.3); }
.btn-danger:hover { background: rgba(224,82,82,0.25); }

.btn-success { background: rgba(61,184,122,0.15); color: var(--green); border: 1px solid rgba(61,184,122,0.3); }
.btn-success:hover { background: rgba(61,184,122,0.25); }

.btn-blue { background: rgba(74,144,226,0.15); color: var(--blue-acc); border: 1px solid rgba(74,144,226,0.3); }
.btn-blue:hover { background: rgba(74,144,226,0.25); }

.btn-sm { padding: .4rem .75rem; font-size: .75rem; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-xs { padding: .28rem .55rem; font-size: .7rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── FORMS ── */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; }
.field label { font-size: .67rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .65rem .9rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-md);
  background: var(--surface2);
  font-size: .86rem;
  color: var(--text);
  outline: none;
  font-family: 'Sora', sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,149,42,0.1);
}
.field input:disabled,
.field select:disabled { opacity: .5; cursor: not-allowed; }
.field textarea { min-height: 90px; resize: vertical; }
.field select option { background: var(--surface2); }

.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 160px; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .18rem .5rem;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge svg { width: 9px; height: 9px; }

.badge-green  { background: rgba(61,184,122,0.12); color: var(--green); border: 1px solid rgba(61,184,122,0.25); }
.badge-red    { background: rgba(224,82,82,0.12); color: var(--red); border: 1px solid rgba(224,82,82,0.25); }
.badge-gold   { background: var(--gold-dim); color: var(--gold-lt); border: 1px solid var(--border-gold); }
.badge-grey   { background: rgba(90,106,126,0.15); color: var(--text-dim); border: 1px solid var(--border); }
.badge-blue   { background: rgba(74,144,226,0.12); color: var(--blue-acc); border: 1px solid rgba(74,144,226,0.25); }
.badge-purple { background: rgba(155,110,245,0.12); color: #9B6EF5; border: 1px solid rgba(155,110,245,0.25); }
.badge-amber  { background: rgba(245,166,35,0.12); color: var(--amber); border: 1px solid rgba(245,166,35,0.25); }

/* Role badges */
.role-badge {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .15rem .45rem;
  border-radius: 5px;
}
.role-owner   { background: rgba(201,149,42,0.15); color: var(--role-owner); border: 1px solid rgba(201,149,42,0.3); }
.role-manager { background: rgba(74,144,226,0.15); color: var(--role-manager); border: 1px solid rgba(74,144,226,0.3); }
.role-staff   { background: rgba(61,184,122,0.15); color: var(--role-staff); border: 1px solid rgba(61,184,122,0.3); }
.role-trainee { background: rgba(155,110,245,0.15); color: var(--role-trainee); border: 1px solid rgba(155,110,245,0.3); }

/* ── TABLES ── */
.tbl-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); }
thead th {
  text-align: left;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: .7rem .9rem;
  font-size: .84rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }
.td-sub { font-size: .74rem; color: var(--text-dim); margin-top: .1rem; }

/* ── ADMIN TABS ── */
.admin-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .75rem;
}
.atab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: .48rem .9rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: .76rem;
  transition: all .15s;
  position: relative;
}
.atab svg { width: 13px; height: 13px; }
.tab-badge {
  font-size: .62rem;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  padding: .05rem .35rem;
  border-radius: 99px;
  margin-left: .1rem;
}
.atab:hover { background: var(--surface2); color: var(--text); border-color: var(--border-md); }
.atab.active { background: var(--gold-dim); color: var(--gold-lt); border-color: var(--border-gold); }
.apanel { display: none; }
.apanel.active { display: block; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border-md);
  border-radius: 10px;
  padding: .8rem 1.1rem;
  font-size: .83rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: .55rem;
  box-shadow: var(--sh-lg);
  z-index: 9999;
  transform: translateY(8px);
  opacity: 0;
  transition: all .2s;
  max-width: 340px;
}
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { border-color: rgba(224,82,82,0.35); }
.toast.toast-error svg { color: var(--red); }
.toast svg { color: var(--green); }

/* ── MODALS ── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--sh-lg);
}
.modal h3 {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
}
.modal p { font-size: .85rem; color: var(--text-mid); margin-bottom: 1rem; line-height: 1.6; }

/* ── MESSAGING ── */
.msg-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - var(--topbar-h) - 120px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.msg-sidebar-panel { border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg2); }
.msg-sidebar-hdr {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.msg-sidebar-hdr h3 { font-size: .85rem; font-weight: 700; color: var(--text); }
.msg-search { padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.msg-search input {
  width: 100%;
  padding: .45rem .7rem;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: .8rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  font-family: 'Sora', sans-serif;
}
.msg-search input:focus { border-color: var(--gold); }
.msg-search input::placeholder { color: var(--text-dim); }
.msg-thread-list { flex: 1; overflow-y: auto; }
.msg-thread {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem .9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
  position: relative;
}
.msg-thread:hover { background: var(--surface2); }
.msg-thread.active { background: var(--gold-dim); border-left: 2px solid var(--gold); }
.msg-thread.unread .msg-t-name { font-weight: 700; color: var(--text); }
.msg-t-av {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--surface2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  position: relative;
}
.msg-t-av img { width: 100%; height: 100%; object-fit: cover; }
.msg-t-av .online-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 9px; height: 9px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg2);
}
.msg-t-name { font-size: .84rem; font-weight: 500; color: var(--text-mid); line-height: 1.2; }
.msg-t-preview { font-size: .74rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.msg-t-time { margin-left: auto; font-size: .7rem; color: var(--text-dim); flex-shrink: 0; text-align: right; }
.msg-unread-dot { background: var(--gold); color: #000; border-radius: 99px; width: 17px; height: 17px; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.msg-area { display: flex; flex-direction: column; }
.msg-header {
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
}
.msg-header-av {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--surface2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.msg-header-av img { width: 100%; height: 100%; object-fit: cover; }
.msg-header-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.msg-header-sub { font-size: .74rem; color: var(--text-dim); }

.msg-bubbles {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.msg-date-div { text-align: center; font-size: .69rem; color: var(--text-dim); margin: .5rem 0; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.bubble-wrap { display: flex; gap: .45rem; align-items: flex-end; max-width: 78%; }
.bubble-wrap.mine { flex-direction: row-reverse; align-self: flex-end; }
.bubble-wrap.them { align-self: flex-start; }
.bbl-av {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--surface2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.bbl-av img { width: 100%; height: 100%; object-fit: cover; }
.bbl-inner { display: flex; flex-direction: column; }
.bbl-sender { font-size: .68rem; font-weight: 700; color: var(--text-dim); margin-bottom: .18rem; }
.bubble {
  padding: .6rem .9rem;
  border-radius: 10px;
  font-size: .83rem;
  line-height: 1.55;
  word-break: break-word;
}
.bubble.them { background: var(--surface3); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.bubble.mine { background: var(--gold-dim); color: var(--text); border: 1px solid var(--border-gold); border-bottom-right-radius: 3px; }
.bbl-meta { display: flex; align-items: center; gap: .4rem; margin-top: .18rem; }
.bbl-time { font-size: .67rem; color: var(--text-dim); }
.bbl-read { font-size: .67rem; color: var(--gold); }

.msg-compose { padding: .85rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: .65rem; align-items: flex-end; }
.msg-compose textarea {
  flex: 1;
  padding: .6rem .85rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-md);
  background: var(--surface2);
  color: var(--text);
  font-size: .84rem;
  font-family: 'Sora', sans-serif;
  outline: none;
  resize: none;
  max-height: 120px;
  transition: border-color .15s;
}
.msg-compose textarea:focus { border-color: var(--gold); }
.msg-compose textarea::placeholder { color: var(--text-dim); }

.msg-no-convo {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  color: var(--text-dim);
}
.msg-no-convo-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .5rem;
}

/* ── DIRECTORY GRID ── */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.dir-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
}
.dir-card:hover { border-color: var(--border-gold); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.dir-card-banner {
  height: 60px;
  background: linear-gradient(135deg, #1C2029, #2A3040);
  position: relative;
  overflow: hidden;
}
.dir-card-banner img { width: 100%; height: 100%; object-fit: cover; }
.dir-card-av-row {
  display: flex;
  align-items: flex-end;
  padding: 0 .85rem;
  margin-top: -20px;
  margin-bottom: .5rem;
}
.dir-card-av {
  width: 40px; height: 40px;
  border-radius: 9px;
  border: 2px solid var(--surface);
  background: var(--surface2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dir-card-av img { width: 100%; height: 100%; object-fit: cover; }
.dir-card-info { padding: 0 .85rem .85rem; }
.dir-card-name { font-weight: 700; font-size: .86rem; color: var(--text); line-height: 1.2; margin-bottom: .15rem; }
.dir-card-job { font-size: .73rem; color: var(--text-dim); margin-bottom: .5rem; }

/* ── REWARDS GRID ── */
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.reward-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all .15s;
}
.reward-card:hover { border-color: var(--border-gold); box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.reward-img {
  height: 140px;
  background: var(--surface3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.reward-img img { width: 100%; height: 100%; object-fit: cover; }
.reward-img svg { color: var(--text-dim); opacity: .4; }
.reward-img-badge { position: absolute; top: .5rem; left: .5rem; }
.reward-body { padding: .9rem 1rem; flex: 1; }
.reward-title { font-weight: 700; font-size: .9rem; color: var(--text); margin-bottom: .25rem; }
.reward-desc { font-size: .78rem; color: var(--text-dim); line-height: 1.55; }
.reward-footer { padding: .75rem 1rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* ── ANNOUNCEMENT ── */
.ann-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  margin-bottom: .85rem;
  transition: border-color .15s;
}
.ann-card:hover { border-color: var(--border-md); }
.ann-card.pinned {
  border-color: var(--border-gold);
  background: var(--gold-dim2);
}
.ann-head { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .6rem; }
.ann-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ann-icon svg { width: 16px; height: 16px; color: var(--gold); }
.ann-title { font-family: 'Libre Baskerville', serif; font-weight: 700; font-size: .97rem; color: var(--text); line-height: 1.2; }
.ann-meta { font-size: .72rem; color: var(--text-dim); margin-top: .15rem; }
.ann-body { font-size: .84rem; color: var(--text-mid); line-height: 1.7; }
.ann-reactions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .85rem; }
.reaction-btn {
  display: flex;
  align-items: center;
  gap: .25rem;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .2rem .5rem;
  font-size: .8rem;
  cursor: pointer;
  transition: all .12s;
  color: var(--text-mid);
}
.reaction-btn:hover { background: var(--surface); border-color: var(--border-md); }
.reaction-btn.active { background: var(--gold-dim); border-color: var(--border-gold); color: var(--gold-lt); }
.reaction-count { font-size: .73rem; font-weight: 600; }

/* ── PROFILE PAGE ── */
.profile-banner {
  height: 160px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, #1C2A1E, #2A3040);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.profile-banner:hover .profile-banner-overlay { opacity: 1; }
.profile-av-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 0 1.5rem;
  margin-top: -42px;
  margin-bottom: .75rem;
}
.profile-av {
  width: 84px; height: 84px;
  border-radius: 14px;
  border: 3px solid var(--surface);
  background: var(--surface2);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  box-shadow: var(--sh-md);
}
.profile-av img { width: 100%; height: 100%; object-fit: cover; }
.profile-av-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.profile-av:hover .profile-av-overlay { opacity: 1; }

/* ── RECENT ACTIVITY ── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.act-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.act-icon svg { width: 13px; height: 13px; }
.act-icon.hours { background: rgba(74,144,226,0.15); color: var(--blue-acc); }
.act-icon.redeem { background: var(--gold-dim); color: var(--gold); }
.act-icon.pts { background: rgba(61,184,122,0.15); color: var(--green); }
.act-title { font-size: .83rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.act-sub { font-size: .74rem; color: var(--text-dim); margin-top: .1rem; }

/* ── LEADERBOARD ── */
.lb-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.lb-item:last-child { border-bottom: none; }
.lb-rank {
  width: 24px;
  text-align: center;
  font-family: 'Libre Baskerville', serif;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}
.lb-rank.top1 { color: var(--gold-lt); }
.lb-rank.top2 { color: #B0B8C8; }
.lb-rank.top3 { color: #C68040; }
.lb-av {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.lb-av img { width: 100%; height: 100%; object-fit: cover; }
.lb-name { font-size: .84rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pts { font-family: 'Libre Baskerville', serif; font-size: .9rem; font-weight: 700; color: var(--gold); flex-shrink: 0; }

/* ── AUTH VIEWS ── */
#view-auth, #view-reset, #view-pending {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--sh-lg);
  position: relative;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #7A5800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: .75rem;
}
.auth-logo h2 {
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -.02em;
}
.auth-logo p { font-size: .8rem; color: var(--text-dim); margin-top: .25rem; font-family: 'Sora', sans-serif; }

/* ── UCARD (user pick) ── */
.ucard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: .4rem;
  background: var(--surface2);
  transition: border-color .12s;
}
.ucard:hover { border-color: var(--border-md); }

/* ── CATEGORY STATS ── */
.cat-bar { margin-bottom: .75rem; }
.cat-bar-label { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: .25rem; color: var(--text-mid); }
.cat-bar-track { height: 6px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.cat-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-lt)); border-radius: 99px; transition: width .4s; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  #shell { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  #sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .g-5,.g-7,.g-8 { grid-column: span 12; }
}
