/* ======================================================
   Iridescent Intern Suite — Global Stylesheet
   ====================================================== */

/* ---------- Theme Variables ---------- */
:root {
    --bg-base: #030712;
    --bg-base-transparent: rgba(3, 7, 18, 0.85);
    --bg-sidebar: #0d0e17;
    --bg-card: #0d1117;
    --bg-input: rgba(255, 255, 255, 0.04);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.07);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --glass-card: rgba(13, 17, 23, 0.7);
}

body.theme-light {
    --bg-base: #f1f5f9;
    --bg-base-transparent: rgba(241, 245, 249, 0.85);
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: rgba(0, 0, 0, 0.03);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.06);
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.25);
    --shadow-color: rgba(15, 23, 42, 0.08);
    --overlay-bg: rgba(15, 23, 42, 0.5);
    --glass-card: rgba(255, 255, 255, 0.85);
}

body.theme-solar {
    --bg-base: #002b36;
    --bg-base-transparent: rgba(0, 43, 54, 0.85);
    --bg-sidebar: #001f27;
    --bg-card: #073642;
    --bg-input: rgba(0, 0, 0, 0.15);
    --text-main: #fdf6e3;
    --text-muted: #93a1a1;
    --border-color: rgba(147, 161, 161, 0.12);
    --primary-color: #268bd2;
    --primary-hover: #1b73b2;
    --primary-glow: rgba(38, 139, 210, 0.35);
    --shadow-color: rgba(0, 33, 43, 0.4);
    --overlay-bg: rgba(0, 33, 43, 0.7);
    --glass-card: rgba(7, 54, 66, 0.65);
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); opacity: 0.3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-base) !important; 
    color: var(--text-main) !important; 
    min-height: 100vh; 
    overflow-x: hidden; 
    transition: background 0.3s, color 0.3s;
}
.font-outfit { font-family: 'Outfit', sans-serif; }
.font-inter { font-family: 'Inter', sans-serif; }
.hidden { display: none !important; }

/* ---------- Login Screen ---------- */
.login-bg {
    background: radial-gradient(ellipse at 20% 30%, var(--bg-sidebar) 0%, var(--bg-base) 50%),
                radial-gradient(ellipse at 80% 70%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    background-blend-mode: screen;
}
.orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.15;
    animation: orbFloat 8s ease-in-out infinite;
    pointer-events: none;
}
.orb-1 { width: 500px; height: 500px; background: #6366f1; top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -80px; right: -80px; animation-delay: -3s; }
.orb-3 { width: 300px; height: 300px; background: #06b6d4; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -6s; }
@keyframes orbFloat {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}
.auth-card {
    background: var(--glass-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(32px);
    border-radius: 28px;
    padding: 52px 48px;
    width: 100%; max-width: 440px;
    text-align: center;
    box-shadow: 0 40px 100px var(--shadow-color), inset 0 1px 0 rgba(255,255,255,0.05);
    animation: authIn 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes authIn {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-logo-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-logo {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 40px rgba(99,102,241,0.3);
}
.auth-title { font-family: 'Outfit', sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--text-main); letter-spacing: -1px; line-height: 1; }
.auth-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--primary-color); background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); padding: 3px 12px; border-radius: 99px; margin-top: 6px; margin-bottom: 18px; }
.auth-subtitle { font-size: 0.88rem; color: var(--text-muted); opacity: 0.8; line-height: 1.6; margin-bottom: 36px; }
.auth-google-btn {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; padding: 14px 24px;
    background: var(--text-main); color: var(--bg-base);
    border: none; border-radius: 14px;
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-family: 'Inter', sans-serif;
}
.auth-google-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.auth-google-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; border-radius: 10px; padding: 10px 14px; font-size: 0.82rem; margin-top: 14px; }
.auth-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.1); border-top-color: var(--bg-base); border-radius: 50%; animation: spin 0.7s linear infinite; }
.auth-footer { color: var(--text-muted); opacity: 0.4; font-size: 0.7rem; margin-top: 24px; }

/* ---------- App Layout ---------- */
#app { display: flex; min-height: 100vh; background: var(--bg-base); }

/* ---------- Sidebar ---------- */
.sidebar {
    width: 240px; min-height: 100vh; flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto; overflow-x: hidden;
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 100;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-title-wrap,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-divider,
.sidebar.collapsed .user-mini-info { display: none; }
.sidebar.collapsed .sidebar-toggle-btn svg { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-header { padding: 16px 14px; justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 14px; }
.sidebar.collapsed .user-mini { justify-content: center; padding: 12px 14px; }
.sidebar.collapsed .signout-btn { display: none; }
.sidebar.collapsed .sidebar-logo { margin: 0; }

.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 20px 16px 16px; border-bottom: 1px solid var(--border-color); }
.sidebar-logo { width: 36px; height: 36px; background: linear-gradient(135deg, #6366f1, #8b5cf6); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 16px rgba(99,102,241,0.25); }
.sidebar-title { font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.5px; white-space: nowrap; }
.sidebar-subtitle { font-size: 0.62rem; color: var(--text-muted); opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
.sidebar-title-wrap { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.sidebar-toggle-btn { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; transition: color 0.2s, background 0.2s; flex-shrink: 0; }
.sidebar-toggle-btn:hover { color: var(--text-main); background: var(--bg-input); }
.sidebar-toggle-btn svg { transition: transform 0.3s; display: block; }

.sidebar-nav { flex-grow: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px; border-radius: 10px;
    background: none; border: none; color: var(--text-muted);
    font-size: 0.85rem; font-weight: 500; cursor: pointer;
    text-align: left; transition: all 0.15s ease;
    white-space: nowrap; font-family: 'Inter', sans-serif;
}
.nav-item:hover { background: var(--bg-input); color: var(--text-main); }
.nav-item.active { background: rgba(99,102,241,0.15); color: var(--primary-color); }
.nav-item.active svg { color: var(--primary-color); }
.nav-divider { padding: 10px 12px 4px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); opacity: 0.6; overflow: hidden; }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid var(--border-color); }
.user-mini { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; transition: background 0.15s; }
.user-mini:hover { background: var(--bg-input); }
.user-mini-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.user-mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-mini-info { flex-grow: 1; overflow: hidden; }
.user-mini-name { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.signout-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; transition: all 0.15s; flex-shrink: 0; }
.signout-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* ---------- Role Badges ---------- */
.role-badge { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.role-admin { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.role-president { background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }
.role-vp { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.25); }
.role-secretary { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.25); }
.role-treasurer { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.role-auditor { background: rgba(6,182,212,0.15); color: #22d3ee; border: 1px solid rgba(6,182,212,0.25); }
.role-ambassador { background: rgba(236,72,153,0.15); color: #f472b6; border: 1px solid rgba(236,72,153,0.25); }
.role-intern { background: rgba(107,114,128,0.15); color: var(--text-muted); border: 1px solid rgba(107,114,128,0.2); }

/* ---------- Top Bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 24px;
    background: var(--bg-base-transparent);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}
.topbar-menu-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 8px; transition: all 0.15s; display: none; }
.topbar-menu-btn:hover { background: var(--bg-input); color: var(--text-main); }
.topbar-title { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-main); flex-grow: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 10px; color: var(--text-muted); pointer-events: none; }
.search-input { background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; padding: 7px 12px 7px 32px; font-size: 0.82rem; color: var(--text-main); outline: none; width: 200px; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.search-input:focus { background: var(--bg-input); border-color: var(--primary-color); width: 260px; box-shadow: 0 0 0 3px var(--primary-glow); }
.search-input::placeholder { color: var(--text-muted); opacity: 0.5; }
.topbar-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: white; flex-shrink: 0; border: 2px solid var(--border-color); transition: border-color 0.2s; }
.topbar-avatar:hover { border-color: var(--primary-color); }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Notification Bell & Popover ---------- */
.notification-bell-btn { position: relative; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 8px; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.notification-bell-btn:hover { background: var(--bg-input); color: var(--text-main); }
.notification-badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; display: none; border: 1.5px solid var(--bg-base); }
.notification-badge.active { display: block; }

.notifications-popover {
    position: absolute; top: 60px; right: 64px; z-index: 200;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 16px; width: 320px; max-height: 400px;
    box-shadow: 0 20px 60px var(--shadow-color);
    display: flex; flex-direction: column; overflow: hidden;
    animation: fadeDown 0.2s ease;
}
.notifications-header { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.notifications-title { font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.notifications-list { overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; }
.notification-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: background 0.15s; position: relative; }
.notification-item:hover { background: var(--bg-input); }
.notification-item.unread::before { content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; background: var(--primary-color); border-radius: 50%; }
.notification-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.notification-avatar img { width: 100%; height: 100%; object-fit: cover; }
.notification-content { flex-grow: 1; min-width: 0; }
.notification-message { font-size: 0.8rem; color: var(--text-main); line-height: 1.4; word-wrap: break-word; }
.notification-message span { font-weight: 600; }
.notification-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; }
.notification-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 0.8rem; }

/* ---------- Mentions & Autocomplete ---------- */
.mention-autocomplete {
    position: absolute; z-index: 1000;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 10px; box-shadow: 0 10px 30px var(--shadow-color);
    max-height: 200px; overflow-y: auto; width: 220px;
    display: none;
}
.mention-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    cursor: pointer; font-size: 0.8rem; color: var(--text-main);
    transition: background 0.15s;
}
.mention-item:hover, .mention-item.active { background: var(--bg-input); }
.mention-item-avatar { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 700; color: white; overflow: hidden; flex-shrink: 0; }
.mention-item-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Search Results ---------- */
.search-results {
    position: absolute; top: 60px; right: 24px; z-index: 200;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 14px; padding: 8px; min-width: 280px; max-width: 360px;
    box-shadow: 0 20px 60px var(--shadow-color);
    animation: fadeDown 0.2s ease;
}
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.search-result-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
.search-result-item:hover { background: var(--bg-input); }
.search-result-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.search-result-avatar img { width: 100%; height: 100%; object-fit: cover; }
.search-result-name { font-size: 0.85rem; font-weight: 500; color: var(--text-main); }
.search-result-role { font-size: 0.72rem; color: var(--text-muted); }

/* ---------- Main Content ---------- */
.main-content { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.page-content { display: none; flex-grow: 1; padding: 24px; animation: pageFadeIn 0.3s ease; }
.page-content.active { display: block; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--text-main); }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; transition: border-color 0.2s; }
.card:hover { border-color: rgba(255,255,255,0.12); }

/* ---------- Buttons ---------- */
.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); border: none; border-radius: 10px; color: white; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif; text-decoration: none; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.15s; font-family: 'Inter', sans-serif; }
.btn-ghost:hover { background: var(--bg-input); color: var(--text-main); border-color: var(--text-muted); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(220,38,38,0.35); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-xs { padding: 4px 10px; font-size: 0.72rem; }

/* ---------- Input Fields ---------- */
.input-field { background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; padding: 9px 14px; font-size: 0.85rem; color: var(--text-main); outline: none; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.input-field:focus { background: var(--bg-input); border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }
.input-field::placeholder { color: var(--text-muted); opacity: 0.5; }
.filter-select { background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 14px; font-size: 0.82rem; color: var(--text-main); outline: none; cursor: pointer; font-family: 'Inter', sans-serif; }
.filter-select:focus { border-color: var(--primary-color); }

/* ---------- Feed Layout ---------- */
.page-feed-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 1024px) { .page-feed-layout { grid-template-columns: 1fr; } .feed-sidebar { display: none; } }

/* ---------- Feed Post Composer ---------- */
.post-composer { margin-bottom: 16px; }
.composer-header { display: flex; gap: 12px; }
.composer-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.composer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.composer-input-wrap { flex-grow: 1; position: relative; }
.composer-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px; font-size: 0.88rem; color: var(--text-main); resize: none; outline: none; transition: all 0.2s; min-height: 80px; font-family: 'Inter', sans-serif; }
.composer-input:focus { background: var(--bg-input); border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }
.composer-input::placeholder { color: var(--text-muted); opacity: 0.5; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.composer-attach-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-muted); font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.composer-attach-btn:hover { background: var(--bg-input); color: var(--text-main); }

/* ---------- Feed Post Card ---------- */
.post-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; margin-bottom: 12px; transition: border-color 0.2s; }
.post-card:hover { border-color: rgba(255,255,255,0.12); }
.post-card.pinned { border-color: rgba(99,102,241,0.3); background: rgba(99,102,241,0.04); }
.post-card.officer-post .post-author-name::after { content: '★'; margin-left: 4px; color: #fbbf24; font-size: 0.7em; }
.post-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.post-avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: white; }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.clickable-avatar { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.clickable-avatar:hover { transform: scale(1.12); box-shadow: 0 0 0 2.5px var(--primary-color); }
.post-author-wrap { flex-grow: 1; }
.post-author-name { font-weight: 600; font-size: 0.88rem; color: var(--text-main); display: flex; align-items: center; gap: 6px; }
.post-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.post-actions-top { display: flex; gap: 6px; }
.post-body { font-size: 0.88rem; color: var(--text-main); opacity: 0.95; line-height: 1.65; white-space: pre-wrap; }
.post-image { margin-top: 14px; border-radius: 12px; overflow: hidden; max-height: 400px; }
.post-image img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform 0.3s; }
.post-image img:hover { transform: scale(1.01); }
.post-footer { display: flex; align-items: center; gap: 4px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.post-action-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px; border: none; background: none; color: var(--text-muted); font-size: 0.8rem; cursor: pointer; transition: all 0.15s; font-family: 'Inter', sans-serif; }
.post-action-btn:hover { background: var(--bg-input); color: var(--text-main); }
.post-action-btn.liked { color: #f87171; }
.pin-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; font-weight: 700; color: #818cf8; background: rgba(99,102,241,0.1); padding: 2px 8px; border-radius: 99px; }

/* ---------- Feed Sidebar Widgets ---------- */
.widget-card { margin-bottom: 16px; }
.widget-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.95rem; color: var(--text-main); margin-bottom: 16px; }
.class-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.class-stat-item { background: var(--bg-input); border-radius: 10px; padding: 12px; text-align: center; border: 1px solid var(--border-color); }
.class-stat-num { font-family: 'Outfit', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--text-main); }
.class-stat-label { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.officers-list { display: flex; flex-direction: column; gap: 10px; }
.officer-item { display: flex; align-items: center; gap: 10px; }
.officer-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0; }
.officer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.officer-name { font-size: 0.82rem; font-weight: 500; color: var(--text-main); }
.officer-role-label { font-size: 0.68rem; color: var(--text-muted); }

/* ---------- Skeleton Loader ---------- */
.skeleton-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; margin-bottom: 12px; }
.skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-color) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Directory ---------- */
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.directory-grid.list-view { grid-template-columns: 1fr; }
.intern-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; cursor: pointer; transition: all 0.25s; }
.intern-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px var(--shadow-color); border-color: var(--primary-glow); }
.intern-card-banner { height: 80px; background: linear-gradient(135deg, #1e1b4b, #0f172a); position: relative; overflow: hidden; }
.intern-card-banner img { width: 100%; height: 100%; object-fit: cover; }
.intern-card-avatar { width: 100px; height: 100px; border-radius: 50%; border: 4px solid var(--bg-card); background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; color: white; position: absolute; bottom: -50px; left: 16px; overflow: hidden; flex-shrink: 0; }
.intern-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.intern-card-body { padding: 58px 14px 14px; }
.intern-card-name { font-weight: 700; font-size: 0.85rem; color: var(--text-main); margin-bottom: 4px; line-height: 1.3; }
.intern-card-stats { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.stat-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font-size: 0.68rem; font-weight: 600; }
.stat-pill-present { background: rgba(16,185,129,0.12); color: #34d399; }
.stat-pill-late { background: rgba(251,191,36,0.12); color: #fbbf24; }
.stat-pill-absent { background: rgba(239,68,68,0.12); color: #f87171; }
.stat-pill-rotation { background: rgba(99,102,241,0.12); color: #a5b4fc; }

/* List view card */
.directory-grid.list-view .intern-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.directory-grid.list-view .intern-card-banner { width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0; }
.directory-grid.list-view .intern-card-avatar { position: static; transform: none; width: 80px; height: 80px; border: none; }
.directory-grid.list-view .intern-card-body { padding: 0; flex-grow: 1; }
.directory-grid.list-view .intern-card-stats { flex-wrap: nowrap; }

/* ---------- Profile Page ---------- */
.profile-banner { height: 200px; background: linear-gradient(135deg, #1e1b4b, #0f172a); position: relative; overflow: hidden; border-radius: 16px 16px 0 0; cursor: pointer; }
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-banner-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.profile-banner:hover .profile-banner-overlay { opacity: 1; }
.profile-banner-overlay span { color: white; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.profile-card-header { background: var(--bg-card); border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 16px 16px; padding: 0 24px 24px; position: relative; }
.profile-avatar-wrap { position: relative; display: inline-block; }
.profile-avatar { width: 220px; height: 220px; border-radius: 50%; border: 6px solid var(--bg-card); background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 4.5rem; font-weight: 800; color: white; overflow: hidden; margin-top: -110px; position: relative; cursor: pointer; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit { position: absolute; bottom: 8px; right: 8px; width: 32px; height: 32px; background: #6366f1; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2.5px solid var(--bg-card); }
.profile-info { margin-top: 14px; }
.profile-name { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--text-main); line-height: 1.2; }
.profile-bio { font-size: 0.88rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; max-width: 500px; }
.bio-edit-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; color: var(--text-main); resize: none; outline: none; }
.profile-stats-bar { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 16px; }
.profile-stat-chip { padding: 6px 14px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; font-size: 0.8rem; text-align: center; }
.profile-stat-num { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.15rem; display: block; }
.profile-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-tabs { display: flex; gap: 4px; margin-top: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 0; }
.profile-tab { background: none; border: none; padding: 10px 16px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; font-family: 'Inter', sans-serif; margin-bottom: -1px; }
.profile-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.profile-tab-content { display: none; }
.profile-tab-content.active { display: block; padding-top: 20px; }

/* ---------- Attendance Table ---------- */
.attendance-table-wrap { overflow-x: auto; }
.attendance-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.attendance-table th { background: var(--bg-input); color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 16px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border-color); }
.attendance-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); color: var(--text-main); opacity: 0.9; white-space: nowrap; }
.attendance-table tbody tr:hover { background: var(--bg-input); }
.attendance-table .rank-cell { font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--text-main); }
.attendance-table .name-cell { font-weight: 600; color: var(--text-main); cursor: pointer; }
.attendance-table .name-cell:hover { color: var(--primary-color); }
.attendance-rank-1 { color: #fbbf24; }
.attendance-rank-2 { color: #d1d5db; }
.attendance-rank-3 { color: #b45309; }
.attendance-pct-bar { display: flex; align-items: center; gap: 8px; }
.pct-bar-track { width: 80px; height: 6px; background: var(--border-color); border-radius: 3px; overflow: hidden; }
.pct-bar-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 3px; transition: width 0.6s ease; }

/* ---------- Badge ---------- */
.badge-officer { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 12px; border-radius: 99px; background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.25); }
.badge-admin { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* ---------- Toast ---------- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; font-size: 0.85rem; font-weight: 500; box-shadow: 0 8px 30px var(--shadow-color); animation: toastIn 0.3s ease; backdrop-filter: blur(16px); min-width: 240px; max-width: 360px; }
.toast-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }
.toast-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.toast-info { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.25); color: #a5b4fc; }
.toast-warning { background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.25); color: #fbbf24; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 500; background: var(--overlay-bg); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 20px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; box-shadow: 0 40px 100px var(--shadow-color); animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border-color); }
.modal-title { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; font-size: 1.3rem; line-height: 1; transition: all 0.15s; }
.modal-close:hover { color: var(--text-main); background: var(--bg-input); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Admin ---------- */
.admin-roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.admin-roster-item { padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; font-size: 0.82rem; color: var(--text-main); cursor: pointer; transition: all 0.15s; }
.admin-roster-item:hover { background: rgba(99,102,241,0.08); border-color: var(--primary-color); color: var(--primary-color); }

/* ---------- Biometrics / PECC wrappers ---------- */
#biometrics-app-root, #pecc-app-root { min-height: 400px; }

/* ---------- Comments Section ---------- */
.comments-section { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.comment-item { display: flex; gap: 10px; margin-bottom: 10px; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-bubble { background: var(--bg-input); border-radius: 10px; padding: 8px 12px; flex-grow: 1; }
.comment-author { font-size: 0.78rem; font-weight: 600; color: var(--text-main); margin-bottom: 2px; }
.comment-text { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.comment-input-wrap { display: flex; gap: 8px; align-items: center; margin-top: 8px; position: relative; }
.comment-input { flex-grow: 1; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 20px; padding: 8px 14px; font-size: 0.82rem; color: var(--text-main); outline: none; font-family: 'Inter', sans-serif; }
.comment-input:focus { border-color: var(--primary-color); }
.comment-input::placeholder { color: var(--text-muted); opacity: 0.5; }
.comment-submit-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-color); border: none; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.2s; }
.comment-submit-btn:hover { background: var(--primary-hover); }

/* ---------- Biometrics Upload Result ---------- */
.bio-result-matched { display: flex; align-items: center; gap:8px; padding: 8px 12px; background: rgba(16,185,129,0.08); border-radius: 8px; margin-bottom: 6px; font-size: 0.82rem; color: #34d399; }
.bio-result-unmatched { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(239,68,68,0.08); border-radius: 8px; margin-bottom: 6px; font-size: 0.82rem; color: #f87171; }

/* ---------- Animations utility ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.3s; z-index: 200; }
    .sidebar.mobile-open { transform: translateX(0); }
    .topbar-menu-btn { display: flex; }
    .main-content { width: 100%; }
    .page-content { padding: 16px; }
    .search-input { width: 150px; }
    .search-input:focus { width: 180px; }
    .profile-banner { height: 140px; }
    .attendance-table { font-size: 0.78rem; }
    .notifications-popover { right: 16px; width: calc(100vw - 32px); }
}

/* ---------- Form styling (for profile forms) ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.form-input { width: 100%; }

/* ---------- Biometrics progress ---------- */
.bio-progress-bar { height: 4px; background: var(--border-color); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.bio-progress-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 2px; transition: width 0.4s ease; }

/* ---------- Delete confirmation inline ---------- */
.delete-confirm-row td { background: rgba(239,68,68,0.06); }

/* ---------- Empty state ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-muted); }
.empty-state svg { margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); opacity: 0.8; }

/* ---------- Security bindings ---------- */
.binding-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg-input); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-color); margin-top: 10px; }
.binding-info { display: flex; flex-direction: column; gap: 2px; }
.binding-title { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.binding-status { font-size: 0.72rem; color: var(--text-muted); }

/* ---------- Custom Dropdown Autocomplete ---------- */
.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    z-index: 1000;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 25px -5px var(--shadow-color);
}
.custom-dropdown-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.custom-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
}
.custom-dropdown-item.active {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-main);
}
.custom-dropdown::-webkit-scrollbar {
    width: 6px;
}
.custom-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.custom-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.custom-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Settings & Themes Page ---------- */
.settings-theme-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.settings-theme-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px var(--primary-glow);
}
.settings-theme-card.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 2px var(--primary-color), 0 8px 24px var(--primary-glow);
}
.theme-preview-box {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.05);
}
.dark-preview { background: #030712; }
.light-preview { background: #f1f5f9; }
.solar-preview { background: #002b36; }

.theme-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.theme-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 4px;
}
.theme-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Switch Toggle Styling */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-color);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}
.slider-toggle:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-main);
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider-toggle {
    background-color: var(--primary-color);
}
input:focus + .slider-toggle {
    box-shadow: 0 0 1px var(--primary-color);
}
input:checked + .slider-toggle:before {
    transform: translateX(20px);
}

