:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface-2: #1f2330;
  --surface-3: #272c3d;
  --border: #2d3344;
  --text: #e4e7ef;
  --text-muted: #8b92a8;
  --text-dim: #5a6178;
  --primary: #6366f1;
  --primary-hover: #5558e3;
  --primary-light: rgba(99,102,241,.12);
  --success: #22c55e;
  --success-light: rgba(34,197,94,.12);
  --warning: #f59e0b;
  --warning-light: rgba(245,158,11,.12);
  --danger: #ef4444;
  --danger-light: rgba(239,68,68,.12);
  --info: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.3);
  --topbar-h: 56px;
  --sidebar-w: 240px;
}

[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --surface-3: #e2e5ea;
  --border: #d1d5db;
  --text: #1a1d24;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  --primary: #6366f1;
  --primary-hover: #5558e3;
  --primary-light: rgba(99,102,241,.1);
  --success: #16a34a;
  --success-light: rgba(22,163,74,.1);
  --warning: #d97706;
  --warning-light: rgba(217,119,6,.1);
  --danger: #dc2626;
  --danger-light: rgba(220,38,38,.1);
  --info: #2563eb;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
  min-height: 100vh; overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.3; margin-bottom: .5em; }
h1{font-size:1.6rem}h2{font-size:1.3rem}h3{font-size:1.1rem}
small { color: var(--text-muted); }
code,pre { font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: .875em; }
pre { background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; border: 1px solid var(--border); }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
pre code { background: none; padding: 0; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; padding: 16px 0;
  overflow-y: auto; transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.sidebar-brand { padding: 0 20px 20px; font-size: 1.15rem; font-weight: 800; color: var(--text); display:flex; align-items:center; gap:8px; }
.sidebar-brand span { color: var(--primary); }
.nav-section { padding: 0; }
.nav-section-title { padding: 8px 20px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 700; }
.nav-group-header { display:flex; align-items:center; justify-content:space-between; padding:8px 20px; cursor:pointer; user-select:none; border-top:1px solid var(--border); }
.nav-group-header:hover { background:var(--surface-2); }
.nav-group-header .nav-section-title { padding:0; border:none; }
.nav-group-arrow { transition:transform .2s; color:var(--text-dim); flex-shrink:0; }
.nav-group-arrow.collapsed { transform:rotate(-90deg); }
.nav-group-items { overflow:hidden; }
.nav-group-items.collapsed { display:none; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text-muted);
  font-weight: 500; font-size: .9rem; border-left: 3px solid transparent; transition: all .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--primary); background: var(--primary-light); border-left-color: var(--primary); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; max-width: calc(100vw - var(--sidebar-w)); }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 12px; gap: 8px; position: sticky; top: 0; z-index: 50;
  overflow: visible;
}
.topbar .menu-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px; flex-shrink: 0; }
.topbar .page-title { font-size: 1.05rem; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.content { padding: 24px; flex: 1; max-width: 1200px; width: 100%; }

/* ===== CARDS ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.card-title { font-size: 1.05rem; font-weight: 700; }

/* ===== GRID ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ===== STATS ===== */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display:flex; flex-direction:column; gap:4px; }
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; }
.stat-card .stat-label { color: var(--text-muted); font-size: .85rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: all .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #000; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-outline { background: transparent; border-color: var(--border); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-muted { background: var(--surface-3); color: var(--text-muted); }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; border: 1px solid; }
.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success); }
.alert-error { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.alert-info { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-label .opt { color: var(--text-dim); font-weight: 400; font-size: .8rem; }
.form-control, .form-select, textarea.form-control {
  width: 100%; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .9rem; font-family: inherit; transition: border-color .15s;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .78rem; color: var(--text-dim); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== TABLES ===== */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* ===== PROGRESS BAR ===== */
.progress-bar { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }

/* ===== EXERCISE CONTENT ===== */
.exercise-content { line-height: 1.7; }
.exercise-content h1,.exercise-content h2,.exercise-content h3 { margin-top: 1.5em; margin-bottom: .5em; }
.exercise-content h2 { border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.exercise-content p { margin-bottom: 1em; }
.exercise-content ul,.exercise-content ol { margin: 1em 0; padding-left: 1.5em; }
.exercise-content li { margin-bottom: .4em; }
.exercise-content strong { color: var(--text); }
.exercise-content blockquote { border-left: 3px solid var(--primary); padding-left: 16px; color: var(--text-muted); margin: 1em 0; }
.exercise-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.exercise-content a { color: var(--primary); }
.exercise-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.exercise-content th,.exercise-content td { border: 1px solid var(--border); padding: 8px; }

/* ===== STEP LIST ===== */
.step-list { list-style: none; padding: 0; counter-reset: step; }
.step-list .step { display: flex; gap: 12px; margin-bottom: 16px; }
.step-list .step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.step-list .step-type { font-size: .7rem; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }

/* ===== CHAT ===== */
.chat-messages { max-height: 400px; overflow-y: auto; padding: 8px; }
.chat-msg { margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius); max-width: 85%; }
.chat-msg.user { background: var(--primary); color: #fff; margin-left: auto; }
.chat-msg.ai { background: var(--surface-2); border: 1px solid var(--border); }
.chat-msg .role { font-size: .7rem; font-weight: 700; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }

/* ===== MISC ===== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.items-center { align-items: center; }
.wrap { flex-wrap: wrap; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-8{margin-bottom:8px}.mb-16{margin-bottom:16px}
.text-center{text-align:center}
.text-muted{color:var(--text-muted)}
.text-success{color:var(--success)}.text-danger{color:var(--danger)}.text-warning{color:var(--warning)}
.w-full{width:100%}
.hidden{display:none!important}
.loading { opacity: .5; pointer-events: none; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .emoji { font-size: 3rem; margin-bottom: 12px; }
.points-pill { background: var(--warning-light); color: var(--warning); padding: 4px 10px; border-radius: 20px; font-weight: 700; font-size: .85rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar .menu-toggle { display: block; }
  .topbar .points-pill { display: none; }
  .level-badge { display: none !important; }
  .notification-dropdown { width: calc(100vw - 20px) !important; right: -10px !important; }
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .form-row { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .card-header { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 1.3rem; }
  .topbar-user .user-name { display: none; }
  .btn-block-mobile { width: 100%; }
  .btn, .btn-sm { min-height: 44px; }
  .nav-link { min-height: 44px; }
  .stat-card .stat-value { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .content { padding: 12px; padding-bottom: 70px; }
  .btn { padding: 8px 12px; font-size: .82rem; }
  .chat-msg { max-width: 95%; }
  .logout-text { display: none; }
  .mobile-quickbar { display: flex !important; }
}
.mobile-quickbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 8px 4px; z-index: 90; justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0,0,0,.15);
}
.mobile-quickbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .65rem; color: var(--text-muted); text-decoration: none; padding: 6px 4px; min-height: 44px;
}
.mobile-quickbar a:active, .mobile-quickbar a.active { color: var(--primary); }
.mobile-quickbar a svg { width: 22px; height: 22px; }

/* Overlay for mobile sidebar */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
.sidebar-overlay.show { display: block; }

/* Landing page */
.landing-hero { text-align: center; padding: 80px 20px; max-width: 700px; margin: 0 auto; }
.landing-hero h1 { font-size: 2.5rem; margin-bottom: 16px; background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.landing-hero p { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 32px; }
.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; padding: 0 20px 60px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; text-align: center; }
.feature-card .icon { font-size: 2.5rem; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: .9rem; }

@media (max-width: 768px) {
  .landing-hero { padding: 40px 20px; }
  .landing-hero h1 { font-size: 1.8rem; }
  .landing-hero p { font-size: 1rem; }
}

/* ===== AI AGENT FLOATING CHAT ===== */
.agent-fab {
    position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px;
    border-radius: 50%; background: var(--primary); border: none; cursor: pointer;
    font-size: 1.8rem; z-index: 500; box-shadow: 0 4px 20px rgba(99,102,241,.4);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s; animation: agentPulse 3s infinite;
}
.agent-fab:hover { transform: scale(1.1); }
@keyframes agentPulse { 0%,100% { box-shadow: 0 4px 20px rgba(99,102,241,.4) } 50% { box-shadow: 0 4px 30px rgba(99,102,241,.7) } }
.agent-fab .badge-dot {
    position: absolute; top: -2px; right: -2px; width: 16px; height: 16px;
    background: var(--danger); border-radius: 50%; border: 2px solid var(--bg);
    font-size: .6rem; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
}

.agent-chat-window {
    position: fixed; bottom: 20px; right: 20px; width: 380px; max-width: calc(100vw - 40px);
    height: 520px; max-height: calc(100vh - 40px); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); z-index: 501;
    display: none; flex-direction: column; box-shadow: var(--shadow-lg);
}
.agent-chat-window.open { display: flex; }
.agent-chat-window.expanded {
    width: min(900px, calc(100vw - 30px));
    height: calc(100vh - 30px);
    max-height: calc(100vh - 30px);
    bottom: 15px; right: 15px;
}
#agentExpandBtn { font-size: 1.05rem; line-height: 1; }
.agent-chat-header {
    padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex;
    justify-content: space-between; align-items: center; background: var(--primary);
    border-radius: var(--radius) var(--radius) 0 0;
}
.agent-chat-header .agent-info { display: flex; align-items: center; gap: 8px; color: #fff; }
.agent-chat-header .agent-avatar { font-size: 1.5rem; }
.agent-chat-header .agent-name { font-weight: 700; font-size: .95rem; }
.agent-chat-header .agent-role { font-size: .72rem; opacity: .8; }
.agent-chat-header .close-btn { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; padding: 4px; }
.agent-chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.agent-chat-messages .msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: .88rem; line-height: 1.5; word-wrap: break-word; }
.agent-chat-messages .msg.agent { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.agent-chat-messages .msg.user { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.agent-chat-messages .msg .msg-role { font-size: .68rem; font-weight: 700; opacity: .6; margin-bottom: 2px; text-transform: uppercase; }
.agent-chat-messages .typing { align-self: flex-start; padding: 10px 14px; background: var(--surface-2); border-radius: 12px; font-size: .85rem; color: var(--text-muted); }
.agent-chat-messages .typing .dots span { display: inline-block; animation: dotPulse 1.4s infinite; }
.agent-chat-messages .typing .dots span:nth-child(2) { animation-delay: .2s; }
.agent-chat-messages .typing .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse { 0%,60%,100% { opacity: .3 } 30% { opacity: 1 } }
.agent-chat-input { padding: 10px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.agent-chat-input input {
    flex: 1; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 20px; color: var(--text); font-size: .88rem; font-family: inherit;
}
.agent-chat-input input:focus { outline: none; border-color: var(--primary); }
.agent-chat-input button {
    width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--primary);
    color: #fff; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.agent-chat-input button:disabled { opacity: .5; cursor: not-allowed; }

/* Agent selector tabs */
.agent-selector { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.agent-selector .agent-tab {
    display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border-radius: 8px;
    cursor: pointer; font-size: .72rem; color: var(--text-muted); min-width: 50px; transition: all .15s;
    background: none; border: none; font-family: inherit;
}
.agent-selector .agent-tab:hover { background: var(--surface-2); }
.agent-selector .agent-tab.active { background: var(--primary-light); color: var(--primary); }
.agent-selector .agent-tab .tab-avatar { font-size: 1.3rem; margin-bottom: 2px; }

@media (max-width: 480px) {
    .agent-chat-window { width: calc(100vw - 20px); right: 10px; bottom: 10px; height: calc(100vh - 20px); }
    .agent-fab { bottom: 64px; right: 10px; }
}

/* ===== CHAT SIDEBAR ===== */
.chat-sidebar {
    position: fixed; right: 0; top: var(--topbar-h); bottom: 0; width: 360px;
    background: var(--surface); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 90; transform: translateX(100%);
    transition: transform .25s ease;
}
.chat-sidebar.open { transform: translateX(0); }
.chat-sidebar-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.chat-sidebar-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.chat-sidebar-tab { padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--text-muted); background: none; border: none; font-family: inherit; }
.chat-sidebar-tab.active { background: var(--primary); color: #fff; }
.chat-sidebar-content { flex: 1; overflow-y: auto; }
.chat-channel-list { padding: 4px; }
.chat-channel-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: .88rem; color: var(--text); }
.chat-channel-item:hover { background: var(--surface-2); }
.chat-channel-item.active { background: var(--primary-light); color: var(--primary); }
.chat-channel-item .ch-icon { font-size: 1.1rem; flex-shrink: 0; }
.chat-channel-item .ch-name { font-weight: 600; }
.chat-channel-item .ch-desc { font-size: .72rem; color: var(--text-muted); }
.chat-channel-item .ch-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 6px; font-size: .68rem; font-weight: 700; }

.chat-messages-panel { display: flex; flex-direction: column; height: 100%; }
.chat-messages-panel .panel-header { padding: 10px 16px; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.chat-messages-panel .panel-body { flex: 1; overflow-y: auto; padding: 8px 12px; }
.chat-messages-panel .panel-input { padding: 10px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-messages-panel .panel-input input { flex: 1; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: .85rem; font-family: inherit; }
.chat-messages-panel .panel-input input:focus { outline: none; border-color: var(--primary); }
.chat-messages-panel .panel-input button { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--primary); color: #fff; cursor: pointer; font-size: 1rem; }

.chat-msg-item { display: flex; gap: 8px; padding: 6px 0; }
.chat-msg-item .msg-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.chat-msg-item.ai .msg-avatar { background: var(--success); }
.chat-msg-item .msg-body { flex: 1; min-width: 0; }
.chat-msg-item .msg-header { display: flex; gap: 6px; align-items: baseline; }
.chat-msg-item .msg-name { font-weight: 700; font-size: .8rem; }
.chat-msg-item .msg-time { font-size: .68rem; color: var(--text-dim); }
.chat-msg-item .msg-text { font-size: .85rem; line-height: 1.4; word-wrap: break-word; }
.chat-msg-item.ai .msg-name { color: var(--success); }
.chat-msg-item .msg-badge { display: inline-block; background: var(--success); color: #fff; font-size: .58rem; padding: 1px 4px; border-radius: 3px; vertical-align: middle; margin-left: 4px; }

.notification-bell { position: relative; cursor: pointer; background: none; border: none; color: var(--text); font-size: 1.2rem; padding: 6px; }
.notification-bell .bell-badge { position: absolute; top: 0; right: 0; width: 16px; height: 16px; background: var(--danger); border-radius: 50%; font-size: .6rem; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid var(--surface); }
.notification-dropdown { position: absolute; right: 0; top: 100%; width: 360px; max-width: calc(100vw - 20px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 200; max-height: 400px; overflow-y: auto; display: none; }
.notification-dropdown.open { display: block; }
.notification-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notification-item:hover { background: var(--surface-2); }
.notification-item.unread { background: var(--primary-light); }
.notification-item .notif-title { font-weight: 600; font-size: .85rem; }
.notification-item .notif-body { font-size: .78rem; color: var(--text-muted); }
.notification-item .notif-time { font-size: .68rem; color: var(--text-dim); }

.chat-fab { position: fixed; bottom: 20px; right: 90px; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); border: 2px solid var(--primary); cursor: pointer; font-size: 1.5rem; z-index: 499; display: flex; align-items: center; justify-content: center; color: #fff; transition: all .2s; box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.chat-fab:hover { background: var(--surface-3); transform: scale(1.05); }
.chat-fab .chat-badge { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; background: var(--danger); border-radius: 50%; font-size: .65rem; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 2px solid var(--bg); }

@media (max-width: 768px) {
    .chat-sidebar { width: 100%; }
}

/* ===== SURVEY POPUP ===== */
.survey-overlay { position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:600;display:none;align-items:center;justify-content:center;padding:16px }
.survey-overlay.open { display:flex }
.survey-modal { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);max-width:500px;width:100%;max-height:85vh;overflow-y:auto;padding:24px }
.survey-modal h2 { font-size:1.3rem;margin-bottom:4px }
.survey-modal .survey-streak-badge { display:inline-flex;align-items:center;gap:4px;background:var(--warning-light);color:var(--warning);padding:4px 10px;border-radius:20px;font-size:.78rem;font-weight:700;margin-bottom:16px }
.survey-q { margin-bottom:20px;padding:16px;background:var(--surface-2);border-radius:var(--radius-sm);border:1px solid var(--border) }
.survey-q .q-text { font-weight:600;font-size:.92rem;margin-bottom:10px }
.survey-q .q-num { font-size:.68rem;color:var(--text-dim);font-weight:700;text-transform:uppercase }
.mood-options,.mcq-options { display:flex;gap:8px;flex-wrap:wrap }
.mood-opt,.mcq-opt { padding:8px 14px;background:var(--surface-3);border:2px solid var(--border);border-radius:8px;cursor:pointer;font-size:.85rem;transition:all .15s }
.mood-opt:hover,.mcq-opt:hover { border-color:var(--primary) }
.mood-opt.selected,.mcq-opt.selected { background:var(--primary);color:#fff;border-color:var(--primary) }
.survey-slider { width:100%;height:6px;-webkit-appearance:none;background:var(--surface-3);border-radius:3px;outline:none }
.survey-slider::-webkit-slider-thumb { -webkit-appearance:none;width:20px;height:20px;border-radius:50%;background:var(--primary);cursor:pointer }

/* ===== CHEAT SHEET / QUESTS PANEL ===== */
.quests-panel { position:fixed;bottom:80px;right:20px;width:360px;max-width:calc(100vw - 40px);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);z-index:500;display:none;flex-direction:column;max-height:500px;box-shadow:var(--shadow-lg) }
.quests-panel.open { display:flex }
.quests-panel-header { padding:12px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center }
.quests-panel-body { flex:1;overflow-y:auto;padding:8px }
.quest-item { display:flex;align-items:center;gap:10px;padding:10px;border-radius:8px;margin-bottom:4px }
.quest-item.completed { background:var(--success-light) }
.quest-item .quest-icon { font-size:1.2rem;flex-shrink:0 }
.quest-item .quest-body { flex:1 }
.quest-item .quest-title { font-size:.85rem;font-weight:600 }
.quest-item .quest-desc { font-size:.72rem;color:var(--text-muted) }
.quest-item .quest-reward { font-size:.78rem;font-weight:700;color:var(--warning);white-space:nowrap }
.quest-item .quest-check { width:20px;height:20px;border-radius:50%;border:2px solid var(--border);flex-shrink:0 }
.quest-item.completed .quest-check { background:var(--success);border-color:var(--success) }
.quest-item.completed .quest-check::after { content:'✓';color:#fff;font-size:.7rem;display:flex;align-items:center;justify-content:center;height:100%;font-weight:700 }

.achievement-badge { display:inline-flex;align-items:center;gap:4px;padding:6px 10px;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;font-size:.78rem;margin:2px }

/* ===== BOT POPUP (proactive agent) ===== */
.bot-popup {
    position: fixed; bottom: 90px; right: 20px; width: 340px; max-width: calc(100vw - 40px);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    z-index: 550; display: none; flex-direction: column; max-height: 450px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4); animation: botSlideUp .3s ease;
}
.bot-popup.open { display: flex; }
@keyframes botSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.bot-popup-header {
    padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex;
    justify-content: space-between; align-items: center; border-radius: var(--radius) var(--radius) 0 0;
}
.bot-popup-header .bp-info { display: flex; align-items: center; gap: 8px; }
.bot-popup-header .bp-avatar { font-size: 1.4rem; }
.bot-popup-header .bp-name { font-weight: 700; font-size: .88rem; }
.bot-popup-header .bp-role { font-size: .68rem; color: var(--text-muted); }
.bot-popup-header .bp-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; padding: 4px; }
.bot-popup-body { flex: 1; overflow-y: auto; padding: 10px 14px; }
.bot-popup-body .bp-msg { margin-bottom: 8px; padding: 8px 12px; border-radius: 10px; font-size: .85rem; line-height: 1.4; max-width: 90%; }
.bot-popup-body .bp-msg.agent { background: var(--success-light); border: 1px solid var(--success); border-bottom-left-radius: 4px; }
.bot-popup-body .bp-msg.user { background: var(--primary); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bot-popup-body .bp-msg .bp-role-tag { font-size: .62rem; font-weight: 700; opacity: .6; text-transform: uppercase; margin-bottom: 2px; }
.bot-popup-input { padding: 8px 10px; border-top: 1px solid var(--border); display: flex; gap: 6px; }
.bot-popup-input input { flex: 1; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; color: var(--text); font-size: .82rem; font-family: inherit; }
.bot-popup-input input:focus { outline: none; border-color: var(--primary); }
.bot-popup-input button { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--primary); color: #fff; cursor: pointer; font-size: .9rem; flex-shrink: 0; }
.bot-popup-actions { padding: 6px 10px; display: flex; gap: 6px; border-top: 1px solid var(--border); }
.bot-popup-actions button { flex: 1; padding: 6px; border-radius: 6px; font-size: .78rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit; }
.bot-popup-actions .bp-respond { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== BIG FIVE PERSONALITY TEST ===== */
.b5-scale { display:flex;gap:6px;flex-wrap:wrap;margin-top:8px }
.b5-opt { padding:10px 16px;background:var(--surface-2);border:2px solid var(--border);border-radius:10px;cursor:pointer;text-align:center;transition:all .15s;min-width:60px }
.b5-opt:hover { border-color:var(--primary);background:var(--surface-3) }
.b5-opt.selected { background:var(--primary);color:#fff;border-color:var(--primary) }
.b5-opt.selected .b5-opt-letter,.b5-opt.selected .b5-opt-text { color:#fff }
.b5-opt-letter { font-weight:800;font-size:.9rem;display:block }
.b5-opt-text { font-size:.68rem;color:var(--text-muted);display:block;margin-top:2px }

/* ===== LEARNING STYLE QUIZ ===== */
.ls-option { display:flex;align-items:center;gap:8px;padding:12px 14px;background:var(--surface-2);border:2px solid var(--border);border-radius:8px;cursor:pointer;flex:1;min-width:180px;transition:all .15s;margin-bottom:6px }
.ls-option:hover { border-color:var(--primary) }
.ls-option input[type=radio] { width:18px;height:18px;accent-color:var(--primary) }
.ls-option input[type=radio]:checked + span { font-weight:600 }

/* ===== MOBILE BOTTOM NAVIGATION ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 4px 0 env(safe-area-inset-bottom, 8px);
  justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0,0,0,.1);
}
.mbn-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; text-decoration: none; color: var(--text-muted);
  font-size: .62rem; font-weight: 600; transition: color .15s;
}
.mbn-item.active { color: var(--primary); }
.mbn-icon { font-size: 1.3rem; }
.mbn-label { font-size: .58rem; }

@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .main { padding-bottom: 60px; }
  .chat-fab { display: none !important; }
  .agent-fab { bottom: 72px; right: 12px; width: 48px; height: 48px; font-size: 1.3rem; }
  .mbn-item { min-height: 44px; }
  .form-control, .form-select, input[type=text], input[type=email],
  input[type=password], input[type=tel], input[type=url],
  input[type=date], input[type=number], input[type=search],
  textarea, select { font-size: 16px !important; }
  .content, .main { overflow-x: hidden; max-width: 100vw; }
  .card { max-width: 100%; overflow: hidden; }
  table { min-width: 500px; }
  .table-wrap, .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  img { max-width: 100%; height: auto; }
  .btn { min-height: 44px; padding: 10px 14px; }
  .btn-sm { min-height: 38px; }
  a.nav-link, a.mbn-item { min-height: 44px; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.05rem; }
  h3 { font-size: .92rem; }
}

@media (max-width: 600px) {
  .pricing-popular { transform: none !important; box-shadow: none !important; }
  .table { min-width: 480px; }
  .table th { white-space: nowrap; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.4rem; }
}

.lp-tabs { display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px }
.lp-tab { padding:10px 18px;border-radius:12px;border:2px solid var(--border);background:var(--surface);color:var(--text);font-weight:700;font-size:.85rem;cursor:pointer;font-family:inherit;transition:all .15s;white-space:nowrap }
.lp-tab:hover { border-color:var(--primary);background:var(--surface-2) }
.lp-tab.active { border-color:var(--primary);background:var(--primary);color:#fff }
.lp-tab-count { font-size:.72rem;opacity:.7;margin-left:4px }
.lp-tab-content { display:none }
.lp-tab-content.active { display:block }
.lp-module-card { background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px;position:relative;transition:all .2s;overflow:hidden }
.lp-module-card:hover { border-color:var(--primary);box-shadow:0 4px 12px rgba(0,0,0,.08) }
.lp-module-card.lp-locked { opacity:.65 }
.lp-badge { display:inline-block;font-size:.68rem;font-weight:700;padding:3px 10px;border-radius:10px;text-transform:uppercase;letter-spacing:.04em }
.lp-group-header { font-size:1rem;font-weight:800;margin:20px 0 12px;padding-bottom:8px;border-bottom:2px solid var(--border);display:flex;align-items:center;gap:8px }
.lp-track-card { background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:18px;transition:all .2s;cursor:pointer }
.lp-track-card:hover { border-color:var(--primary);transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.1) }
.lp-enrolled-badge { background:#10b981;color:#fff;font-size:.7rem;font-weight:700;padding:3px 12px;border-radius:10px }
.lp-locked-badge { background:var(--surface-3);color:var(--text-muted);font-size:.7rem;font-weight:700;padding:3px 12px;border-radius:10px }
.lp-progress-mini { height:6px;background:var(--surface-3);border-radius:3px;overflow:hidden;margin:6px 0 }
.lp-progress-mini-fill { height:100%;background:var(--primary);border-radius:3px;transition:width .3s }
@media(max-width:640px) { .lp-tabs { overflow-x:auto;flex-wrap:nowrap }.lp-tab { flex-shrink:0 } }
.nav-section[data-color="home"] .nav-group-header { border-left: 3px solid #3b82f6; }
.nav-section[data-color="career"] .nav-group-header { border-left: 3px solid #10b981; }
.nav-section[data-color="practice"] .nav-group-header { border-left: 3px solid #8b5cf6; }
.nav-section[data-color="compete"] .nav-group-header { border-left: 3px solid #f59e0b; }
.nav-section[data-color="community"] .nav-group-header { border-left: 3px solid #06b6d4; }
.nav-section[data-color="account"] .nav-group-header { border-left: 3px solid #6b7280; }
.nav-section[data-color="support"] .nav-group-header { border-left: 3px solid #ef4444; }
@media (max-width:768px){.footer-grid{grid-template-columns:1fr 1fr !important;gap:20px !important}.footer-grid > div:first-child{grid-column:1/-1}}
@media (max-width:480px){.footer-grid{grid-template-columns:1fr !important}}

/* ================================================================ */
/* ===== UI/UX AUDIT UTILITY CLASSES (v10.45.0) =================== */
/* ================================================================ */

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { margin: 0; font-size: 1.4rem; line-height: 1.2; }
.page-header .page-subtitle { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.page-header .page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
@media (max-width: 768px) {
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header h1 { font-size: 1.2rem; }
  .page-header .page-actions { width: 100%; }
  .page-header .page-actions .btn { flex: 1; }
}

/* ===== BREADCRUMB ===== */
.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .breadcrumb-sep { color: var(--text-dim); font-size: .68rem; }
.breadcrumb .breadcrumb-current { color: var(--text); font-weight: 600; }

/* ===== EMPTY STATE (enhanced) ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .emoji { font-size: 3rem; margin-bottom: 12px; line-height: 1; }
.empty-state .empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state .empty-subtitle { font-size: .88rem; color: var(--text-muted); margin-bottom: 16px; max-width: 400px; margin-left: auto; margin-right: auto; }
.empty-state .empty-cta { display: inline-flex; }

/* ===== SKELETON LOADING ===== */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skeletonShimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line:last-child { margin-bottom: 0; width: 60%; }
.skeleton-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }

/* ===== FORM ERROR ===== */
.form-error { color: var(--danger); font-size: .78rem; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.form-error::before { content: '⚠'; font-size: .8rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-light); }

/* ===== BUTTON LOADING STATE ===== */
.btn.loading { pointer-events: none; opacity: .65; position: relative; }
.btn.loading::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%;
  animation: spin .6s linear infinite; margin-left: 4px;
}

/* ===== STATUS BADGE (data-status driven) ===== */
.status-badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; text-transform: capitalize; gap: 4px;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-badge[data-status="approved"], .status-badge[data-status="active"], .status-badge[data-status="completed"], .status-badge[data-status="success"], .status-badge[data-status="done"], .status-badge[data-status="enrolled"] { background: var(--success-light); color: var(--success); }
.status-badge[data-status="pending"], .status-badge[data-status="in_progress"], .status-badge[data-status="in-progress"], .status-badge[data-status="review"], .status-badge[data-status="waiting"] { background: var(--warning-light); color: var(--warning); }
.status-badge[data-status="rejected"], .status-badge[data-status="suspended"], .status-badge[data-status="failed"], .status-badge[data-status="error"], .status-badge[data-status="banned"] { background: var(--danger-light); color: var(--danger); }
.status-badge[data-status="locked"], .status-badge[data-status="inactive"], .status-badge[data-status="draft"] { background: var(--surface-3); color: var(--text-muted); }

/* ===== TABLE ACTIONS (overflow menu) ===== */
.table-actions { position: relative; white-space: nowrap; }
.table-actions-btn {
  background: none; border: 1px solid transparent; color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: 6px;
  line-height: 1; transition: all .15s;
}
.table-actions-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.table-actions-menu {
  position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); min-width: 160px; padding: 4px; display: none;
}
.table-actions-menu.open { display: block; }
.table-actions-menu a, .table-actions-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
  font-size: .82rem; color: var(--text); text-decoration: none; background: none;
  border: none; cursor: pointer; border-radius: 6px; font-family: inherit; text-align: left;
}
.table-actions-menu a:hover, .table-actions-menu button:hover { background: var(--surface-2); }
.table-actions-menu .ta-danger { color: var(--danger); }
.table-actions-menu .ta-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== SIDEBAR SEARCH ===== */
.sidebar-search-wrap { padding: 8px 12px 4px; position: relative; }
.sidebar-search {
  width: 100%; padding: 8px 12px 8px 32px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: .82rem; font-family: inherit; transition: border-color .15s;
}
.sidebar-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.sidebar-search-icon {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none; font-size: .8rem;
}
.sidebar-search-kbd {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: .6rem; color: var(--text-dim); background: var(--surface-3);
  padding: 1px 5px; border-radius: 4px; pointer-events: none;
}
.sidebar-search-no-results { padding: 16px 20px; text-align: center; font-size: .78rem; color: var(--text-muted); display: none; }
.nav-section.hidden-by-search { display: none; }
.nav-link.hidden-by-search { display: none; }

/* Server-side search results dropdown */
.sidebar-search-results {
  position: absolute; top: 100%; left: 12px; right: 12px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 400px; overflow-y: auto; z-index: 200; display: none;
}
.sidebar-search-results.open { display: block; }
.sidebar-search-results .ssr-loading { padding: 16px; text-align: center; font-size: .78rem; color: var(--text-muted); }
.sidebar-search-results .ssr-group-header { padding: 6px 12px; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); font-weight: 700; background: var(--surface-2); }
.sidebar-search-results .ssr-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-decoration: none; color: var(--text); font-size: .82rem; border-bottom: 1px solid var(--border); }
.sidebar-search-results .ssr-item:last-child { border-bottom: none; }
.sidebar-search-results .ssr-item:hover { background: var(--surface-2); }
.sidebar-search-results .ssr-icon { font-size: 1rem; flex-shrink: 0; }
.sidebar-search-results .ssr-body { flex: 1; min-width: 0; }
.sidebar-search-results .ssr-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-search-results .ssr-sub { font-size: .68rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== TOAST CONTAINER ===== */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 10001; display: flex; flex-direction: column; gap: 8px; max-width: 380px; pointer-events: none; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; animation: toastSlideIn .3s ease;
  pointer-events: auto; max-width: 380px;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }
.toast .toast-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.2; }
.toast .toast-body { flex: 1; min-width: 0; }
.toast .toast-title { font-weight: 700; margin-bottom: 2px; }
.toast .toast-msg { color: var(--text-muted); font-size: .82rem; }
.toast .toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0 4px; flex-shrink: 0; line-height: 1.2; }
.toast.removing { animation: toastSlideOut .3s ease forwards; }
@keyframes toastSlideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastSlideOut { to { transform: translateX(120%); opacity: 0; } }
@media (max-width: 480px) {
  .toast-container { left: 8px; right: 8px; top: 8px; max-width: none; }
  .toast { max-width: none; }
}

/* ===== TOPBAR CONTEXT PILL (admin↔teacher) ===== */
.topbar-context-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning);
  border-radius: 20px; font-size: .75rem; font-weight: 700; text-decoration: none;
}
.topbar-context-pill:hover { background: var(--warning); color: #000; text-decoration: none; }
.topbar-context-pill .tcp-close { font-size: .9rem; line-height: 1; }

/* ===== SCROLL HINT (horizontal scroll affordance) ===== */
.scroll-hint {
  font-size: .68rem; color: var(--text-muted); font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ===== RESPONSIVE TWEAKS FOR NEW UTILITIES ===== */
@media (max-width: 768px) {
  .sidebar-search-kbd { display: none; }
  .table-actions-menu { position: fixed; right: 8px; left: 8px; width: auto; }
}
