/* ============================================================
   CaseCommand — Sidebar & Topbar
   ============================================================ */

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s;
  position: relative;
  z-index: 100;
}

/* Logo */
.sidebar-logo {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo .wordmark {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo .wordmark svg { width: 16px; height: 16px; }
.sidebar-logo .tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text4);
  letter-spacing: .18em;
  margin-top: 3px;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 6px;
}
.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text4);
  padding: 10px 18px 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-size: 12.5px;
  color: var(--text3);
  cursor: pointer;
  transition: all .12s;
  border-left: 2px solid transparent;
  position: relative;
}
.nav-item:hover {
  background: var(--gold-dim3);
  color: var(--text2);
}
.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold);
  border-left-color: var(--gold);
}
.nav-item .nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.nav-item .nav-label { flex: 1; }
.nav-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  background: rgba(224,80,80,.2);
  color: var(--red);
}
.nav-badge.nb-gold {
  background: var(--gold-dim);
  color: var(--gold);
}
.nav-badge.nb-blue {
  background: var(--blu-dim);
  color: var(--blue);
}

/* Divider */
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 14px;
}

/* User area */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background .12s;
  flex-shrink: 0;
}
.sidebar-user:hover { background: var(--gold-dim3); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text3); font-family: 'IBM Plex Mono', monospace; }
.user-menu-btn { color: var(--text4); font-size: 12px; transition: color .12s; }
.sidebar-user:hover .user-menu-btn { color: var(--text2); }

/* Online indicator */
.online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  border: 1.5px solid var(--surface);
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.topbar-crumb-root {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
}
.topbar-crumb-sep { color: var(--text4); font-size: 12px; }
.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Global search */
.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 11px;
  height: 33px;
  transition: border-color .15s, box-shadow .15s;
}
.global-search:focus-within {
  border-color: var(--border3);
  box-shadow: 0 0 0 2px var(--gold-dim);
}
.global-search .gs-icon { color: var(--text3); font-size: 12px; flex-shrink: 0; }
.global-search input {
  background: none; border: none; outline: none;
  font-size: 12px; color: var(--text); width: 210px;
}
.global-search input::placeholder { color: var(--text3); }
.global-search kbd {
  font-family: 'IBM Plex Mono', monospace; font-size: 9px;
  color: var(--text4); background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 3px; padding: 1px 4px;
}

/* Topbar icon buttons */
.topbar-icon-btn {
  position: relative;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 14px;
  cursor: pointer; transition: all .15s;
}
.topbar-icon-btn:hover { background: var(--surface2); color: var(--text2); border-color: var(--border2); }
.topbar-icon-btn .tb-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 8px; font-family: 'IBM Plex Mono', monospace;
  width: 14px; height: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bg);
}
