:root {
  --bn-sidebar-bg: #18181b;
  --bn-accent: #818cf8;
  --bn-accent-strong: #6366f1;
}

body { background: #f0f2f5; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }

/* ─── Sidebar ─── */
.sidebar {
  width: 220px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--bn-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .18s ease;
}
.sb-brand {
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
}
.sb-brand-name { font-weight: 700; font-size: 1.05rem; color: #fff; letter-spacing: -.01em; }
.sb-brand-tag  { font-size: .68rem; color: #52525b; margin-top: 1px; }
.sb-toggle-btn {
  background: none; border: none; color: #52525b; cursor: pointer;
  padding: 3px 5px; border-radius: 4px; font-size: .9rem;
  margin-left: auto; line-height: 1; display: flex; align-items: center;
}
.sb-toggle-btn:hover { color: #a1a1aa; background: rgba(255,255,255,.08); }

.sb-nav  { flex: 1; padding: 8px 0 12px; }
.sb-sect {
  padding: 14px 16px 3px;
  font-size: .66rem; color: #3f3f46; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  white-space: nowrap; overflow: hidden;
}
.sb-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; color: #a1a1aa; text-decoration: none; font-size: .84rem;
  transition: background .1s, color .1s; white-space: nowrap; overflow: hidden;
}
.sb-link:hover  { color: #fff; background: rgba(255,255,255,.06); }
.sb-link.active {
  color: #fff; background: rgba(255,255,255,.09);
  border-left: 2px solid var(--bn-accent); padding-left: 14px;
}
.sb-link i { font-size: .9rem; width: 16px; flex-shrink: 0; }
.sb-text { transition: opacity .15s; }

.sb-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.sb-user   { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; }
.sb-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #27272a; color: #71717a;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0;
}
.sb-uname {
  font-size: .8rem; color: #d4d4d8; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ─── Collapsed state ─── */
body.sb-collapsed .sidebar { width: 56px; }
body.sb-collapsed .main-area { margin-left: 56px; }
body.sb-collapsed .sb-brand { padding: 14px 0; justify-content: center; gap: 0; }
body.sb-collapsed .sb-brand-name, body.sb-collapsed .sb-brand-tag { display: none; }
body.sb-collapsed .sb-sect { padding: 10px 0 2px; visibility: hidden; height: 6px; }
body.sb-collapsed .sb-link { justify-content: center; padding: 10px 0; gap: 0; }
body.sb-collapsed .sb-link.active { padding-left: 0; border-left: 2px solid var(--bn-accent); }
body.sb-collapsed .sb-link i { font-size: 1.25rem; width: auto; }
body.sb-collapsed .sb-text { display: none; }
body.sb-collapsed .sb-footer { padding: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
body.sb-collapsed .sb-user { margin-bottom: 0; justify-content: center; }
body.sb-collapsed .sb-uname { display: none; }
body.sb-collapsed .sb-sign-out-text { display: none; }

/* ─── Main area / page header ─── */
.main-area { margin-left: 220px; min-height: 100vh; transition: margin-left .18s ease; }
.page-hdr {
  background: #fff; border-bottom: 1px solid #e9ecef;
  padding: 14px 24px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 100;
}
.page-hdr-title { font-size: .95rem; font-weight: 700; color: #343a40; margin: 0; }
.page-content { padding: 24px; max-width: 1100px; }

/* ─── Shared components ─── */
.section-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: #6c757d; font-weight: 600; margin-bottom: 12px;
}
.bn-card {
  background: #fff; border-radius: 10px; border: 1px solid #e9ecef;
  margin-bottom: 16px; padding: 20px 24px;
}
.badge-active   { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; }
.badge-inactive { background: #fee2e2; color: #991b1b; padding: 2px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; }

.muted { color: #6c757d; font-size: .85em; }

.table > :not(caption) > * > * { padding: .55rem .75rem; }

.bn-data-table td {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
}
.bn-data-table td:hover { white-space: normal; word-break: break-word; }

.badge-log-warning { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; }
.badge-log-error   { background: #fee2e2; color: #991b1b; padding: 2px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; }
.badge-log-fatal   { background: #450a0a; color: #fff;     padding: 2px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; }
.log-exception {
  font-size: .75rem; background: #f8f9fa; padding: 8px; border-radius: 6px;
  white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto;
}

/* ─── Unauthenticated pages (login/verify) ─── */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
