/* Top navigation bar: location, search, running timer, theme, notifications and the profile menu. */
.topbar { display: flex; align-items: center; gap: 18px; height: 64px; min-height: 64px; padding: 0 24px 0 28px; position: relative; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }

/* Where am I */
.nb-where { display: flex; align-items: center; gap: 12px; min-width: 0; flex: none; }
.nb-page-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--accent); background: var(--soft); border: 1px solid var(--line); flex: none; }
.nb-where div { display: grid; min-width: 0; }
.nb-where small { font-size: 11px; color: var(--muted); font-weight: 600; }
.nb-where small a { color: inherit; text-decoration: none; }
.nb-where small a:hover { color: var(--accent); }
.nb-where strong { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; letter-spacing: -.2px; }

/* Search + timer */
.nb-center { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; }
.nb-search { display: flex; align-items: center; gap: 10px; width: min(420px, 100%); height: 40px; padding: 0 8px 0 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface2); color: var(--muted); font: inherit; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.nb-search span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-search kbd { font-size: 11px; font-family: inherit; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.nb-search:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.nb-timer { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 12px; border-radius: 12px; max-width: 340px; min-width: 0;
  background: color-mix(in srgb, #2fb380 12%, var(--surface)); border: 1px solid color-mix(in srgb, #2fb380 35%, var(--line)); }
.nb-timer-pulse { width: 9px; height: 9px; border-radius: 50%; background: #2fb380; box-shadow: 0 0 0 0 rgba(47, 179, 128, .6); animation: nb-pulse 1.6s infinite; flex: none; }
.nb-timer div { display: grid; min-width: 0; }
.nb-timer strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.nb-timer small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-timer b { font-variant-numeric: tabular-nums; font-size: 13px; color: #1b8a5f; }
:root[data-theme=dark] .nb-timer b { color: #6fdcae; }
.nb-timer button { width: 28px; height: 28px; border-radius: 8px; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; background: #2fb380; flex: none; }
.nb-timer button:hover { background: #1b8a5f; }

/* Right side */
.nb-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.nb-divider { width: 1px; height: 26px; background: var(--line); margin: 0 6px; }
.nb-icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.nb-icon-btn:hover, .nb-icon-btn.open { background: var(--surface2); color: var(--ink); border-color: var(--line); }
.nb-badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-style: normal; font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
  color: #fff; background: #ef5b5b; border: 2px solid var(--surface); }
.nb-menu-host { position: relative; }
.nb-profile { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 4px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.nb-profile:hover, .nb-profile.open { background: var(--surface2); border-color: var(--line); }
.nb-profile > svg { color: var(--muted); transition: transform .18s; }
.nb-profile.open > svg { transform: rotate(180deg); }
.nb-avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #3976d8, #214fa6); flex: none; }
.nb-avatar.large { width: 46px; height: 46px; border-radius: 14px; font-size: 16px; }
.nb-who { display: grid; text-align: left; line-height: 1.2; }
.nb-who strong { font-size: 13px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-who small { font-size: 11px; color: var(--muted); }

/* Dropdown panels */
.nb-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(6, 12, 30, .25), 0 6px 16px rgba(6, 12, 30, .1); animation: nb-drop .16s ease-out both; transform-origin: top right; }
.nb-notifications { width: 380px; }
.nb-notifications header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.nb-notifications header strong { font-size: 14px; }
.nb-link { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.nb-link:hover { background: var(--soft); }
.nb-list { max-height: 420px; overflow: auto; padding: 6px; }
.nb-notice { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.nb-notice:hover { background: var(--surface2); }
.nb-notice.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.nb-notice-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--accent); background: var(--soft); }
.nb-notice-icon.assignment { color: #1b8a5f; background: color-mix(in srgb, #2fb380 15%, var(--surface)); }
.nb-notice-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.nb-notice-text strong { font-size: 13px; }
.nb-notice-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb-notice-text time { font-size: 11px; color: var(--muted); opacity: .85; }
.nb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.nb-empty { display: grid; justify-items: center; gap: 6px; padding: 30px 20px; text-align: center; color: var(--muted); }
.nb-empty strong { color: var(--ink); font-size: 13px; }
.nb-empty small { font-size: 12px; max-width: 260px; }

.nb-profile-menu { width: 280px; padding: 6px; }
.nb-profile-head { display: flex; align-items: center; gap: 12px; padding: 12px 10px 14px; }
.nb-profile-head div { display: grid; min-width: 0; gap: 2px; }
.nb-profile-head strong { font-size: 14px; }
.nb-profile-head small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-profile-head em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--soft); padding: 2px 8px; border-radius: 999px; justify-self: start; margin-top: 3px; }
.nb-menu-group { display: grid; gap: 2px; padding: 6px 0; border-top: 1px solid var(--line); }
.nb-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.nb-menu-item svg { color: var(--muted); }
.nb-menu-item span { flex: 1; }
.nb-menu-item kbd { font-family: inherit; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.nb-menu-item:hover { background: var(--surface2); }
.nb-menu-item:hover svg { color: var(--accent); }
.nb-menu-item.danger, .nb-menu-item.danger svg { color: #d84a4a; }
.nb-menu-item.danger:hover { background: rgba(216, 74, 74, .1); }

/* The sidebar no longer has a user block */
.sidebar-bottom:empty { display: none; }

@media (max-width: 1180px) { .nb-who { display: none; } .nb-search span { display: none; } .nb-search { width: 40px; padding: 0; justify-content: center; } .nb-search kbd { display: none; } }
@media (max-width: 860px) { .nb-where small { display: none; } .nb-timer div { display: none; } }

@keyframes nb-drop { from { opacity: 0; transform: translateY(-6px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes nb-pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 179, 128, .55) } 70% { box-shadow: 0 0 0 8px rgba(47, 179, 128, 0) } 100% { box-shadow: 0 0 0 0 rgba(47, 179, 128, 0) } }

/* No desktop title bar on the web: the shell fills the window. The sidebar heads with the brand and its own
   hamburger toggle; collapsed it becomes an icon rail. Under 900px it slides over the page instead. */
.window-titlebar { display: none; }
.app-shell { height: 100vh; position: relative; }
.login-screen { min-height: 100vh; }
.sidebar { padding-top: 0; border-right: 0; transition: width .2s ease; overflow-x: hidden; }
.sb-brand { display: flex; align-items: center; gap: 8px; height: 64px; margin: 0 -12px 10px; padding: 0 12px 0 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sb-logo { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; text-decoration: none; color: #fff; }
.sb-logo img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); flex: none; }
.sb-logo strong { font-size: 16px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.sb-logo strong span { color: #8fb4ff; }
.sb-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: #a9b8d6; display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s, color .15s; }
.sb-toggle:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .1); }
.nav-item span, .nav-label { white-space: nowrap; }

/* Navbar: just the page name (the hamburger there is only for narrow screens) */
.nb-where strong { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.nb-where strong a { color: var(--muted); text-decoration: none; font-weight: 700; }
.nb-where strong a:hover { color: var(--accent); }
.nb-where strong svg { color: var(--muted); }
.nb-hamburger { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.nb-mobile-only { display: none; }

/* Collapsed: icon rail (wide screens only; the off-canvas menu is always full width) */
@media (min-width: 901px) {
.app-shell.sb-collapsed .sidebar { width: 76px; }
.app-shell.sb-collapsed .sb-brand { padding: 0; margin: 0 -12px 10px; justify-content: center; }
.app-shell.sb-collapsed .sb-logo, .app-shell.sb-collapsed .nav-label, .app-shell.sb-collapsed .nav-item span, .app-shell.sb-collapsed .nav-item em { display: none; }
.app-shell.sb-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; position: relative; }
.app-shell.sb-collapsed .nav-item:hover { transform: none; }
.app-shell.sb-collapsed nav { margin-top: 14px; }
}

/* Narrow screens: off-canvas menu */
.sb-scrim { display: none; }
@media (max-width: 900px) {
  .nb-mobile-only { display: grid; }
  .app-shell .sidebar, .app-shell.sb-collapsed .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 80; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(0, 0, 0, .35); }
  .app-shell.sb-open .sidebar { transform: none; }
  .app-shell.sb-open .sb-scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(8, 14, 28, .5); backdrop-filter: blur(3px); }
  .sb-toggle { display: none; }
}

/* Collapsed rail shows the logo; hovering it reveals the expand icon. */
.sb-rail-icon { display: none; }
@media (min-width: 901px) {
  .app-shell.sb-collapsed .sb-toggle { width: 44px; height: 44px; position: relative; }
  .sb-rail-logo { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); transition: opacity .15s; }
  .app-shell.sb-collapsed .sb-toggle:hover .sb-rail-logo, .app-shell.sb-collapsed .sb-toggle:focus-visible .sb-rail-logo { opacity: 0; }
  .app-shell.sb-collapsed .sb-toggle:hover .sb-rail-icon, .app-shell.sb-collapsed .sb-toggle:focus-visible .sb-rail-icon { display: block; position: absolute; }
}
