/* ── Variable aliases (bridge dashboard vars → app.css tokens) ─ */
#dashboard-view, #db-tooltip {
  --panel-2:    var(--surface-hover, #1c2128);
  --border-soft: #21262d;
  --green:  var(--success, #3ad07f);
  --red:    var(--danger,  #f0514e);
  --blue:   var(--accent,  #3d8bfd);
  --yellow: var(--warning, #f0a830);
  --text-dim: var(--text-muted, #7d8590);
}

/* ── Dashboard view container ──────────────────────────────── */
#dashboard-view {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── Inner content row (left + rail) ──────────────────────── */
.db-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Footer ────────────────────────────────────────────────── */
.db-footer {
  flex-shrink: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 18px;
  background: rgba(8, 10, 14, 0.72);
  border-top: 1px solid rgba(48, 54, 61, 0.55);
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.db-ft-left  { display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.db-ft-mid   { display: flex; align-items: center; gap: 6px; color: var(--text-muted); white-space: nowrap; }
.db-ft-right { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.db-ft-sep   { width: 1px; height: 14px; background: var(--border); flex-shrink: 0; }

/* ── Layout: left column + right rail ─────────────────────── */
.db-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.db-rail {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.db-rail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  gap: 12px;
  display: flex;
  flex-direction: column;
}
.db-rail > .db-pager {
  flex-shrink: 0;
  padding: 6px 14px 10px;
  border-top: 1px solid var(--border-soft);
}

/* ── Stat cards ────────────────────────────────────────────── */
.db-stats-wrap {
  position: relative; display: flex; align-items: stretch; flex-shrink: 0; gap: 6px;
}
.db-stats {
  display: flex; flex-direction: row; gap: 10px;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; flex: 1; min-width: 0;
}
.db-stats::-webkit-scrollbar { display: none; }
/* Carousel arrows */
.db-sc-arrow {
  flex-shrink: 0; width: 26px; align-self: stretch;
  background: rgba(22,27,35,.85); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--radius); cursor: pointer;
  display: none; font-size: 16px; transition: color .15s, border-color .15s;
}
.db-sc-arrow:hover { color: #f1f5f9; border-color: var(--border-muted,#3d4451); }
.db-sc-arrow.visible { display: flex; align-items: center; justify-content: center; }
/* Widget manager */
.db-wm-btn {
  flex-shrink: 0; width: 30px; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22,27,35,.85); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; color: var(--text-dim);
  font-size: 13px; transition: color .15s;
}
.db-wm-btn:hover { color: #f1f5f9; }
.db-wm-wrap { position: relative; display: flex; }
.db-wm-panel {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
  background: #1a2030; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; min-width: 210px; box-shadow: 0 8px 28px rgba(0,0,0,.5);
}
.db-wm-panel.open { display: block; }
.db-wm-title { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.db-wm-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 4px;
  font-size: 12.5px; color: #c4cad2; cursor: pointer; border-radius: 4px; user-select: none;
}
.db-wm-item:hover { background: rgba(255,255,255,.04); }
.db-wm-item input { accent-color: var(--blue,#3d8bfd); cursor: pointer; }
.db-stat {
  flex: 0 0 175px;
  background: linear-gradient(160deg, #222b38 0%, #191f29 60%, #161b23 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}
.db-stat.db-health { flex: 0 0 225px; }
.db-stat .db-lbl {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text-dim); font-weight: 500; margin-bottom: 7px;
}
.db-stat .db-val { font-size: 23px; font-weight: 600; letter-spacing: .3px; line-height: 1; }
.db-stat .db-val small { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.db-stat .db-sub { font-size: 11px; color: var(--text-dim); margin-top: 6px; font-weight: 500; }
.db-stat .db-sub .pos { color: #3ad07f; }
.db-stat .db-sub .neg { color: #f0514e; }
.db-spark {
  position: absolute; right: 10px; bottom: 10px; width: 88px; height: 28px;
  overflow: visible;
}
.db-stat.db-health .db-val {
  font-size: 19px; display: flex; align-items: center; gap: 8px;
  /* color set inline from healthColor */
}
.db-stat.db-health .db-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  /* background and box-shadow set inline from healthColor */
}

/* ── Dashboard header filter dropdowns ────────────────────── */
.db-flt-dd {
  position: relative;
}
.db-flt-dd-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface, #161b23);
  color: var(--text-muted, #7d8590);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
  user-select: none;
}
.db-flt-dd-btn:hover { color: var(--text); border-color: rgba(120,140,170,.4); }
.db-flt-dd-btn.active { color: var(--accent); border-color: var(--accent); }
.db-flt-dd-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 500;
  background: #1a2030;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 0;
  min-width: 155px;
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
}
.db-flt-dd-panel.open { display: block; }
.db-flt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: #c4cad2;
  cursor: pointer;
  user-select: none;
}
.db-flt-item:hover { background: rgba(255,255,255,.04); }
.db-flt-item input { accent-color: var(--accent); cursor: pointer; }
.db-flt-all { font-weight: 600; color: var(--text); }
.db-flt-divider { height: 1px; background: var(--border); margin: 3px 0; }

/* ── Counters grid view ────────────────────────────────────── */
.db-view {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #1c2430, #12171f);
  display: flex;
  flex-direction: column;
}
.db-ws-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  padding: 12px;
  padding-bottom: 80px;
  align-content: start;
}
.db-ws-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 40px 0;
}
.db-ws-card {
  background: linear-gradient(160deg, #232c3a 0%, #1a212b 55%, #171d26 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s;
  user-select: none;
}
.db-ws-card:hover { border-color: var(--text-dim); }
.db-ws-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.db-ws-card.bad    { border-color: rgba(240,81,78,.35); }
.db-ws-card.warning { border-color: rgba(240,168,48,.35); }
.db-ws-card.active.bad { border-color: #f0514e; box-shadow: 0 0 0 1px #f0514e; }
.db-ws-card.active.warning { border-color: #f0a830; box-shadow: 0 0 0 1px #f0a830; }

.db-ws-card-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.db-ws-card-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 7px;
  background: #141a22;
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.db-ws-iata-ph {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: .03em;
}
.db-ws-offline-icon { display: block; color: var(--text-dim); opacity: .4; }
.db-ws-server-lbl { font-size: 10px; font-weight: 700; color: var(--text-dim); letter-spacing: .5px; text-transform: uppercase; }
.db-server-rail-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 0 14px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.db-ws-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-ws-card-id {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-ws-card-airline {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.db-ws-iata {
  font-weight: 700;
  font-size: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.db-ws-card-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
}
.db-ws-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-ws-status-dot.on  { background: var(--green, #3ad07f); box-shadow: 0 0 0 2px rgba(58,208,127,.2); }
.db-ws-status-dot.off { background: var(--red, #f0514e);   box-shadow: 0 0 0 2px rgba(240,81,78,.2);  }
.db-ws-status-lbl {
  font-size: 10.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.db-ws-devs {
  display: flex;
  gap: 3px;
  margin-left: auto;
  flex-wrap: nowrap;
}
.db-ws-dev {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid transparent;
  letter-spacing: .03em;
}
.db-ws-dev.online  { color: #3ad07f; border-color: rgba(58,208,127,.3);  background: rgba(58,208,127,.08);  }
.db-ws-dev.warning { color: #f0a830; border-color: rgba(240,168,48,.3);  background: rgba(240,168,48,.08);  }
.db-ws-dev.bad,
.db-ws-dev.offline { color: #f0514e; border-color: rgba(240,81,78,.3);   background: rgba(240,81,78,.08);   }
.db-ws-dev.disabled{ color: var(--text-dim); border-color: var(--border); background: transparent; }
.db-view-grad {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 10%, rgba(40,52,70,.25), transparent 58%),
    linear-gradient(180deg, rgba(8,10,14,.1) 0%, rgba(8,10,14,.0) 35%, rgba(8,10,14,.28) 72%, rgba(8,10,14,.58) 100%);
  pointer-events: none; z-index: 2;
}
#db-main-svg {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.db-view-toolbar {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 8px;
}
.db-tb-sel {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border-radius: 9px;
  background: rgba(13,17,23,.78);
  border: 1px solid rgba(120,140,170,.22);
  backdrop-filter: blur(8px);
  font-size: 12.5px; font-weight: 500; color: var(--text);
  white-space: nowrap;
}
.db-tb-btn {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border-radius: 9px;
  background: rgba(13,17,23,.78);
  border: 1px solid rgba(120,140,170,.22);
  backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s;
}
.db-tb-btn:hover { color: var(--text); background: rgba(20,26,36,.9); }
.db-tb-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Counter SVG paths ─────────────────────────────────────── */
@keyframes db-breathe-bad {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255,32,32,.4)) drop-shadow(0 0 6px rgba(255,32,32,.2)); }
  50%       { filter: drop-shadow(0 0 4px #ff2020) drop-shadow(0 0 14px rgba(255,32,32,.9)) drop-shadow(0 0 32px rgba(255,32,32,.6)) drop-shadow(0 0 60px rgba(255,32,32,.3)); }
}
@keyframes db-breathe-warning {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(251,146,60,.5)) drop-shadow(0 0 6px rgba(251,146,60,.25)); }
  50%       { filter: drop-shadow(0 0 4px #fb923c) drop-shadow(0 0 14px rgba(251,146,60,.95)) drop-shadow(0 0 32px rgba(251,146,60,.65)) drop-shadow(0 0 60px rgba(251,146,60,.35)); }
}
@keyframes db-card-neon-ok {
  0%, 100% { box-shadow: 0 0 4px rgba(255,255,255,.12), 0 0 12px rgba(255,255,255,.06), 0 8px 28px rgba(0,0,0,.5); }
  50%       { box-shadow: 0 0 8px rgba(255,255,255,.35), 0 0 22px rgba(255,255,255,.18), 0 0 45px rgba(255,255,255,.08), 0 8px 28px rgba(0,0,0,.5); }
}
@keyframes db-card-neon-ok-inner {
  0%, 100% { box-shadow: inset 0 0 8px rgba(255,255,255,.06), inset 0 0 3px rgba(255,255,255,.04); }
  50%       { box-shadow: inset 0 0 18px rgba(255,255,255,.2),  inset 0 0 7px rgba(255,255,255,.14); }
}
@keyframes db-card-neon-warning {
  0%, 100% { box-shadow: 0 0 4px rgba(251,146,60,.45), 0 0 12px rgba(251,146,60,.22), 0 0 28px rgba(251,146,60,.08), 0 8px 28px rgba(0,0,0,.5); }
  50%       { box-shadow: 0 0 8px rgba(251,146,60,.9), 0 0 22px rgba(251,146,60,.6), 0 0 50px rgba(251,146,60,.28), 0 8px 28px rgba(0,0,0,.5); }
}
@keyframes db-card-neon-warning-inner {
  0%, 100% { box-shadow: inset 0 0 8px rgba(251,146,60,.2),  inset 0 0 3px rgba(251,146,60,.15); }
  50%       { box-shadow: inset 0 0 18px rgba(251,146,60,.55), inset 0 0 7px rgba(251,146,60,.4); }
}
@keyframes db-card-neon-bad {
  0%, 100% { box-shadow: 0 0 4px rgba(255,32,32,.35),  0 0 12px rgba(255,32,32,.18), 0 0 28px rgba(255,32,32,.06), 0 8px 28px rgba(0,0,0,.5); }
  50%       { box-shadow: 0 0 8px rgba(255,32,32,.85),  0 0 22px rgba(255,32,32,.55), 0 0 50px rgba(255,32,32,.25), 0 8px 28px rgba(0,0,0,.5); }
}
@keyframes db-card-neon-bad-inner {
  0%, 100% { box-shadow: inset 0 0 8px rgba(255,32,32,.15), inset 0 0 3px rgba(255,32,32,.1); }
  50%       { box-shadow: inset 0 0 18px rgba(255,32,32,.5),  inset 0 0 7px rgba(255,32,32,.35); }
}

.db-counter {
  cursor: pointer;
  fill: transparent;
  stroke-width: 2;
  transition: fill .2s, filter .2s, stroke-width .2s, stroke .2s;
  pointer-events: all;
}
.db-counter.ok         { stroke: rgba(255,255,255,.3); fill: transparent; }
.db-counter.warning    { stroke: rgba(251,146,60,.6); stroke-width: 2; fill: rgba(251,146,60,.06); animation: db-breathe-warning 2.2s ease-in-out infinite; }
.db-counter.bad        { stroke: rgba(255,32,32,.55); stroke-width: 2; fill: rgba(255,32,32,.08); animation: db-breathe-bad 2.2s ease-in-out infinite; }
.db-counter.unassigned { stroke: rgba(125,133,144,.2); fill: rgba(125,133,144,.04); }
.db-screen.unassigned  { fill: rgba(125,133,144,.18); stroke: rgba(125,133,144,.3); filter: none; }
.db-counter.ok.active {
  stroke: #fff; stroke-width: 2.5; fill: rgba(255,255,255,.07);
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 8px rgba(255,255,255,1)) drop-shadow(0 0 20px rgba(255,255,255,.9)) drop-shadow(0 0 40px rgba(255,255,255,.6)) drop-shadow(0 0 70px rgba(255,255,255,.3));
}
.db-counter.warning.active {
  animation: none; stroke: #fb923c; stroke-width: 2.5; fill: rgba(251,146,60,.08);
  filter: drop-shadow(0 0 3px #fb923c) drop-shadow(0 0 8px rgba(251,146,60,1)) drop-shadow(0 0 20px rgba(251,146,60,.9)) drop-shadow(0 0 40px rgba(251,146,60,.65)) drop-shadow(0 0 70px rgba(251,146,60,.35));
}
.db-counter.bad.active {
  animation: none; stroke: #ff2020; stroke-width: 2.5; fill: rgba(255,32,32,.08);
  filter: drop-shadow(0 0 3px #ff2020) drop-shadow(0 0 8px rgba(255,32,32,1)) drop-shadow(0 0 20px rgba(255,32,32,.9)) drop-shadow(0 0 40px rgba(255,32,32,.65)) drop-shadow(0 0 70px rgba(255,32,32,.35));
}
.db-screen { stroke-width: 1; transition: filter .2s; pointer-events: none; }
.db-screen.ok, .db-screen.bad {
  fill: rgba(255,255,255,.82); stroke: rgba(255,255,255,.85);
  filter: drop-shadow(0 0 2px rgba(255,255,255,.6)) drop-shadow(0 0 5px rgba(255,255,255,.25));
}
.db-screen.ok.active, .db-screen.bad.active {
  fill: rgba(255,255,255,.88);
  filter: drop-shadow(0 0 3px rgba(255,255,255,.9)) drop-shadow(0 0 10px rgba(255,255,255,.45));
}

/* ── Bottom panels ─────────────────────────────────────────── */
.db-bottom {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
  height: 198px;
  flex-shrink: 0;
  margin-top: -68px;
  position: relative;
  z-index: 10;
}
.db-panel {
  background: linear-gradient(160deg, #222b38 0%, #191f29 55%, #161b23 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 32px rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.db-phead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; flex-shrink: 0; }
.db-phead h3 { font-size: 13px; font-weight: 600; }

/* Donut */
.db-util { display: flex; align-items: center; gap: 16px; flex: 1; min-height: 0; }
.db-donut { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.db-donut .db-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.db-donut .db-center b { font-size: 22px; font-weight: 600; display: block; }
.db-donut .db-center span { font-size: 9.5px; color: var(--text-dim); display: block; margin-top: 1px; }
.db-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.db-legend .db-row { display: flex; align-items: center; font-size: 12px; gap: 8px; }
.db-legend .db-row .db-k { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.db-legend .db-row .db-nm { color: var(--text); flex: 1; }
.db-legend .db-row .db-vv { color: var(--text); font-weight: 600; }
.db-legend .db-row .db-pp { color: var(--text-dim); width: 38px; text-align: right; font-size: 11px; }

/* Events */
.db-events { display: flex; flex-direction: column; overflow-y: auto; flex: 1; min-height: 0; }
.db-ev {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.db-ev:last-child { border-bottom: none; }
.db-ev .db-ti { color: var(--text-dim); width: 36px; flex-shrink: 0; font-size: 11px; }
.db-ev .db-ic { width: 19px; height: 19px; border-radius: 5px; display: grid; place-items: center; flex-shrink: 0; }
.db-ev .db-tx { flex: 1; color: #c4cad2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-ev .db-tg { font-size: 10.5px; font-weight: 600; flex-shrink: 0; }
.db-ev .db-tg.warning { color: #f0a830; }
.db-ev .db-tg.critical { color: #f0514e; }
.db-ev .db-tg.info    { color: #3d8bfd; }
.db-ev .db-tg.success { color: #3ad07f; }
.db-ev-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.db-ev-ts { font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.db-phead-count { font-size: 10.5px; font-weight: 700; background: rgba(240,81,78,.15); color: #f0514e; border-radius: 10px; padding: 1px 7px; margin-left: 6px; }

/* Pager (Live Events + Active Alerts rail) */
.db-pager { display: flex; align-items: center; gap: 8px; justify-content: center; padding-top: 6px; border-top: 1px solid var(--border-soft); margin-top: 4px; }
.db-pag-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; color: var(--text); width: 24px; height: 24px; cursor: pointer; font-size: 16px; display: grid; place-items: center; line-height: 1; transition: border-color var(--transition-base); }
.db-pag-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.db-pag-btn:disabled { opacity: .3; cursor: default; }
.db-pag-info { font-size: 11px; color: var(--text-dim); min-width: 36px; text-align: center; }

/* Rail alert timestamp */
.db-alert-ts { font-size: 10px; color: var(--text-dim); display: block; margin-top: 1px; }

/* System health */
.db-syslist { display: flex; flex-direction: column; flex: 1; justify-content: space-between; padding: 2px 0; }
.db-sysrow { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.db-sysrow .db-ic { width: 24px; height: 24px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-dim); flex-shrink: 0; }
.db-sysrow .db-nm { color: var(--text); flex: 1; }
.db-sysrow .db-vv { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.db-sysrow .db-vv.ok       { color: #3ad07f; }
.db-sysrow .db-vv.num      { color: var(--text); }
.db-sysrow .db-vv.disabled { color: var(--text-dim); opacity: .45; }

/* ── Right rail ────────────────────────────────────────────── */
.db-rcard {
  background: linear-gradient(160deg, #232c3a 0%, #1a212b 55%, #171d26 100%);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 15px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  flex-shrink: 0;
}
.db-rhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.db-rhead .db-t { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; flex-wrap: wrap; }
.db-rhead .db-t .db-dot { width: 7px; height: 7px; border-radius: 50%; }
.db-rhead .db-t small { font-size: 12px; font-weight: 500; }
.db-xbtn {
  width: 27px; height: 27px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text-dim); display: grid; place-items: center;
  cursor: pointer; transition: .15s; flex-shrink: 0;
}
.db-xbtn:hover { color: #fff; background: var(--panel-2); filter: brightness(1.2); }
.db-airline-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.db-airline-row .db-al-logo {
  width: 44px; height: 44px; border-radius: 50%;
  background: #0b0f15; border: 1px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0; overflow: hidden;
}
.db-airline-row .db-al-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.db-airline-row .db-al-info b { font-size: 14px; font-weight: 600; display: block; }
.db-airline-row .db-al-info span { font-size: 11px; color: var(--text-dim); display: block; margin-top: 2px; }
.db-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.db-tab {
  padding-bottom: 10px; font-size: 12.5px; color: var(--text-dim);
  cursor: pointer; position: relative; font-weight: 500;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.db-tab.active { color: #fff; }
.db-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: #3d8bfd;
}
.db-tab .db-cnt {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 9px; font-size: 9.5px; padding: 1px 5px; color: var(--text-dim);
}
.db-secthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.db-secthead h4 { font-size: 13px; font-weight: 600; }
.db-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 9px; border: 1px solid;
}
.db-kpis-head { font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.db-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 10px; }
.db-kpi .db-kk { font-size: 10px; color: var(--text-dim); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-kpi .db-kv { font-size: 17px; font-weight: 600; }
.db-kpi.db-util-k .db-kv { color: #3d8bfd; }
.db-kpi .db-bar { height: 3px; border-radius: 3px; background: var(--border); margin-top: 6px; overflow: hidden; }
.db-kpi .db-bar i { display: block; height: 100%; border-radius: 3px; transition: width .4s; }
.db-rail-sys { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.db-rail-sysrow { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.db-rail-syslbl { color: var(--text-dim); }
.db-rail-sysrow .db-vv { font-weight: 600; font-size: 12px; }
.db-dev-list { display: flex; flex-direction: column; }
.db-dev-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.db-dev-row:last-child { border-bottom: none; }
.db-dev-row .db-ab {
  width: 28px; height: 22px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: var(--text-dim); flex-shrink: 0;
}
.db-dev-row .db-dn { font-size: 12.5px; color: #d2d7de; flex: 1; }
.db-dev-row .db-stt { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; }
.db-dev-row .db-stt .db-d { width: 6px; height: 6px; border-radius: 50%; }
.db-stt.online  { color: #3ad07f; } .db-stt.online  .db-d { background: #3ad07f; }
.db-stt.warning { color: #f0a830; } .db-stt.warning .db-d { background: #f0a830; }
.db-stt.offline { color: #f0514e; } .db-stt.offline .db-d { background: #f0514e; }
.db-rail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 28px 16px; color: var(--text-dim); text-align: center;
}
.db-rail-empty p { font-size: 13px; line-height: 1.5; }

/* Rail alerts */
.db-alert-row { display: flex; align-items: flex-start; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.db-alert-row:last-child { border-bottom: none; }
.db-alert-row .db-aic { margin-top: 1px; flex-shrink: 0; }
.db-alert-row .db-abody { flex: 1; }
.db-alert-row .db-abody b { font-size: 12px; font-weight: 500; display: block; }
.db-alert-row .db-abody span { font-size: 10.5px; color: var(--text-dim); display: block; margin-top: 2px; }
.db-alert-row.red    .db-abody b { color: #f0514e; }
.db-alert-row.yellow .db-abody b { color: #f0a830; }
.db-alert-row .db-ago { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.db-rail-section-title {
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
  color: var(--text);
}
.db-rail-section-link {
  font-size: 11.5px; color: #3d8bfd; text-decoration: none; cursor: pointer;
}

/* ── Tooltip ───────────────────────────────────────────────── */
#db-tooltip {
  position: fixed; z-index: 300; pointer-events: none;
  opacity: 0; transition: opacity .18s ease;
}
#db-tooltip.visible { opacity: 1; }
.db-tooltip-card {
  position: relative;
  background: rgba(10,14,22,.55);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: backdrop-filter .18s ease, -webkit-backdrop-filter .18s ease;
  border-radius: 10px; padding: 12px 13px 10px; width: 220px;
}
#db-tooltip.visible .db-tooltip-card {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.db-tooltip-card::after {
  content: ''; position: absolute; bottom: -5px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px;
  background: rgba(10,14,22,.55);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.db-tooltip-card.tc-ok {
  border: 1px solid rgba(255,255,255,.32);
  animation: db-card-neon-ok 2.2s ease-in-out infinite;
}
.db-tooltip-card.tc-ok::before {
  content: ''; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; z-index: 1;
  animation: db-card-neon-ok-inner 2.2s ease-in-out infinite;
}
.db-tooltip-card.tc-ok::after { border-right: 1px solid rgba(255,255,255,.32); border-bottom: 1px solid rgba(255,255,255,.32); }
.db-tooltip-card.tc-warning {
  border: 1px solid rgba(251,146,60,.75);
  animation: db-card-neon-warning 2s ease-in-out infinite;
}
.db-tooltip-card.tc-warning::before {
  content: ''; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; z-index: 1;
  animation: db-card-neon-warning-inner 2s ease-in-out infinite;
}
.db-tooltip-card.tc-warning::after { border-right: 1px solid rgba(251,146,60,.75); border-bottom: 1px solid rgba(251,146,60,.75); }
.db-tooltip-card.tc-bad {
  border: 1px solid rgba(255,32,32,.55);
  animation: db-card-neon-bad 2.2s ease-in-out infinite;
}
.db-tooltip-card.tc-bad::before {
  content: ''; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; z-index: 1;
  animation: db-card-neon-bad-inner 2.2s ease-in-out infinite;
}
.db-tooltip-card.tc-bad::after { border-right: 1px solid rgba(255,32,32,.55); border-bottom: 1px solid rgba(255,32,32,.55); }
.db-tc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.db-tc-logo {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.db-tc-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.db-tc-info { display: flex; flex-direction: column; gap: 1px; }
.db-tc-id { font-size: 13px; font-weight: 700; color: #f1f5f9; letter-spacing: .02em; }
.db-tc-airline { font-size: 10px; color: #64748b; }
.db-tc-status { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.db-tc-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.db-tc-status.ok      { color: #34d399; }
.db-tc-status.warning { color: #fb923c; }
.db-tc-status.bad     { color: #f87171; }
.db-tc-divider { border: none; border-top: 1px solid rgba(255,255,255,.06); margin-bottom: 9px; }
.db-tc-devices { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.db-tc-device {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 7px 4px 5px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.03);
}
.db-tc-device.ok       { border-color: rgba(52,211,153,.2); }
.db-tc-device.bad,
.db-tc-device.powerOff { border-color: rgba(244,63,63,.25); background: rgba(244,63,63,.06); }
.db-tc-device.paperOut,
.db-tc-device.paperJam { border-color: rgba(251,146,60,.28); background: rgba(251,146,60,.07); }
.db-tc-device.offline   { border-color: rgba(100,116,139,.15); background: transparent; }
.db-tc-device.disabled  { border-color: rgba(100,116,139,.08); background: transparent; opacity: .25; pointer-events: none; }
.db-tc-dev-icon { width: 20px; height: 20px; }
.db-tc-dev-icon svg { width: 20px; height: 20px; }
.db-tc-device.ok       .db-tc-dev-icon { color: #64748b; }
.db-tc-device.bad      .db-tc-dev-icon,
.db-tc-device.powerOff .db-tc-dev-icon { color: #f87171; }
.db-tc-device.paperOut .db-tc-dev-icon,
.db-tc-device.paperJam .db-tc-dev-icon { color: #fb923c; }
.db-tc-device.offline  .db-tc-dev-icon { color: #2d3748; }
.db-tc-dev-code { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.db-tc-device.ok       .db-tc-dev-code { color: #64748b; }
.db-tc-device.bad      .db-tc-dev-code,
.db-tc-device.powerOff .db-tc-dev-code { color: #f87171; }
.db-tc-device.paperOut .db-tc-dev-code,
.db-tc-device.paperJam .db-tc-dev-code { color: #fb923c; }
.db-tc-device.offline  .db-tc-dev-code { color: #2d3748; }
