/* HiveLink - Warm Prestige Design System */
/* Maroon · Naples Yellow · Gold · Dark Blue · White */
:root {
  --maroon: #7B1C2E;
  --maroon-deep: #5A1220;
  --maroon-light: #9B2D42;
  --naples: #F9D84A;
  --gold: #D4A017;
  --gold-bright: #F0C040;
  --navy: #0F2044;
  --navy-mid: #1A3560;
  --cream: #FDF8F0;
  --cream-warm: #F5EDD8;
  --cream-border: #E8D5B0;
  --white: #FFFFFF;
  --text-primary: #0F2044;
  --text-secondary: #5A4A3A;
  --text-muted: #9A8A7A;
  --success: #2D7A4F;
  --danger: #B91C1C;
  --info: #1A3560;
  --bg-base: #FDF8F0;
  --bg-surface: #F5EDD8;
  --bg-card: #FFFFFF;
  --bg-elevated: #FDF8F0;
  --warm-border: #E8D5B0;
  --glass: rgba(255,255,255,0.7);
  --glass-border: rgba(232,213,176,0.8);
  --gold-surface: rgba(212,160,23,0.10);
  --gold-glow: rgba(212,160,23,0.22);
  --maroon-surface: rgba(123,28,46,0.07);
  --maroon-glow: rgba(123,28,46,0.18);
  --accent: var(--gold);
  --accent-hover: var(--naples);
  --accent-glow: var(--gold-glow);
  --accent-surface: var(--gold-surface);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(90,18,32,0.09);
  --shadow-md: 0 4px 20px rgba(90,18,32,0.13);
  --shadow-lg: 0 8px 40px rgba(90,18,32,0.17);
  --shadow-card: 0 2px 12px rgba(15,32,68,0.07);
  --topbar-h: 68px;
  --bottomnav-h: 68px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Lora', 'Georgia', serif;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 50%, #EDE4D0 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100dvh;
}
a { color: var(--maroon); cursor: pointer; text-decoration: none; }
a:hover { color: var(--maroon-light); text-decoration: underline; }
input, textarea, select, button { font-family: 'Inter', system-ui, sans-serif; font-size: inherit; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream-warm); }
::-webkit-scrollbar-thumb { background: var(--maroon-light); border-radius: 3px; opacity: 0.5; }
::-webkit-scrollbar-thumb:hover { background: var(--maroon); }

/* ── Auth Screens ─────────────────────────────────────────────── */
.screen {
  display: none;
  position: fixed; inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.screen.active { display: flex; }

.auth-bg {
  position: fixed; inset: 0;
  background: linear-gradient(160deg,
    var(--maroon-deep) 0%,
    var(--maroon) 30%,
    #9B2D42 55%,
    #C4782A 78%,
    var(--gold) 100%);
  z-index: 0;
}
.auth-bg::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 20% 30%, rgba(249,216,74,0.12) 0%, transparent 65%),
    radial-gradient(ellipse 500px 400px at 80% 70%, rgba(90,18,32,0.25) 0%, transparent 65%);
}
.auth-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  margin: 24px 16px;
  background: rgba(253,248,240,0.97);
  border: 1px solid rgba(232,213,176,0.8);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  box-shadow: 0 20px 60px rgba(90,18,32,0.35), 0 4px 16px rgba(90,18,32,0.2);
  animation: fadeSlideUp 0.45s ease-out;
  backdrop-filter: blur(12px);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand { text-align: center; margin-bottom: 36px; }
.brand-icon {
  font-size: 52px;
  margin-bottom: 10px;
  display: block;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.brand-name {
  font-family: 'Lora', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.brand-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 5px;
  font-style: italic;
}

/* ── Form Elements ────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-family: 'Inter', system-ui, sans-serif;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  background: var(--white);
  border: 1.5px solid var(--cream-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border var(--transition), box-shadow var(--transition);
  font-family: 'Inter', system-ui, sans-serif;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.18);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A4A3A' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-error {
  background: rgba(185,28,28,0.08);
  border: 1px solid rgba(185,28,28,0.25);
  color: var(--danger);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  font-family: 'Inter', system-ui, sans-serif;
}
.char-count { font-weight: 400; color: var(--text-muted); font-size: 12px; text-transform: none; }
.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: 'Inter', system-ui, sans-serif;
}
.auth-switch a { color: var(--maroon); font-weight: 600; }
.auth-switch a:hover { color: var(--maroon-light); text-decoration: underline; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: var(--radius-md);
  font-weight: 700; font-size: 14px; border: none; cursor: pointer;
  transition: all var(--transition); width: 100%;
  font-family: 'Inter', system-ui, sans-serif; letter-spacing: 0.2px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-light) 100%);
  color: #fff; box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--maroon-light) 0%, #B03050 100%);
  box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--cream-border); color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--maroon); color: var(--maroon); background: var(--maroon-surface); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: rgba(123,28,46,0.05); }
.btn-danger { background: rgba(185,28,28,0.08); color: var(--danger); border: 1px solid rgba(185,28,28,0.2); }
.btn-danger:hover { background: rgba(185,28,28,0.15); }
.btn-sm { padding: 8px 18px; font-size: 13px; width: auto; }
.icon-btn {
  background: var(--maroon-surface); border: 1px solid var(--cream-border);
  color: var(--maroon); width: 42px; height: 42px; border-radius: var(--radius-md);
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--gold-surface); border-color: var(--gold); transform: scale(1.05); }
.add-btn {
  background: var(--gold-surface); color: var(--gold); border: 1px solid rgba(212,160,23,0.25);
  padding: 6px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); font-family: 'Inter', system-ui, sans-serif;
}
.add-btn:hover { background: rgba(212,160,23,0.18); box-shadow: var(--shadow-gold); }

/* ── Top Bar ──────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: linear-gradient(90deg, var(--maroon-deep) 0%, var(--maroon) 50%, var(--maroon-deep) 100%);
  border-bottom: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; z-index: 50;
  box-shadow: 0 4px 20px rgba(90,18,32,0.25);
}
.topbar-logo {
  font-family: 'Lora', Georgia, serif;
  font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--naples) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 0.3px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.avatar-wrap { cursor: pointer; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--naples) 100%);
  color: var(--navy); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.3); transition: box-shadow var(--transition);
}
.avatar-wrap:hover .avatar { box-shadow: 0 0 0 3px rgba(249,216,74,0.5); }

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
  position: fixed; top: var(--topbar-h); left: 0; right: 0;
  bottom: var(--bottomnav-h); overflow: hidden;
}
.tab { display: none; position: absolute; inset: 0; overflow: hidden; }
.tab.active { display: flex; flex-direction: column; animation: fadeIn 0.28s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.tab-scroll {
  flex: 1; overflow-y: auto; padding: 24px 20px 28px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
}
.tab-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px;
}
.tab-header h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 24px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px;
}

/* ── Bottom Nav ───────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottomnav-h);
  background: linear-gradient(90deg, var(--maroon-deep) 0%, var(--maroon) 50%, var(--maroon-deep) 100%);
  border-top: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 50; padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(90,18,32,0.2);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.5);
  padding: 6px 18px; border-radius: var(--radius-md); transition: all var(--transition);
  position: relative; font-family: 'Inter', system-ui, sans-serif;
}
.nav-item.active { color: var(--naples); }
.nav-item.active::before {
  content: ''; position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--naples));
  border-radius: 0 0 4px 4px;
}
.nav-item:hover { color: rgba(255,255,255,0.8); }
.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Dashboard ────────────────────────────────────────────────── */
.greeting {
  font-family: 'Lora', Georgia, serif;
  font-size: 26px; font-weight: 700; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.mood-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(123,28,46,0.08) 0%, rgba(212,160,23,0.08) 100%);
  border: 1px solid var(--cream-border); border-left: 4px solid var(--maroon);
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 22px;
  animation: fadeSlideUp 0.3s ease-out;
}
#mood-banner-emoji { font-size: 26px; }
#mood-banner-text { flex: 1; font-size: 14px; color: var(--text-secondary); font-style: italic; }
.mood-edit-btn {
  background: none; border: none; color: var(--maroon); font-weight: 700;
  font-size: 13px; cursor: pointer; font-family: 'Inter', system-ui, sans-serif;
}
.mood-edit-btn:hover { text-decoration: underline; }
.dash-section { margin-bottom: 30px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.section-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 17px; font-weight: 700; color: var(--text-primary);
}
.section-date { font-size: 13px; color: var(--text-muted); font-family: 'Inter', system-ui, sans-serif; }

/* ── Event Cards ──────────────────────────────────────────────── */
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--white); border: 1px solid var(--cream-border);
  border-radius: var(--radius-md); transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.event-card:hover {
  border-color: var(--gold); transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
.event-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.event-dot.sports { background: var(--maroon); box-shadow: 0 0 8px var(--maroon-glow); }
.event-dot.club   { background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.event-dot.class  { background: var(--navy-mid); box-shadow: 0 0 8px rgba(26,53,96,0.3); }
.event-info { flex: 1; min-width: 0; }
.event-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: 'Inter', system-ui, sans-serif; }
.event-group-tag {
  font-size: 11px; padding: 3px 10px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(123,28,46,0.08), rgba(212,160,23,0.08));
  color: var(--text-secondary); white-space: nowrap;
  border: 1px solid var(--cream-border); font-family: 'Inter', system-ui, sans-serif;
}

/* ── To-Do List ───────────────────────────────────────────────── */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  background: var(--white); border: 1px solid var(--cream-border);
  border-radius: var(--radius-md); transition: all var(--transition); box-shadow: var(--shadow-card);
}
.todo-item:hover { border-color: var(--gold-warm); }
.todo-checkbox {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--cream-border);
  background: transparent; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); font-size: 12px; color: transparent;
}
.todo-checkbox:hover { border-color: var(--maroon); }
.todo-checkbox.checked {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  border-color: var(--maroon); color: #fff;
}
.todo-text { flex: 1; font-size: 14px; color: var(--text-primary); font-family: 'Inter', system-ui, sans-serif; }
.todo-text.done { text-decoration: line-through; color: var(--text-muted); }
.todo-due { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-family: 'Inter', system-ui, sans-serif; }
.todo-delete {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 4px; opacity: 0; transition: all var(--transition);
}
.todo-item:hover .todo-delete { opacity: 1; }
.todo-delete:hover { color: var(--danger); }

/* ── Group Updates ────────────────────────────────────────────── */
.update-list { display: flex; flex-direction: column; gap: 10px; }
.update-card {
  padding: 16px 18px;
  background: linear-gradient(145deg, var(--white) 0%, rgba(245,237,216,0.5) 100%);
  border: 1px solid var(--cream-border); border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--transition); box-shadow: var(--shadow-card);
}
.update-card:hover { border-color: var(--maroon); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.update-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.update-emoji { font-size: 20px; }
.update-group-name { font-size: 14px; font-weight: 700; color: var(--text-primary); font-family: 'Lora', Georgia, serif; }
.update-preview { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Inter', system-ui, sans-serif; }
.update-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: 'Inter', system-ui, sans-serif; }

/* ── Empty States ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 36px 16px; color: var(--text-muted);
  font-size: 14px; font-family: 'Inter', system-ui, sans-serif;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-icon { font-size: 36px; }

/* ── Groups ───────────────────────────────────────────────────── */
.groups-list { display: flex; flex-direction: column; gap: 10px; }
.group-card {
  display: flex; align-items: center; gap: 16px; padding: 18px;
  background: var(--white); border: 1px solid var(--cream-border);
  border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.group-card:hover { border-color: var(--maroon); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.group-emoji {
  width: 50px; height: 50px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(123,28,46,0.08), rgba(212,160,23,0.10));
  border: 1px solid var(--cream-border);
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
.group-info { flex: 1; min-width: 0; }
.group-name { font-size: 15px; font-weight: 700; color: var(--text-primary); font-family: 'Lora', Georgia, serif; }
.group-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Inter', system-ui, sans-serif; }
.group-meta { display: flex; gap: 14px; margin-top: 5px; }
.group-meta span { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; font-family: 'Inter', system-ui, sans-serif; }
.join-btn {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  color: #fff; border: none; padding: 8px 18px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: all var(--transition);
  flex-shrink: 0; font-family: 'Inter', system-ui, sans-serif;
}
.join-btn:hover { transform: scale(1.04); box-shadow: var(--shadow-sm); }
.join-btn.joined { background: linear-gradient(135deg, #2D7A4F, #3A9A62); }

/* ── Filter Chips ─────────────────────────────────────────────── */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 7px 18px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--cream-border); background: var(--white);
  color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); font-family: 'Inter', system-ui, sans-serif;
}
.filter-chip:hover { border-color: var(--maroon); color: var(--maroon); }
.filter-chip.active {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  color: #fff; border-color: var(--maroon);
}

/* ── Panels ───────────────────────────────────────────────────── */
.panel {
  position: fixed; inset: 0; background: var(--cream); z-index: 60;
  display: flex; flex-direction: column; animation: slideIn 0.28s ease-out;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.panel.hidden { display: none; }
.panel-header {
  padding: 18px 22px;
  background: linear-gradient(90deg, var(--maroon-deep) 0%, var(--maroon) 100%);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 4px 16px rgba(90,18,32,0.2);
}
.back-btn {
  background: none; border: none; color: var(--naples); font-weight: 700; font-size: 14px;
  cursor: pointer; margin-bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  font-family: 'Inter', system-ui, sans-serif;
}
.back-btn:hover { color: var(--gold-bright); }
.panel-title { font-family: 'Lora', Georgia, serif; font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.panel-tabs { display: flex; gap: 0; }
.ptab {
  padding: 8px 18px; background: none; border: none; border-bottom: 3px solid transparent;
  color: rgba(255,255,255,0.55); font-weight: 700; font-size: 13px; cursor: pointer;
  transition: all var(--transition); font-family: 'Inter', system-ui, sans-serif;
}
.ptab:hover { color: rgba(255,255,255,0.85); }
.ptab.active { color: var(--naples); border-bottom-color: var(--gold); }
.panel-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%); }
.group-view { display: none; flex: 1; flex-direction: column; }
.group-view.active { display: flex; }

/* ── Chat ─────────────────────────────────────────────────────── */
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { max-width: 82%; animation: fadeSlideUp 0.22s ease-out; }
.chat-msg.mine { align-self: flex-end; }
.chat-msg.other { align-self: flex-start; }
.msg-bubble { padding: 11px 16px; border-radius: var(--radius-md); font-size: 14px; line-height: 1.55; }
.chat-msg.mine .msg-bubble {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-light) 100%);
  color: #fff; border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.chat-msg.other .msg-bubble {
  background: var(--white); border: 1px solid var(--cream-border);
  border-bottom-left-radius: 4px; color: var(--text-primary); box-shadow: var(--shadow-card);
}
.msg-sender { font-size: 12px; font-weight: 700; color: var(--naples); margin-bottom: 3px; font-family: 'Inter', system-ui, sans-serif; }
.chat-msg.mine .msg-sender { color: rgba(249,216,74,0.8); }
.msg-time { font-size: 10px; color: var(--text-muted); margin-top: 5px; text-align: right; font-family: 'Inter', system-ui, sans-serif; }
.chat-msg.mine .msg-time { color: rgba(255,255,255,0.5); }
.msg-reactions { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.reaction-badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px;
  border-radius: var(--radius-pill); background: rgba(245,237,216,0.8);
  border: 1px solid var(--cream-border); font-size: 12px; cursor: pointer; transition: all var(--transition);
}
.reaction-badge:hover { border-color: var(--gold); background: var(--gold-surface); }
.reaction-count { color: var(--text-secondary); font-size: 11px; font-family: 'Inter', system-ui, sans-serif; }
.msg-actions { display: flex; gap: 4px; margin-top: 5px; opacity: 0; transition: opacity var(--transition); }
.chat-msg:hover .msg-actions { opacity: 1; }
.msg-action-btn {
  background: var(--cream-warm); border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm); padding: 3px 9px; font-size: 12px;
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
  font-family: 'Inter', system-ui, sans-serif;
}
.msg-action-btn:hover { background: var(--gold-surface); color: var(--maroon); border-color: var(--gold); }
.chat-input-bar {
  display: flex; gap: 10px; padding: 14px 18px;
  background: var(--white); border-top: 1px solid var(--cream-border);
  box-shadow: 0 -2px 10px rgba(90,18,32,0.06);
}
.chat-input-bar input {
  flex: 1; padding: 11px 16px; background: var(--cream);
  border: 1.5px solid var(--cream-border); border-radius: var(--radius-pill);
  color: var(--text-primary); outline: none; transition: border var(--transition);
  font-family: 'Inter', system-ui, sans-serif;
}
.chat-input-bar input:focus { border-color: var(--gold); }
.send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  border: 2px solid var(--gold); color: #fff; font-size: 18px; cursor: pointer;
  transition: all var(--transition); display: flex; align-items: center; justify-content: center;
}
.send-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-sm); }

/* ── Members ──────────────────────────────────────────────────── */
.members-list { display: flex; flex-direction: column; gap: 8px; }
.member-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--white); border: 1px solid var(--cream-border);
  border-radius: var(--radius-md); transition: all var(--transition); box-shadow: var(--shadow-card);
}
.member-row:hover { border-color: var(--gold); }
.member-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cream-warm), var(--cream-border));
  border: 2px solid var(--cream-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: var(--text-secondary); flex-shrink: 0;
}
.member-avatar.staff {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  border-color: var(--gold); color: #fff;
}
.member-info { flex: 1; }
.member-name { font-size: 14px; font-weight: 700; color: var(--text-primary); font-family: 'Lora', Georgia, serif; }
.member-role { font-size: 12px; color: var(--text-muted); font-family: 'Inter', system-ui, sans-serif; }
.member-dm-btn {
  background: var(--maroon-surface); border: 1px solid var(--cream-border);
  border-radius: var(--radius-sm); padding: 7px 14px; color: var(--maroon);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all var(--transition);
  font-family: 'Inter', system-ui, sans-serif;
}
.member-dm-btn:hover { background: var(--maroon); color: #fff; border-color: var(--maroon); }

/* ── Planner ──────────────────────────────────────────────────── */
.view-toggle {
  display: flex; background: var(--cream-warm); border-radius: var(--radius-sm);
  overflow: hidden; border: 1.5px solid var(--cream-border);
}
.view-btn {
  padding: 7px 18px; background: none; border: none; color: var(--text-muted);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: all var(--transition);
  font-family: 'Inter', system-ui, sans-serif;
}
.view-btn.active { background: linear-gradient(135deg, var(--maroon), var(--maroon-light)); color: #fff; }
.view-btn:hover:not(.active) { color: var(--text-primary); }
.planner-nav {
  display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 18px;
}
.nav-arrow {
  background: var(--white); border: 1.5px solid var(--cream-border); border-radius: var(--radius-sm);
  width: 34px; height: 34px; color: var(--text-primary); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.nav-arrow:hover { background: var(--maroon); color: #fff; border-color: var(--maroon); }
#planner-range-label {
  font-size: 15px; font-weight: 700; min-width: 150px; text-align: center;
  color: var(--text-primary); font-family: 'Lora', Georgia, serif;
}
.planner-view { display: flex; flex-direction: column; gap: 8px; }
.planner-day-header {
  font-size: 12px; font-weight: 800; color: var(--maroon); text-transform: uppercase;
  letter-spacing: 0.8px; margin-top: 10px; padding-bottom: 5px;
  border-bottom: 2px solid var(--cream-border); font-family: 'Inter', system-ui, sans-serif;
}
.planner-empty {
  text-align: center; padding: 44px 16px; color: var(--text-muted); font-size: 14px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── Profile ──────────────────────────────────────────────────── */
.profile-header {
  display: flex; align-items: center; gap: 22px; margin-bottom: 28px; padding: 28px;
  background: linear-gradient(135deg, var(--maroon-deep) 0%, var(--maroon) 60%, #9B2D42 100%);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.profile-avatar-wrap { position: relative; }
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--naples));
  color: var(--navy); font-weight: 900; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.15), 0 0 0 7px rgba(212,160,23,0.3);
}
.avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--gold); border: 2px solid #fff;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.avatar-edit-btn:hover { background: var(--naples); transform: scale(1.1); }
.profile-info { flex: 1; }
.profile-name { font-family: 'Lora', Georgia, serif; font-size: 22px; font-weight: 700; color: #fff; }
.profile-email { font-size: 13px; color: rgba(255,255,255,0.65); margin-top: 3px; font-family: 'Inter', system-ui, sans-serif; }
.profile-role-badge {
  display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  font-family: 'Inter', system-ui, sans-serif;
}
.profile-role-badge.student { background: rgba(26,53,96,0.5); color: #93C5FD; border: 1px solid rgba(147,197,253,0.3); }
.profile-role-badge.staff { background: rgba(212,160,23,0.25); color: var(--naples); border: 1px solid rgba(249,216,74,0.4); }
.settings-section {
  padding: 22px; background: var(--white); border: 1px solid var(--cream-border);
  border-radius: var(--radius-md); margin-bottom: 14px; box-shadow: var(--shadow-card);
}
.settings-title {
  font-family: 'Lora', Georgia, serif; font-size: 16px; font-weight: 700;
  margin-bottom: 16px; color: var(--text-primary);
}
.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle-label { font-size: 14px; font-weight: 600; color: var(--text-primary); font-family: 'Inter', system-ui, sans-serif; }
.toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: 'Inter', system-ui, sans-serif; }
.toggle { position: relative; display: inline-block; width: 50px; height: 27px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--cream-border); border-radius: 27px;
  cursor: pointer; transition: all var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; transition: all var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: linear-gradient(135deg, var(--maroon), var(--maroon-light)); }
.toggle input:checked + .toggle-slider::before { transform: translateX(23px); background: var(--naples); }

/* ── Modals ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,32,68,0.55);
  backdrop-filter: blur(6px); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s ease-out;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--cream); border: 1px solid var(--cream-border);
  border-radius: var(--radius-xl); padding: 36px 32px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg); animation: fadeSlideUp 0.3s ease-out;
}
.modal-box h3 {
  font-family: 'Lora', Georgia, serif; font-size: 22px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 6px;
}
.modal-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 22px; font-family: 'Inter', system-ui, sans-serif; font-style: italic; }
.mood-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mood-btn {
  padding: 16px 10px; background: var(--white); border: 2px solid var(--cream-border);
  border-radius: var(--radius-md); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all var(--transition); text-align: center; line-height: 1.6;
  color: var(--text-primary); font-family: 'Inter', system-ui, sans-serif;
}
.mood-btn:hover { border-color: var(--maroon); background: var(--maroon-surface); }
.mood-btn.selected {
  border-color: var(--maroon); background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  color: #fff; box-shadow: var(--shadow-sm);
}

/* ── Toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--bottomnav-h) + 16px); left: 50%; transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: #fff; padding: 12px 24px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600; z-index: 200; opacity: 0;
  transition: all 0.3s ease; pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow-md); border: 1px solid rgba(212,160,23,0.3);
  font-family: 'Inter', system-ui, sans-serif;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Fonts ────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=Inter:wght@400;500;600;700;800&display=swap');
