/* ═══════════════════════════════════════════════════════════
   PULSE ENGINEERING HUB — MAIN STYLESHEET
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Exo+2:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────────────── */
:root {
  --bg-base:        #0a0b0f;
  --bg-surface:     #0f1117;
  --bg-card:        #13161e;
  --bg-card-hover:  #181c26;
  --bg-elevated:    #1a1f2e;

  --border:         rgba(255,255,255,0.06);
  --border-accent:  rgba(0,163,255,0.25);

  --text-primary:   #e8eaf0;
  --text-secondary: #7a8099;
  --text-muted:     #4a5068;
  --text-accent:    #00a3ff;

  --accent-blue:    #00a3ff;
  --accent-blue-dim:#0066aa;
  --accent-orange:  #ff6b1a;
  --accent-green:   #00d084;
  --accent-cyan:    #00e5ff;
  --accent-red:     #ff3b5c;

  --glow-blue:      0 0 20px rgba(0,163,255,0.15);
  --glow-orange:    0 0 20px rgba(255,107,26,0.15);

  --sidebar-width:  220px;
  --topbar-height:  56px;

  --font-display:   'Rajdhani', sans-serif;
  --font-body:      'Exo 2', sans-serif;
  --font-mono:      'Share Tech Mono', monospace;

  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      12px;

  --transition:     all 0.2s ease;
}

/* ─── RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ─── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue-dim); }

/* ─── LAYOUT ────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ─── SIDEBAR ───────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 3px;
  line-height: 1;
}

.sidebar-logo .logo-sub {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.nav-item.active {
  color: var(--accent-blue);
  background: rgba(0,163,255,0.06);
  border-left-color: var(--accent-blue);
}

.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-status {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 2px;
}

.brand-sub {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ─── MAIN AREA ─────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── TOPBAR ────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 12px 7px 34px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.topbar-search input:focus {
  border-color: var(--border-accent);
  background: var(--bg-elevated);
}

.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.topbar-spacer { flex: 1; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  transition: var(--transition);
}

.topbar-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: var(--bg-elevated);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.topbar-user:hover { border-color: var(--border-accent); }

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.user-label { font-size: 12px; color: var(--text-secondary); }

/* ─── PAGE CONTENT ──────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

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

/* ─── PAGE HEADER ───────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  line-height: 1;
}

.page-header h1 span { color: var(--accent-blue); }

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.card-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title a {
  font-size: 11px;
  color: var(--accent-blue);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.card-title a:hover { text-decoration: underline; }

/* ─── STAT BOXES ────────────────────────────────────────── */
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.stat-box .stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1;
}

.stat-box .stat-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── GRID LAYOUTS ──────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-dash { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.grid-dash-main { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }

/* ─── PROJECT CARDS ─────────────────────────────────────── */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--glow-blue);
}

.project-card-img {
  height: 110px;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-img-placeholder {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 2px;
  opacity: 0.4;
}

.project-card-body { padding: 14px; }

.project-card-body h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.project-card-body .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.project-card-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── PROGRESS BAR ──────────────────────────────────────── */
.progress-wrap { margin-top: 10px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.progress-bar {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transition: width 0.6s ease;
}

/* ─── STATUS BADGES ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-blue    { background: rgba(0,163,255,0.12); color: var(--accent-blue); border: 1px solid rgba(0,163,255,0.2); }
.badge-orange  { background: rgba(255,107,26,0.12); color: var(--accent-orange); border: 1px solid rgba(255,107,26,0.2); }
.badge-green   { background: rgba(0,208,132,0.12); color: var(--accent-green); border: 1px solid rgba(0,208,132,0.2); }
.badge-cyan    { background: rgba(0,229,255,0.12); color: var(--accent-cyan); border: 1px solid rgba(0,229,255,0.2); }
.badge-red     { background: rgba(255,59,92,0.12); color: var(--accent-red); border: 1px solid rgba(255,59,92,0.2); }
.badge-muted   { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

/* ─── TECH CARDS ────────────────────────────────────────── */
.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
  cursor: pointer;
}

.tech-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.tech-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tech-acronym {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}

.tech-fullname {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.tech-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* ─── UPDATE LIST ───────────────────────────────────────── */
.update-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.update-item:last-child { border-bottom: none; }

.update-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.update-dot.design   { background: var(--accent-blue); }
.update-dot.test     { background: var(--accent-orange); }
.update-dot.research { background: var(--accent-green); }
.update-dot.idea     { background: var(--accent-cyan); }

.update-text { flex: 1; font-size: 12px; color: var(--text-primary); }
.update-time { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }

/* ─── ROADMAP ───────────────────────────────────────────── */
.roadmap-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}

.roadmap-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 24px;
  bottom: -10px;
  width: 1px;
  background: var(--border);
}

.roadmap-dot {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
  margin-top: 1px;
}

.roadmap-dot.active { border-color: var(--accent-blue); background: rgba(0,163,255,0.15); box-shadow: 0 0 8px rgba(0,163,255,0.3); }
.roadmap-dot.upcoming { border-color: var(--accent-orange); }
.roadmap-dot.future { border-color: var(--text-muted); }

.roadmap-year {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 1px;
  line-height: 1.2;
}

.roadmap-phase { font-size: 12px; color: var(--text-secondary); }

/* ─── DEVELOPMENT STATUS STEPS ──────────────────────────── */
.dev-status-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 0;
}

.dev-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.dev-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.dev-step.done:not(:last-child)::after { background: var(--accent-blue); }

.dev-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: var(--bg-card);
  z-index: 1;
  transition: var(--transition);
}

.dev-step.done .dev-dot   { border-color: var(--accent-blue); background: var(--accent-blue); }
.dev-step.active .dev-dot { border-color: var(--accent-orange); background: rgba(255,107,26,0.2); box-shadow: 0 0 8px rgba(255,107,26,0.4); }

.dev-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

.dev-step.done .dev-label   { color: var(--accent-blue); }
.dev-step.active .dev-label { color: var(--accent-orange); }

/* ─── IDEA VAULT DONUT ──────────────────────────────────── */
.vault-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.vault-donut-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.vault-donut-wrap .donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center .donut-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.donut-center .donut-sub {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.vault-legend { flex: 1; }

.vault-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.vault-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.vault-legend-count {
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* ─── FORM ELEMENTS ─────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-accent);
  background: var(--bg-card);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5068' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-primary:hover { background: #0090e0; box-shadow: 0 0 16px rgba(0,163,255,0.3); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: rgba(0,163,255,0.05);
}

.btn-danger { background: rgba(255,59,92,0.1); color: var(--accent-red); border: 1px solid rgba(255,59,92,0.2); }
.btn-danger:hover { background: rgba(255,59,92,0.2); }

.btn-sm { padding: 5px 10px; font-size: 11px; }

/* ─── TABLE ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td {
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
}

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); border-color: var(--border-accent); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ─── SECTION SPACING ───────────────────────────────────── */
.section { margin-bottom: 24px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* ─── RESEARCH CARDS ────────────────────────────────────── */
.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--transition);
  cursor: pointer;
}

.research-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.research-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.research-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

.research-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* ─── PROTOTYPE CARDS ───────────────────────────────────── */
.proto-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.proto-metric:last-child { border-bottom: none; }
.proto-metric-key { color: var(--text-muted); }
.proto-metric-val { color: var(--accent-blue); font-family: var(--font-mono); }

/* ─── NOTIFICATION DOT ──────────────────────────────────── */
.notif-badge {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── DIVIDER ───────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── TOAST ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  animation: toastIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success { border-color: rgba(0,208,132,0.4); }
.toast.error   { border-color: rgba(255,59,92,0.4); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-dash { grid-template-columns: 1fr; }
}

@media (max-width: 750px) {
  :root { --sidebar-width: 0px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── SEARCH DROPDOWN ───────────────────────────────────── */
.topbar-search { position: relative; }

#search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  z-index: 999;
  overflow: hidden;
  min-width: 360px;
}

#search-dropdown.open { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-elevated); }

.search-result-icon { font-size: 18px; width: 24px; text-align: center; }

.search-result-title { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.search-result-sub   { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ─── IMAGE UPLOAD OVERLAY ──────────────────────────────── */
.img-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  font-size: 12px;
  color: white;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.project-card-img:hover .img-upload-overlay { opacity: 1; }

/* ─── ROADMAP PHASES ────────────────────────────────────── */
.roadmap-phase-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition);
}

.roadmap-phase-block:hover { border-color: var(--border-accent); }

.roadmap-phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  gap: 12px;
}

.roadmap-phase-body {
  padding: 0 18px 16px;
  border-top: 1px solid var(--border);
}

.roadmap-tasks { margin-top: 12px; }

.roadmap-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.roadmap-task-item:last-child { border-bottom: none; }

.roadmap-task-item:hover > button { opacity: 1 !important; }

.task-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.roadmap-add-task {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.roadmap-add-task .form-control { flex: 1; }

/* ─── DRIVE PAGE ────────────────────────────────────────── */
.drive-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 120px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.drive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#drive-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: white;
}

/* ─── FILE MANAGER ──────────────────────────────────────── */
.fm-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 130px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.fm-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}

.fm-breadcrumb-item {
  cursor: pointer;
  color: var(--accent-blue);
  white-space: nowrap;
}

.fm-breadcrumb-item:hover { text-decoration: underline; }
.fm-breadcrumb-sep { color: var(--text-muted); }
.fm-breadcrumb-current { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fm-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.fm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  padding: 8px;
}

.fm-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
}

.fm-item-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-align: center;
  position: relative;
}

.fm-item-grid:hover {
  background: var(--bg-elevated);
  border-color: var(--border-accent);
}

.fm-item-grid.selected {
  background: rgba(0,163,255,0.08);
  border-color: var(--accent-blue);
}

.fm-item-list {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.fm-item-list:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
}

.fm-item-list.selected {
  background: rgba(0,163,255,0.08);
  border-color: var(--accent-blue);
}

.fm-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.fm-icon-sm { font-size: 20px; flex-shrink: 0; }

.fm-item-name {
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.3;
}

.fm-item-name-list {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-item-meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.fm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  gap: 10px;
}

.fm-empty .empty-icon { font-size: 40px; opacity: 0.3; }

.fm-status {
  padding: 8px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.fm-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  transition: var(--transition);
  cursor: pointer;
  margin: 8px;
}

.fm-upload-zone:hover, .fm-upload-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(0,163,255,0.04);
  color: var(--accent-blue);
}

.fm-preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.fm-preview-modal.open { display: flex; }

.fm-preview-modal img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.fm-preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  gap: 10px;
  font-size: 13px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.fm-progress-bar {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
  flex: 1;
}

.fm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transition: width 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS & TRANSITIONS UPDATE
   ═══════════════════════════════════════════════════════════ */

/* ─── PAGE TRANSITIONS ──────────────────────────────────── */
.page {
  animation: pageSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ─── STAGGERED CARD ANIMATIONS ─────────────────────────── */
.project-card {
  animation: cardFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.10s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.20s; }

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tech-card {
  animation: cardFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.tech-card:nth-child(1) { animation-delay: 0.05s; }
.tech-card:nth-child(2) { animation-delay: 0.10s; }
.tech-card:nth-child(3) { animation-delay: 0.15s; }
.tech-card:nth-child(4) { animation-delay: 0.20s; }

/* ─── STAT BOX COUNTER ANIMATION ────────────────────────── */
.stat-box {
  animation: statPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.stat-box:nth-child(1) { animation-delay: 0.1s; }
.stat-box:nth-child(2) { animation-delay: 0.2s; }
.stat-box:nth-child(3) { animation-delay: 0.3s; }

@keyframes statPop {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── NAV ITEM HOVER GLOW ────────────────────────────────── */
.nav-item {
  position: relative;
  overflow: hidden;
}

.nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,163,255,0.08), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-item:hover::after { opacity: 1; }
.nav-item.active::after { opacity: 1; }

/* ─── SIDEBAR GLOW LINE ──────────────────────────────────── */
#sidebar {
  background: linear-gradient(180deg, var(--bg-surface) 0%, #0d1020 100%);
}

.sidebar-logo {
  position: relative;
}

.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,163,255,0.4), transparent);
}

/* ─── TOPBAR BLUR ────────────────────────────────────────── */
#topbar {
  backdrop-filter: blur(12px);
  background: rgba(15, 17, 23, 0.85);
}

/* ─── CARD HOVER LIFT ────────────────────────────────────── */
.card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ─── BUTTON PULSE ON CLICK ──────────────────────────────── */
.btn:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover::after { opacity: 1; }

/* ─── PROGRESS BAR ANIMATION ─────────────────────────────── */
.progress-fill {
  animation: progressGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes progressGrow {
  from { width: 0% !important; }
}

/* ─── UPDATE ITEM SLIDE IN ───────────────────────────────── */
.update-item {
  animation: slideInRight 0.3s ease both;
}

.update-item:nth-child(1) { animation-delay: 0.05s; }
.update-item:nth-child(2) { animation-delay: 0.10s; }
.update-item:nth-child(3) { animation-delay: 0.15s; }
.update-item:nth-child(4) { animation-delay: 0.20s; }
.update-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── ROADMAP PHASE SLIDE ────────────────────────────────── */
.roadmap-phase-block {
  animation: cardFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ─── MODAL BACKDROP BLUR ────────────────────────────────── */
.modal-backdrop {
  backdrop-filter: blur(8px);
  transition: opacity 0.2s ease;
}

/* ─── TOAST IMPROVED ─────────────────────────────────────── */
.toast {
  animation: toastSlide 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(30px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE & RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ─── MOBILE OVERLAY ─────────────────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
}

#sidebar-overlay.open { display: block; }

/* ─── MOBILE TOGGLE BUTTON ───────────────────────────────── */
#mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── DASHBOARD IMPROVED LAYOUT ──────────────────────────── */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-box:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--glow-blue);
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.stat-box::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,163,255,0.08), transparent);
}

.stat-box.orange::before { background: linear-gradient(90deg, transparent, var(--accent-orange), transparent); }
.stat-box.orange::after  { background: radial-gradient(circle, rgba(255,107,26,0.08), transparent); }
.stat-box.orange .stat-value { color: var(--accent-orange); }

.stat-box.cyan::before { background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent); }
.stat-box.cyan::after  { background: radial-gradient(circle, rgba(0,229,255,0.08), transparent); }
.stat-box.cyan .stat-value { color: var(--accent-cyan); }

/* ─── IMPROVED PAGE HEADER ───────────────────────────────── */
.page-header {
  position: relative;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), transparent);
}

/* ─── IMPROVED SECTION TITLES ────────────────────────────── */
.section-title {
  position: relative;
  padding-left: 10px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 12px;
  background: var(--accent-blue);
  border-radius: 2px;
}

/* ─── RESPONSIVE BREAKPOINTS ─────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-width: 220px; }

  #mobile-menu-btn { display: flex; }

  #sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }

  #content { padding: 16px; }

  .dash-stats-row { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .grid-dash { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .dash-stats-row { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .topbar-user .user-label { display: none; }

  #content { padding: 12px; }

  .page-header h1 { font-size: 20px; }

  .stat-box .stat-value { font-size: 28px; }

  .fm-toolbar { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg-base:        #f0f2f7;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f5f7fc;
  --bg-elevated:    #eef0f8;
  --border:         rgba(0,0,0,0.08);
  --border-accent:  rgba(0,122,204,0.3);
  --text-primary:   #1a1d2e;
  --text-secondary: #4a5068;
  --text-muted:     #9098b0;
  --accent-blue:    #007acc;
  --accent-blue-dim:#005fa3;
}

[data-theme="light"] #sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fc 100%);
  border-right-color: rgba(0,0,0,0.08);
}

[data-theme="light"] #topbar {
  background: rgba(255,255,255,0.9);
  border-bottom-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .stat-box {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════════════════
   NOTIFICATIONS PANEL
   ═══════════════════════════════════════════════════════════ */
#notif-panel {
  display: none;
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 80px;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  z-index: 500;
  overflow: hidden;
  animation: panelDrop 0.25s cubic-bezier(0.16,1,0.3,1);
}

#notif-panel.open { display: block; }

@keyframes panelDrop {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-elevated); }

.notif-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notif-title { font-size: 12px; color: var(--text-primary); line-height: 1.4; }
.notif-time  { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════════
   USER MENU
   ═══════════════════════════════════════════════════════════ */
#user-menu {
  display: none;
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 16px;
  width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  z-index: 500;
  overflow: hidden;
  animation: panelDrop 0.25s cubic-bezier(0.16,1,0.3,1);
}

#user-menu.open { display: block; }

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.user-menu-item:last-child { border-bottom: none; }
.user-menu-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.user-menu-item.danger { color: var(--accent-red); }
.user-menu-item.danger:hover { background: rgba(255,59,92,0.08); }

/* ─── FIX: Panels position ──────────────────────────────── */
#notif-panel {
  top: auto !important;
  bottom: calc(100vh - var(--topbar-height) + 8px) !important;
}

#user-menu {
  top: auto !important;
  bottom: calc(100vh - var(--topbar-height) + 8px) !important;
}

/* ─── FIX: Topbar & Panel Z-Index ───────────────────────── */
#topbar {
  position: relative;
  z-index: 200;
}

#notif-panel,
#user-menu {
  top: calc(var(--topbar-height) + 8px) !important;
  bottom: auto !important;
  z-index: 999 !important;
}
