:root {
  --bg: #191f26;
  --panel: #111827;
  --panel2: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(255,255,255,0.10);
  --accent: #22c55e;
  --accent2: #60a5fa;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg), #191f26);
  color: var(--text);
}

.nbx-landing-bg {
  background-color: #0B1123;
  background-image: linear-gradient(180deg, #192E43 0px, #192E43 100px, #0B1123 100%);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 100vh;
  background-attachment: fixed;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.nbx-container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.nbx-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nbx-brand { display: flex; align-items: center; gap: 12px; }
.nbx-logo { display: flex; align-items: center; justify-content: center; }
.nbx-logo img { display: block; height: 56px; width: auto; }
.nbx-title { font-weight: 700; font-size: 18px; }
.nbx-subtitle { color: var(--muted); font-size: 12px; }
.nbx-topnav { display: flex; gap: 10px; }

.nbx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(96,165,250,0.18);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.nbx-btn:disabled, .nbx-btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: none; }
.nbx-btn:hover { filter: brightness(1.1); text-decoration: none; }
.nbx-btn-secondary { background: rgba(255,255,255,0.06); }
.nbx-btn-primary { background: rgba(96,165,250,1); border-color: rgba(147,197,253,0.85); color: #0b1220; }
.nbx-btn-primary:hover { filter: brightness(1.05); }
.nbx-btn-danger { background: rgba(239,68,68,0.10); border-color: rgba(248,113,113,0.35); color: #fecaca; }
.nbx-btn-danger:hover { filter: brightness(1.05); }

.nbx-card { background: rgba(17,24,39,0.72); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.nbx-card-narrow { max-width: 420px; width: 100%; }
.nbx-landing { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
.nbx-footer { display: flex; justify-content: space-between; color: var(--muted); margin-top: 24px; font-size: 12px; }
.nbx-auth { margin-top: 26px; display: flex; justify-content: center; }

label { display: block; font-size: 12px; color: var(--muted); margin-top: 12px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(2,6,23,0.5);
  color: var(--text);
}
.nbx-msg { margin-top: 12px; color: #fca5a5; font-size: 13px; min-height: 18px; }
.nbx-muted { color: var(--muted); font-size: 13px; }

.nbx-app { height: 100%; display: flex; flex-direction: column; }
.nbx-app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px;
  border-bottom: 1px solid var(--border);
  background-color: rgb(25, 35, 45);
  background-image: url('../img/bg.jpg');
  box-shadow: inset 0 0 50px 0 #191b1d, 0 0 14px 0 black;
}
.nbx-header-controls { display: flex; gap: 10px; align-items: center; }
.nbx-sidebar-toggle { display: none; }
.nbx-sidebar-overlay { display: none; }
.nbx-select { min-width: 240px; }
.nbx-input { width: auto; min-width: 220px; }
#searchBox { width: 50%; }
@media (max-width: 720px) { #searchBox { width: 100%; } }

#db-controls { display: flex; gap: 10px; align-items: center; }
#db-controls .nbx-select { font-size: 14px; padding: 10px 14px; min-width: 260px; }

.nbx-app-body { flex: 1; display: grid; grid-template-columns: 270px 1fr; min-height: 0; padding-bottom: 44px; }
.nbx-sidebar { border-right: 1px solid var(--border); background: rgba(2,6,23,0.35); overflow: auto; }
.nbx-main { overflow: hidden; padding: 14px; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.nbx-sidebar-title { padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--border); }
.nbx-sidebar-content { padding: 10px 8px; }
.nbx-side-sec { margin-bottom: 12px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.10); }
.nbx-side-sec-title { padding: 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.nbx-side-list { display: flex; flex-direction: column; }
.nbx-side-item { padding: 8px 10px; border-radius: 10px; color: var(--text); }
.nbx-side-item:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.nbx-side-item-active { background: rgba(96,165,250,0.18); border: 1px solid rgba(96,165,250,0.25); }

.nbx-main-toolbar { display: flex; gap: 10px; align-items: center; margin: 10px 0 12px; }
.nbx-breadcrumb { color: var(--muted); font-size: 12px; }

.nbx-data-area { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.nbx-table-frame { flex: 1; min-height: 0; border: 1px solid var(--border); border-radius: 14px; background: rgba(17,24,39,0.4); overflow: hidden; }
.nbx-table-wrap { height: 100%; overflow: scroll; }
.nbx-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.nbx-table th, .nbx-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: top; text-align: left; }
.nbx-table th { position: sticky; top: 0; background: #191f26; cursor: pointer; }
.nbx-table tbody tr:nth-child(odd) { background: #374151; }
.nbx-table tbody tr:nth-child(even) { background: #263346; }
.nbx-th-sorted { color: var(--accent); }
.nbx-pager { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.nbx-pager-info { color: var(--muted); font-size: 12px; }

.nbx-app-footer { position: fixed; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #192E43; border-top: 1px solid var(--border); z-index: 90; gap: 12px; }
.nbx-app-footer-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.nbx-app-footer-center { display: flex; align-items: center; justify-content: center; }
.nbx-app-footer-logo { height: 24px; width: auto; display: block; }
.nbx-app-footer-msg { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbx-app-footer-right { color: var(--muted); font-size: 12px; flex: 1; display: flex; justify-content: flex-end; }

#rightPanel { min-height: 40px; }
.nbx-right-block { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: rgba(17,24,39,0.5); margin-bottom: 10px; }
.nbx-right-h { font-weight: 800; margin-bottom: 10px; }
.nbx-kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.08); }
.nbx-kv:first-of-type { border-top: none; }
.nbx-kv .k { color: var(--muted); font-size: 12px; }
.nbx-kv .v { font-size: 12px; word-break: break-word; }

.nbx-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 200; }
.nbx-modal-hidden { display: none; }
.nbx-modal-card { width: 100%; max-width: 520px; background: rgba(17,24,39,0.95); border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.nbx-modal-card input, .nbx-modal-card select, .nbx-modal-card textarea { padding: 12px 14px; border-radius: 12px; }
.nbx-modal-card label { margin-top: 0; }
.nbx-modal-card-wide { max-width: 1100px; }
.nbx-modal-title { font-weight: 800; margin-bottom: 10px; }
.nbx-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

@media (max-width: 1000px) {
  .nbx-app-body { grid-template-columns: 250px 1fr; }
}

@media (max-width: 720px) {
  .nbx-logo img { height: 44px; }
  .nbx-app-header { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; position: relative; z-index: 90; }
  .nbx-header-controls { flex-wrap: wrap; }
  .nbx-app-body { grid-template-columns: 1fr; }
  .nbx-sidebar-toggle { display: inline-flex; }
  #db-controls { width: 100%; padding: 8px 10px; gap: 8px; overflow-x: auto; }
  #db-controls .nbx-select { min-width: 180px; }
  #db-controls button span { display: none; }
  #db-controls button.nbx-btn { padding: 10px; }
  .nbx-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 120;
  }
  body.nbx-sidebar-open .nbx-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .nbx-sidebar {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    max-width: 86vw;
    z-index: 150;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
    overflow: auto;
  }
  body.nbx-sidebar-open .nbx-sidebar {
    transform: translateX(0);
  }

  #nbxFlyDb { top: 160px !important; }
  #nbxFlyEnt { top: 210px !important; }
  #nbxFlyFilter { top: 260px !important; }
  #nbxFlyReport { top: 310px !important; }
  #nbxFlyCfg { top: 360px !important; }
}

.nbx-fly { position: fixed; right: -640px; width: 688px; height: 560px; display: flex; align-items: flex-start; z-index: 80; transition: right 220ms ease; }
.nbx-fly-open { right: 0; }
.nbx-fly-icon { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; background: rgba(2,6,23,0.88); border: 1px solid rgba(255,255,255,0.75); border-right: none; border-radius: 5px 0 0 5px; cursor: pointer; position: relative; z-index: 2; }
.nbx-fly-icon:hover { filter: brightness(1.15); }
.nbx-fly-panel { width: 640px; height: 560px; background: rgba(17,24,39,0.95); border: 1px solid rgba(255,255,255,0.75); border-right: none; border-radius: 0; overflow: auto; padding: 12px; padding-right: 62px; box-shadow: 0 20px 60px rgba(0,0,0,0.55); margin-left: -1px; position: relative; z-index: 1; }

/* Ring toolbar snippet styles */
.icon-node:hover { filter: drop-shadow(0 0 8px rgba(103, 232, 249, 0.8)); color: #22d3ee; }
.tooltip { visibility: hidden; position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: #191f26; color: white; padding: 4px 8px; border-radius: 4px; font-size: 10px; white-space: nowrap; border: 1px solid #374151; pointer-events: none; }
.icon-node:hover .tooltip { visibility: visible; }

