/* ================================================================
   HUDHUD E-LEARNING — Premium Gold/Emerald Design System 2026
   ================================================================ */
:root {
  --gold: #C9A84C; --gold-light: #E8D5A3; --gold-dark: #A8893A;
  --green: #0F5132; --green-mid: #1A6F4A; --green-light: #2A8F5E;
  --green-pale: #E8F3EE;
  --cream: #FCF8EF;
  --ink-900: #0B2A3B; --ink-700: #1C3D51; --ink-500: #4A6B7C;
  --ink-300: #A8B8C2; --ink-100: #E8EDF0;
  --white: #FFFFFF;
  --danger: #DC2626; --success: #10B981; --warning: #F59E0B; --info: #3B82F6;
  --grad-gold: linear-gradient(145deg, #D4B85A, #B8963E);
  --grad-green: linear-gradient(145deg, #1A7A4E, #0F5132);
  --grad-hero: linear-gradient(135deg, #0F5132 0%, #1A6F4A 50%, #C9A84C 100%);
  --shadow-sm: 0 1px 3px rgba(11,42,59,0.06);
  --shadow-md: 0 4px 16px rgba(11,42,59,0.08);
  --shadow-lg: 0 12px 32px rgba(11,42,59,0.12);
  --shadow-xl: 0 24px 64px rgba(11,42,59,0.18);
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --sidebar-w: 260px; --topbar-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink-900);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
a { color: var(--green); text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); background-clip: padding-box; }

/* === LOGIN === */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(at 20% 20%, rgba(201,168,76,0.18) 0%, transparent 50%),
    radial-gradient(at 80% 80%, rgba(15,81,50,0.20) 0%, transparent 50%),
    linear-gradient(135deg, #FCF8EF 0%, #F0F4F0 100%);
  position: relative;
}
.login-bg-pattern {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
  pointer-events: none;
}
.login-card {
  position: relative; width: 100%; max-width: 440px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(201,168,76,0.30);
  border-radius: var(--r-xl);
  padding: 40px 32px 28px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-brand { text-align: center; margin-bottom: 28px; }
.brand-logo {
  width: 84px; height: 84px; margin: 0 auto 14px;
  background: var(--grad-gold); border-radius: 50%;
  display: grid; place-items: center; font-size: 42px;
  box-shadow: 0 8px 24px rgba(201,168,76,0.40);
  border: 3px solid rgba(255,255,255,0.6);
}
.login-brand h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.55rem; font-weight: 800; color: var(--ink-900); letter-spacing: -0.5px;
}
.login-brand h1 .gold { color: var(--gold); }
.brand-tag {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--green-mid); margin-top: 6px;
}
.login-tabs {
  display: flex; gap: 4px; margin-bottom: 24px; padding: 4px;
  background: var(--cream); border-radius: var(--r-md);
  border: 1px solid var(--gold-light);
}
.login-tab {
  flex: 1; padding: 10px; background: transparent; border: none;
  border-radius: 10px; font-size: 0.88rem; font-weight: 700;
  color: var(--ink-500); transition: all 0.2s;
}
.login-tab.active {
  background: var(--grad-green); color: white;
  box-shadow: 0 4px 12px rgba(15,81,50,0.30);
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.form-field label {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: var(--ink-700); text-transform: uppercase;
  letter-spacing: 0.6px; margin-bottom: 6px;
}
.form-field label small { text-transform: none; font-weight: 500; color: var(--ink-300); letter-spacing: 0; }
.form-field input, .form-field select {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--ink-100); border-radius: var(--r-md);
  background: white; font-size: 0.92rem; color: var(--ink-900);
  transition: all 0.2s;
}
.form-field input:focus, .form-field select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.15);
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-primary, .btn-secondary, .btn-success {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 20px; border-radius: var(--r-md);
  border: none; font-size: 0.92rem; font-weight: 700;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.btn-primary { background: var(--grad-green); color: white; box-shadow: 0 4px 16px rgba(15,81,50,0.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,81,50,0.40); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: white; color: var(--ink-700); border: 2px solid var(--ink-100); }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-success { background: var(--grad-gold); color: white; box-shadow: 0 4px 16px rgba(201,168,76,0.30); }
.btn-success:hover { transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: white; border: 1.5px solid var(--ink-100);
  border-radius: var(--r-sm); color: var(--ink-700);
  transition: all 0.2s; flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--green-pale); border-color: var(--green-light);
  color: var(--green); transform: translateY(-1px);
}
.btn-icon svg { width: 18px; height: 18px; }
.divider {
  display: flex; align-items: center; gap: 12px; margin: 6px 0;
  color: var(--ink-300); font-size: 0.75rem; font-weight: 600;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--ink-100); }
#googleBtnContainer { display: flex; justify-content: center; }
.error-msg {
  padding: 10px 14px; background: #FEF2F2;
  border: 1.5px solid #FCA5A5; border-left: 4px solid var(--danger);
  border-radius: var(--r-sm); font-size: 0.82rem;
  color: #991B1B; font-weight: 600;
}
.login-footnote {
  margin-top: 24px; text-align: center;
  font-size: 0.72rem; color: var(--ink-300); font-weight: 500;
}

/* === APP LAYOUT === */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--green) 0%, #0A3D25 100%);
  color: white; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header { padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand-mini { display: flex; gap: 12px; align-items: center; }
.brand-icon {
  width: 44px; height: 44px; background: var(--grad-gold);
  border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; box-shadow: 0 4px 12px rgba(201,168,76,0.4);
}
.brand-mini h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem; font-weight: 800; letter-spacing: -0.3px;
}
.brand-mini p {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold-light);
}
.sidebar-nav {
  flex: 1; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: transparent; border: none;
  border-radius: var(--r-md); color: rgba(255,255,255,0.72);
  font-size: 0.88rem; font-weight: 600; text-align: left;
  width: 100%; transition: all 0.2s; position: relative;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active {
  background: var(--grad-gold); color: white;
  box-shadow: 0 6px 20px rgba(201,168,76,0.4);
}
.nav-badge, .notif-badge {
  margin-left: auto; min-width: 20px; height: 20px;
  padding: 0 6px; background: var(--danger); color: white;
  border-radius: 10px; display: none; place-items: center;
  font-size: 0.65rem; font-weight: 800;
  border: 2px solid rgba(255,255,255,0.3);
}
.nav-badge.show, .notif-badge.show { display: grid; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.user-mini { flex: 1; display: flex; gap: 10px; align-items: center; min-width: 0; }
.user-mini .avatar {
  width: 38px; height: 38px; background: var(--grad-gold);
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0; overflow: hidden;
}
.user-mini .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta { min-width: 0; }
.user-meta strong {
  display: block; font-size: 0.82rem; font-weight: 700;
  color: white; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-meta small {
  display: block; font-size: 0.68rem; color: var(--gold-light);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-footer .btn-icon {
  background: rgba(255,255,255,0.08);
  border-color: transparent; color: white;
  width: 36px; height: 36px;
}
.sidebar-footer .btn-icon:hover { background: rgba(239,68,68,0.5); color: white; }

/* === TOPBAR === */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 24px; height: var(--topbar-h);
  background: white; border-bottom: 1px solid var(--ink-100);
  position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}
.menu-toggle {
  display: none; width: 40px; height: 40px;
  background: transparent; border: none; border-radius: 8px; color: var(--ink-700);
}
.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem; font-weight: 800; color: var(--ink-900);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.online-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--green-pale);
  border: 1px solid rgba(15,81,50,0.20); border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; color: var(--green);
}
.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  50%     { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.live-clock {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  font-weight: 700; color: var(--ink-700);
  padding: 6px 12px; background: var(--cream);
  border-radius: var(--r-sm); border: 1px solid var(--gold-light);
}
#notifBell { position: relative; }

/* === PAGES === */
.page {
  display: none; padding: 24px;
  max-width: 1500px; margin: 0 auto; width: 100%;
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}
.page-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.85rem; font-weight: 800;
  color: var(--ink-900); letter-spacing: -0.6px;
}
.subtitle { color: var(--ink-500); font-size: 0.88rem; margin-top: 4px; }

/* === CARDS === */
.card {
  background: white; border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--ink-100);
  margin-bottom: 20px; transition: box-shadow 0.25s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px dashed var(--ink-100);
}
.card-header h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem; font-weight: 700; color: var(--ink-900);
}
.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 20px;
}
.list-container { max-height: 320px; overflow-y: auto; }
.empty { text-align: center; color: var(--ink-300); font-size: 0.85rem; padding: 24px; }

/* === STATS === */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--r-lg); padding: 20px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--grad-gold);
}
.stat-card[data-color="green"]::before { background: var(--grad-green); }
.stat-card[data-color="blue"]::before { background: linear-gradient(90deg, #3B82F6, #1D4ED8); }
.stat-card[data-color="gold"]::before { background: var(--grad-gold); }
.stat-card[data-color="purple"]::before { background: linear-gradient(90deg, #8B5CF6, #6D28D9); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 54px; height: 54px; background: var(--cream);
  border-radius: var(--r-md); display: grid; place-items: center;
  font-size: 26px; flex-shrink: 0;
}
.stat-info h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem; font-weight: 800; color: var(--ink-900);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat-info p {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--ink-500); margin-top: 4px;
}

/* === EXAMS === */
.exams-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.exam-card {
  background: white; border-radius: var(--r-lg); padding: 22px;
  border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative; overflow: hidden; cursor: pointer;
}
.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg); border-color: var(--gold);
}
.exam-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--grad-hero);
}
.exam-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--ink-900); margin-bottom: 6px;
}
.exam-card .course-code {
  display: inline-block; padding: 3px 10px;
  background: var(--green-pale); color: var(--green);
  border-radius: 10px; font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.5px; margin-bottom: 10px;
}
.exam-card .exam-meta-list {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 0.78rem; color: var(--ink-500);
  margin: 12px 0 16px;
}
.exam-card .exam-meta-list span { display: flex; align-items: center; gap: 4px; }
.exam-card .btn-take-exam {
  width: 100%; padding: 10px;
  background: var(--grad-green); color: white;
  border: none; border-radius: var(--r-md);
  font-weight: 700; transition: all 0.2s;
}
.exam-card .btn-take-exam:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(15,81,50,0.35);
}

/* === EXAM TAKING === */
.exam-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
  padding: 16px 20px; background: white;
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  border: 1px solid var(--ink-100);
  position: sticky; top: calc(var(--topbar-h) + 12px); z-index: 10;
}
.exam-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem; font-weight: 800;
}
.exam-timer {
  padding: 8px 18px; background: var(--grad-gold); color: white;
  border-radius: 20px; font-family: 'JetBrains Mono', monospace;
  font-size: 1rem; font-weight: 700;
  box-shadow: 0 4px 12px rgba(201,168,76,0.35);
}
.exam-questions { display: flex; flex-direction: column; gap: 16px; }
.exam-question {
  background: white; border-radius: var(--r-lg); padding: 22px;
  border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}
.exam-question:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.12);
}
.exam-question .q-number {
  display: inline-block; padding: 3px 10px;
  background: var(--grad-gold); color: white;
  border-radius: 12px; font-size: 0.72rem; font-weight: 800;
  margin-bottom: 10px;
}
.exam-question .q-text {
  font-weight: 600; font-size: 1rem;
  color: var(--ink-900); margin-bottom: 14px;
}
.exam-question input[type="text"], .exam-question textarea {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--ink-100); border-radius: var(--r-md);
  font-size: 0.92rem; transition: all 0.2s;
}
.exam-question input:focus, .exam-question textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.15);
}
.exam-options { display: flex; flex-direction: column; gap: 8px; }
.exam-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--cream);
  border: 2px solid transparent; border-radius: var(--r-md);
  cursor: pointer; font-size: 0.9rem; transition: all 0.2s;
}
.exam-option:hover { background: var(--green-pale); border-color: var(--green-light); }
.exam-option input[type="radio"] { accent-color: var(--green); width: 18px; height: 18px; }
.exam-option:has(input:checked) {
  background: var(--green-pale); border-color: var(--green); font-weight: 600;
}
.exam-actions { display: flex; justify-content: flex-end; padding: 24px 0; }

/* === RESULTS / ATTENDANCE === */
.results-table table, .attendance-list table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
}
.results-table th, .attendance-list th {
  text-align: left; padding: 12px 14px; background: var(--cream);
  border-bottom: 2px solid var(--gold-light);
  font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-700);
}
.results-table td, .attendance-list td {
  padding: 12px 14px; border-bottom: 1px solid var(--ink-100);
}
.results-table tr:hover, .attendance-list tr:hover { background: var(--cream); }
.score-pill {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  font-weight: 800; font-size: 0.78rem;
}
.score-pill.excellent { background: #D1FAE5; color: #065F46; }
.score-pill.good      { background: #DBEAFE; color: #1E40AF; }
.score-pill.pass      { background: #FEF3C7; color: #92400E; }
.score-pill.fail      { background: #FEE2E2; color: #991B1B; }
.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
}
.status-present { background: #D1FAE5; color: #065F46; }
.status-absent  { background: #FEE2E2; color: #991B1B; }
.status-late    { background: #FEF3C7; color: #92400E; }
.attendance-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.att-course-card {
  background: white; padding: 16px;
  border-radius: var(--r-md); border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
}
.att-course-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.att-course-card small { font-size: 0.72rem; color: var(--ink-500); }
.att-bar {
  height: 6px; background: var(--ink-100);
  border-radius: 3px; margin-top: 10px; overflow: hidden;
}
.att-bar-fill {
  height: 100%; background: var(--grad-green);
  border-radius: 3px; transition: width 0.6s ease;
}

/* === CHAT === */
.chat-layout {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 16px; height: calc(100vh - var(--topbar-h) - 48px);
  min-height: 500px;
}
.chat-side {
  background: white; border-radius: var(--r-lg);
  border: 1px solid var(--ink-100);
  display: flex; flex-direction: column;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.chat-side-header {
  padding: 16px; border-bottom: 1px solid var(--ink-100);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-side-header h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem; font-weight: 800;
}
.chat-online-count {
  font-size: 0.72rem; font-weight: 700; color: var(--green);
  display: flex; align-items: center; gap: 4px;
}
.chat-rooms { padding: 8px; }
.chat-room-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: transparent; border: none;
  border-radius: var(--r-md); cursor: pointer;
  text-align: left; transition: background 0.2s; color: var(--ink-700);
}
.chat-room-btn:hover { background: var(--cream); }
.chat-room-btn.active { background: var(--green-pale); color: var(--green); }
.chat-room-btn .room-icon {
  width: 36px; height: 36px;
  background: var(--grad-gold); color: white;
  border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
}
.chat-room-btn strong { display: block; font-size: 0.88rem; }
.chat-room-btn small { font-size: 0.72rem; color: var(--ink-500); }
.chat-online-list {
  padding: 12px; border-top: 1px solid var(--ink-100);
  flex: 1; overflow-y: auto;
}
.chat-online-list h4 {
  font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--ink-500); margin-bottom: 10px;
}
.online-user-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--r-sm);
  font-size: 0.82rem; transition: background 0.15s; cursor: pointer;
}
.online-user-row:hover { background: var(--cream); }
.online-user-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); flex-shrink: 0;
}
.chat-main {
  background: white; border-radius: var(--r-lg);
  border: 1px solid var(--ink-100);
  display: flex; flex-direction: column;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, #FCF8EF 0%, #F8FAF8 100%);
}
.chat-message { display: flex; gap: 8px; max-width: 78%; }
.chat-message.own { flex-direction: row-reverse; margin-left: auto; }
.chat-message .msg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-green); color: white;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.8rem; flex-shrink: 0; overflow: hidden;
}
.chat-message.own .msg-avatar { background: var(--grad-gold); }
.chat-message .msg-body {
  background: white; border-radius: 16px; border-top-left-radius: 4px;
  padding: 10px 14px; border: 1px solid var(--ink-100);
  box-shadow: 0 1px 3px rgba(11,42,59,0.04);
}
.chat-message.own .msg-body {
  background: var(--grad-green); color: white;
  border-top-left-radius: 16px; border-top-right-radius: 4px;
  border-color: transparent;
}
.chat-message .msg-author {
  font-size: 0.72rem; font-weight: 800;
  color: var(--green); margin-bottom: 2px;
}
.chat-message.own .msg-author { color: var(--gold-light); }
.chat-message .msg-text {
  font-size: 0.9rem; line-height: 1.45;
  word-wrap: break-word; white-space: pre-wrap;
}
.chat-message .msg-time {
  font-size: 0.66rem; opacity: 0.65;
  margin-top: 4px; font-weight: 600;
}
.chat-typing {
  padding: 0 20px 8px; font-size: 0.78rem;
  font-style: italic; color: var(--ink-500); min-height: 24px;
}
.chat-input-row {
  display: flex; gap: 8px;
  padding: 12px 16px; background: white;
  border-top: 1px solid var(--ink-100);
}
.chat-input-row input[type="text"] {
  flex: 1; padding: 12px 16px;
  border: 2px solid var(--ink-100); border-radius: 24px;
  font-size: 0.9rem; transition: all 0.2s;
}
.chat-input-row input[type="text"]:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,168,76,0.15);
}
.btn-send {
  width: 46px; height: 46px;
  background: var(--grad-green); color: white;
  border: none; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(15,81,50,0.35);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.btn-send:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(15,81,50,0.5); }
.btn-send svg { width: 20px; height: 20px; }

/* === TOASTS === */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; background: white;
  border-radius: var(--r-md); box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--green);
  font-size: 0.88rem; font-weight: 600;
  color: var(--ink-900); max-width: 380px;
  pointer-events: all;
  animation: slideInRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* === NOTIFICATIONS LIST === */
.notif-row {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--ink-100); transition: background 0.15s;
}
.notif-row:hover { background: var(--cream); }
.notif-row.unread { background: var(--green-pale); border-left: 3px solid var(--green); }
.notif-row .notif-icon-big {
  width: 40px; height: 40px; background: var(--cream);
  border-radius: 10px; display: grid; place-items: center;
  font-size: 20px; flex-shrink: 0;
}
.notif-row .notif-body { flex: 1; }
.notif-row .notif-body strong {
  display: block; font-size: 0.9rem; font-weight: 700; color: var(--ink-900);
}
.notif-row .notif-body p {
  font-size: 0.82rem; color: var(--ink-500); margin-top: 2px;
}
.notif-row .notif-body small {
  font-size: 0.7rem; color: var(--ink-300);
  font-weight: 600; margin-top: 4px; display: block;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.4); }
  .menu-toggle { display: grid; }
  .two-col { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-side { display: none; }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .live-clock, .online-pill span:not(.online-dot) { display: none; }
}
@media (max-width: 500px) {
  .page-header h1 { font-size: 1.4rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px 20px; }
  .form-row-2 { grid-template-columns: 1fr; }
}
i[data-lucide] { stroke-width: 2.2; }