/* NMS Monitor — dark, technical, status-first.
   Palette:
   bg        #0F1417
   panel     #161D22
   panel-2   #1D262C
   border    #263139
   text      #E6EDF0
   muted     #7C8B93
   up        #3FB950
   down      #F85149
   unknown   #D4A72C
   accent    #2EC4B6
*/

:root {
  --bg: #0F1417;
  --panel: #161D22;
  --panel-2: #1D262C;
  --border: #263139;
  --text: #E6EDF0;
  --muted: #7C8B93;
  --up: #3FB950;
  --down: #F85149;
  --unknown: #D4A72C;
  --accent: #2EC4B6;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 72px; /* room for bottom nav on mobile */
}

a { color: inherit; text-decoration: none; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.brand-accent { color: var(--accent); }
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(63,185,80,0.18);
  animation: pulse 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .brand-dot { animation: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.topnav { display: none; gap: 4px; }
.topnav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.topnav a.active, .topnav a:hover { color: var(--text); background: var(--panel-2); }

@media (min-width: 760px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.bottomnav a.active { color: var(--accent); }
.bottomnav .icon { font-size: 17px; line-height: 1; }

/* ---------- Layout ---------- */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px;
}

h1 { font-size: 20px; margin: 4px 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }

/* ---------- Flash messages ---------- */
.flash-stack { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  border: 1px solid var(--border);
}
.flash-success { background: rgba(63,185,80,0.1); border-color: rgba(63,185,80,0.35); color: #8FE3A0; }
.flash-error { background: rgba(248,81,73,0.1); border-color: rgba(248,81,73,0.35); color: #FF9891; }

/* ---------- Summary stat row ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.stat-card .num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; }
.stat-card .label { font-size: 11.5px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card.up .num { color: var(--up); }
.stat-card.down .num { color: var(--down); }
.stat-card.unknown .num { color: var(--unknown); }

/* ---------- Device cards ---------- */
.device-list { display: flex; flex-direction: column; gap: 10px; }
.device-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 10px;
  padding: 12px 14px;
}
.device-card.status-up { border-left-color: var(--up); }
.device-card.status-down { border-left-color: var(--down); }
.device-card.status-unknown { border-left-color: var(--unknown); }
.device-card.disabled { opacity: 0.5; }

.device-main { flex: 1; min-width: 0; }
.device-name-row { display: flex; align-items: center; gap: 8px; }
.device-name { font-weight: 600; font-size: 14.5px; }
.device-host {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-meta { display: flex; gap: 10px; margin-top: 4px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-up { background: rgba(63,185,80,0.15); color: var(--up); }
.badge-down { background: rgba(248,81,73,0.15); color: var(--down); }
.badge-unknown { background: rgba(212,167,44,0.15); color: var(--unknown); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.device-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06201D; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--down); }
.btn-danger:hover { border-color: var(--down); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 6px 9px; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.empty-state a { color: var(--accent); font-weight: 600; }

/* ---------- Forms ---------- */
.form-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.hint { font-size: 11.5px; color: var(--muted); }
.field input[type=text], .field input[type=password], .field input[type=number], .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-ui);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,196,182,0.18);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row input { width: 18px; height: 18px; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- Detail page ---------- */
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--accent); }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.uptime-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.uptime-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.uptime-card .pct { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }
.uptime-card .label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.sparkline { display: flex; gap: 2px; margin: 10px 0 18px; }
.spark-bar { flex: 1; height: 26px; border-radius: 2px; }
.spark-up { background: var(--up); }
.spark-down { background: var(--down); }

.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th, .history-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.history-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.history-table td.mono { font-family: var(--font-mono); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 10px; }

.help-text { color: var(--muted); font-size: 13px; line-height: 1.6; }
.help-text code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-family: var(--font-mono); font-size: 12px; }

/* ---------- Brand logo ---------- */
.brand-logo { height: 22px; width: auto; border-radius: 4px; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
  font-weight: 700;
  font-size: 18px;
}
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; }
.login-hint { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ---------- Category filter chips ---------- */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #06201D; }

.category-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ---------- Settings tabs ---------- */
.tab-row { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.tab-link {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab-link.active { color: var(--accent); border-color: var(--accent); }

/* ---------- Simple data table (users / db admin) ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table td.mono { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.data-table tr:hover td { background: var(--panel-2); }
.table-scroll { overflow-x: auto; }
.role-badge { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.role-badge.admin { background: rgba(46,196,182,0.15); color: var(--accent); }
.role-badge.monitor { background: var(--panel-2); color: var(--muted); }

.pagination { display: flex; gap: 8px; margin-top: 14px; align-items: center; font-size: 13px; }

.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 44px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.color-field input[type=text] { flex: 1; }

.import-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.import-tab-btn {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.import-tab-btn.active { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   V2: Nav dropdown (desktop) + slide-out mobile nav + misc UI
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border, #263139);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}
.brand {
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--menu-text);
}
.brand-logo { height: 26px; width: auto; border-radius: 4px; }

.topnav { display: none; gap: 2px; align-items: center; flex-wrap: nowrap; }
@media (min-width: 900px) { .topnav { display: flex; } }

.nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--menu-text);
  opacity: 0.75;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
}
.nav-link.active, .nav-link:hover { opacity: 1; background: var(--panel-2); }

.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  padding: 8px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--menu-text);
  opacity: 0.85;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  font-family: var(--font-ui);
  white-space: nowrap;
}
.nav-dropdown:hover > .nav-dropdown-btn, .nav-dropdown-btn:focus { opacity: 1; background: var(--panel-2); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--panel-2);
  border: 1px solid var(--border, #263139);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  z-index: 50;
}
.nav-dropdown:hover > .nav-dropdown-menu { display: block; }
.nav-dropdown-menu .nav-link, .nav-dropdown-menu .nav-dropdown-btn {
  display: flex;
  width: 100%;
  text-align: left;
  opacity: 1;
  color: var(--menu-text);
}
.nav-dropdown-menu .nav-dropdown { width: 100%; }
.nav-dropdown-menu .nav-dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 4px;
}

.hamburger-btn {
  display: inline-flex;
  background: none;
  border: none;
  color: var(--menu-text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}
@media (min-width: 900px) { .hamburger-btn { display: none; } }

.mobile-nav {
  position: fixed;
  top: 0; right: -320px;
  width: 300px; max-width: 85vw;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border, #263139);
  z-index: 200;
  transition: right 0.2s ease;
  display: flex;
  flex-direction: column;
}
.mobile-nav.open { right: 0; }
.mobile-nav-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; border-bottom: 1px solid var(--border, #263139);
  font-weight: 700; color: var(--menu-text);
}
.mobile-nav-header button { background: none; border: none; color: var(--menu-text); font-size: 18px; cursor: pointer; }
.mobile-nav-body { padding: 10px; overflow-y: auto; }
.mobile-nav-body a {
  display: block; padding: 11px 12px; border-radius: 8px; color: var(--menu-text); font-size: 14px; font-weight: 600;
}
.mobile-nav-body a:hover, .mobile-nav-body a:active { background: var(--panel-2); }
.mobile-nav-body details { margin-bottom: 2px; }
.mobile-nav-body summary {
  padding: 11px 12px; border-radius: 8px; color: var(--menu-text); font-size: 14px; font-weight: 700;
  cursor: pointer; list-style: none;
}
.mobile-nav-body summary::-webkit-details-marker { display: none; }
.mobile-nav-sub { padding-left: 14px; border-left: 2px solid var(--border, #263139); margin: 2px 0 6px 12px; }

/* ============================================================ */

body.btnstyle-outline .btn { background: transparent; border: 1px solid var(--btn-bg, var(--border)); color: var(--text); }
body.btnstyle-outline .btn-primary { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
body.btnstyle-solid .btn { background: var(--btn-bg, var(--panel-2)); }

/* ---------- Search bar ---------- */
.search-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.search-bar input {
  flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border, #263139);
  background: var(--panel); color: var(--text); font-size: 14px;
}
.search-bar input:focus { outline: none; border-color: var(--accent); }

/* ---------- View mode toggle ---------- */
.view-toggle { display: flex; gap: 4px; }
.view-toggle a {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border, #263139); background: var(--panel);
  color: var(--muted); font-size: 13px;
}
.view-toggle a.active { color: var(--accent); border-color: var(--accent); }

/* ---------- Device grid (boxes view) ---------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.device-box {
  background: var(--panel);
  border: 1px solid var(--border, #263139);
  border-top: 3px solid var(--muted);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.device-box.status-up { border-top-color: var(--up); }
.device-box.status-down { border-top-color: var(--down); animation: box-pulse-down 1.6s ease-in-out infinite; }
.device-box.status-unknown { border-top-color: var(--unknown); }
@keyframes box-pulse-down {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,81,73,0.0); }
  50% { box-shadow: 0 0 0 4px rgba(248,81,73,0.12); }
}
@media (prefers-reduced-motion: reduce) { .device-box.status-down { animation: none; } }

.device-box-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.device-box-icon { font-size: 15px; }
.device-box-name { font-weight: 700; font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-box-host { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-box-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Compact list view ---------- */
.device-compact-list { display: flex; flex-direction: column; border: 1px solid var(--border, #263139); border-radius: 10px; overflow: hidden; }
.device-compact-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--panel); border-bottom: 1px solid var(--border, #263139); font-size: 12.5px;
}
.device-compact-row:last-child { border-bottom: none; }
.device-compact-row .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.device-compact-row.status-up .dot { background: var(--up); }
.device-compact-row.status-down .dot { background: var(--down); }
.device-compact-row.status-unknown .dot { background: var(--unknown); }
.device-compact-row .name { font-weight: 600; flex: 0 0 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-compact-row .host { font-family: var(--font-mono); color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Animated stat donut (SVG) ---------- */
.stat-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.donut-card { background: var(--panel); border: 1px solid var(--border, #263139); border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.donut-ring circle { transition: stroke-dasharray 0.6s ease; }
.donut-label-num { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }

/* ---------- Category chip with icon ---------- */
.chip-icon { margin-right: 4px; }

/* ---------- Batch page ---------- */
.batch-table-wrap { max-height: 60vh; overflow-y: auto; border: 1px solid var(--border, #263139); border-radius: 10px; }
.batch-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }

/* ---------- Dependency / topology tree ---------- */
.tree-list, .tree-list ul { list-style: none; margin: 0; padding-left: 20px; }
.tree-list { padding-left: 0; }
.tree-node {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 3px 0;
  border-radius: 8px; border: 1px solid var(--border, #263139); background: var(--panel);
  font-size: 13px;
}
.tree-node .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tree-children { border-left: 2px dashed var(--border, #263139); margin-left: 10px; }

/* ---------- Server status cards ---------- */
.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.status-card { background: var(--panel); border: 1px solid var(--border, #263139); border-radius: 12px; padding: 16px; }
.status-card .status-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.status-card .status-value { font-family: var(--font-mono); font-size: 26px; font-weight: 700; }
.progress-bar { height: 8px; border-radius: 5px; background: var(--panel-2); overflow: hidden; margin-top: 10px; }
.progress-bar-fill { height: 100%; background: var(--accent); transition: width 0.5s ease; }
.progress-bar-fill.warn { background: var(--unknown); }
.progress-bar-fill.danger { background: var(--down); }

/* ---------- Log table ---------- */
.log-row-login { color: var(--accent); }
.log-row-delete { color: var(--down); }

/* ---------- Topology graph ---------- */
.dot-inline { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; vertical-align:middle; }
.topo-panel { padding: 4px; overflow: hidden; }
.topo-svg { display: block; background:
  radial-gradient(var(--border, #263139) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: 10px;
  cursor: grab;
  touch-action: none;
}

/* ---------- Category breakdown chart (dashboard) ---------- */
.category-chart { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.category-chart-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.category-chart-label { width: 120px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-chart-bar { flex: 1; height: 16px; border-radius: 5px; background: var(--panel-2); overflow: hidden; display: flex; }
.category-chart-bar .seg-up { background: var(--up); height: 100%; transition: width 0.6s ease; }
.category-chart-bar .seg-down { background: var(--down); height: 100%; transition: width 0.6s ease; }
.category-chart-bar .seg-rest { background: var(--panel-2); height: 100%; }
.category-chart-count { width: 46px; text-align: right; flex-shrink: 0; color: var(--muted); font-family: var(--font-mono); }
