/* === Systems Watchdog — Modern Dark Dashboard === */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #0b0e14; color: #e2e6ef;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4458; }

/* ═══ TOP BAR ═══ */
.topbar {
  background: #0f1219; border-bottom: 1px solid #1e2433;
  padding: 0.5rem 1.5rem; height: auto; display: flex; align-items: center; gap: 1.2rem;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; overflow: visible;
}
.topbar .logo {
  white-space: nowrap; display: flex; flex-direction: column; align-items: center;
  align-self: center; gap: 0.15rem;
}
.logo-meta { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.logo-org { font-size: 0.72rem; color: #c8cdd8; font-weight: 600; text-align: center; }
.topbar .logo img {
  height: 56px; width: auto; display: block;
}
.topbar-ver {
  font-size: 0.72rem; color: #c8cdd8; font-weight: 500; white-space: nowrap;
}
.topbar-org {
  font-size: 0.78rem; color: #9ca3af; font-weight: 600; white-space: nowrap;
}
.topbar-badges { display: flex; align-items: center; gap: 0.3rem; justify-content: center; }
.top-nav { display: flex; gap: 0.2rem; margin-left: 1rem; }
.top-nav-link {
  padding: 0.35rem 0.8rem; border-radius: 6px; font-size: 0.82rem; font-weight: 600;
  color: #9ca3af; text-decoration: none; transition: all 0.12s;
}
.top-nav-link:hover { color: #e2e6ef; background: rgba(255,255,255,0.04); }
.top-nav-link.active { color: #4a90f7; background: rgba(74,144,247,0.08); }
.topbar .stats { display: flex; gap: 1rem; margin-left: auto; font-size: 0.8rem; color: #c8cdd8; }
.topbar .stat { display: flex; align-items: center; gap: 0.3rem; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.dot.blue { background: #4a90f7; }
.dot.purple { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.4); }

/* Notification Bell */
.notif-bell {
  position: relative; cursor: pointer; color: #9ca3af; padding: 0.4rem;
  border-radius: 6px; transition: color 0.15s, background 0.15s;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: -8px;
}
.notif-bell:hover { color: #fff; background: rgba(255,255,255,0.06); }
.notif-badge-org { background: #4a90f7 !important; }
.notif-badge {
  position: absolute; top: 0; right: -2px; background: #f04848; color: #fff;
  font-size: 0.6rem; font-weight: 800; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #0f1219;
}
.notif-panel {
  display: none; position: fixed; right: 60px; top: 72px;
  background: #141821; border: 1px solid #2a3040; border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); width: 480px; max-height: 520px;
  z-index: 300; overflow: hidden;
}
.notif-panel.open { display: block; }
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 1rem; border-bottom: 1px solid #1e2433;
  font-weight: 700; font-size: 0.88rem; color: #e2e6ef;
}
.notif-filters {
  display: flex; gap: 0.4rem; padding: 0.5rem 1rem; border-bottom: 1px solid #1e2433;
  background: rgba(0,0,0,0.15);
}
.notif-filters select {
  padding: 0.3rem 0.5rem; background: #0f1219; color: #d0d5e4; border: 1px solid #2a3040;
  border-radius: 5px; font-size: 0.75rem; font-family: inherit;
}
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  padding: 0.6rem 1rem; border-bottom: 1px solid #1a1f2e; cursor: default;
  transition: background 0.12s; font-size: 0.82rem;
}
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item.unread { border-left: 3px solid #4a90f7; background: rgba(74,144,247,0.04); }
.notif-item:not(.unread) { opacity: 0.6; border-left: 3px solid transparent; }
.notif-item .ni-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.notif-item .ni-title { font-weight: 700; color: #e2e6ef; }
.notif-item .ni-time { color: #9ca3af; font-size: 0.72rem; flex-shrink: 0; }
.notif-item .ni-detail { color: #c8cdd8; font-size: 0.78rem; margin-top: 2px; }
.notif-item .ni-meta { display: flex; gap: 0.5rem; margin-top: 3px; font-size: 0.72rem; color: #9ca3af; }
.notif-item .ni-scope { padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.68rem; font-weight: 600; }
.notif-item .ni-scope-org { background: rgba(74,144,247,0.12); color: #4a90f7; }
.notif-item .ni-scope-device { background: rgba(245,158,11,0.12); color: #f59e0b; }
.notif-empty { text-align: center; padding: 2rem 1rem; color: #9ca3af; font-size: 0.85rem; }
.notif-footer {
  padding: 0.5rem 1rem; border-top: 1px solid #1e2433; text-align: center;
}
.notif-footer a { color: #4a90f7; text-decoration: none; font-size: 0.78rem; font-weight: 600; }
.notif-footer a:hover { text-decoration: underline; }

/* Alert Event Chips */
.ev-chip {
  display: inline-flex; align-items: center; padding: 0.3rem 0.65rem;
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; color: #9ca3af; cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.ev-chip:hover { border-color: #4a90f7; color: #c8cdd8; }
.ev-chip.active { background: rgba(74,144,247,0.12); border-color: #4a90f7; color: #4a90f7; }

/* Alert Channel Card */
.ac-card {
  background: #0f1219; border: 1px solid #2a3040; border-radius: 8px;
  padding: 0.75rem 1rem; margin-bottom: 0.5rem; display: flex;
  align-items: center; gap: 0.7rem; transition: border-color 0.15s;
}
.ac-card:hover { border-color: #3a4458; }
.ac-icon { font-size: 1.1rem; flex-shrink: 0; }
.ac-info { flex: 1; min-width: 0; }
.ac-info .ac-label { font-weight: 700; font-size: 0.85rem; color: #e2e6ef; }
.ac-info .ac-dest { font-size: 0.78rem; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-info .ac-events { font-size: 0.72rem; color: #9ca3af; margin-top: 2px; }
.ac-actions { display: flex; gap: 0.3rem; align-items: center; flex-shrink: 0; }
.ac-actions button {
  padding: 0.25rem 0.5rem; border: none; border-radius: 5px;
  font-size: 0.72rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all 0.12s;
}
.ac-btn-test { background: #1a2035; color: #4a90f7; }
.ac-btn-test:hover { background: #1e2a45; }
.ac-btn-toggle { background: #1a2035; color: #2dd469; }
.ac-btn-toggle.off { color: #f04848; }
.ac-btn-del { background: #1a1520; color: #f04848; }
.ac-btn-del:hover { background: #2a1520; }

/* Alert Rule Action Buttons */
.rule-btn { border: none; border-radius: 5px; padding: 0.3rem 0.6rem; font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.12s; }
.rule-btn-test { background: #1a2035; color: #4a90f7; }
.rule-btn-test:hover { background: #1e2a45; }
.rule-btn-edit { background: #1a2035; color: #d0d5e4; }
.rule-btn-edit:hover { background: #2a3040; }
.rule-btn-del { background: rgba(220,38,38,0.1); color: #ef4444; }
.rule-btn-del:hover { background: rgba(220,38,38,0.2); }

/* Alert Badge on Device Tiles */
.alert-badge {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 0.3rem; padding: 0.1rem 0.4rem;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.15);
  border-radius: 10px; font-size: 0.65rem; font-weight: 700;
  color: #a0864a; white-space: nowrap; vertical-align: middle;
}
.alert-badge-org {
  background: rgba(74,144,247,0.06); border-color: rgba(74,144,247,0.12);
  color: #6b8fad;
}

/* Email Config */
.ec-label { font-size: .7rem; color: #c8cdd8; font-weight: 600; display: block; margin-bottom: .25rem; }
.ec-input {
  width: 100%; padding: .4rem .6rem; background: #0f1219; border: 1px solid #2a3040;
  border-radius: 6px; color: #e2e6ef; font-size: .82rem; font-family: inherit; margin: 0;
}
.ec-input:focus { border-color: #4a90f7; outline: none; }

/* User Menu */
.topbar .user-menu { cursor: pointer; position: relative; font-size: 0.85rem; color: #e2e6ef; }
.user-menu .dropdown {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 0.5rem;
  background: #1a1f2e; border: 1px solid #2a3040; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); min-width: 170px; overflow: hidden; z-index: 200;
}
.user-menu .dropdown.open { display: block; }
.user-menu .dropdown a {
  display: block; padding: 0.65rem 1rem; text-decoration: none;
  color: #c8cdd8; font-size: 0.85rem; transition: background 0.15s;
}
.user-menu .dropdown a:hover { background: #242b3d; color: #fff; }

/* ═══ LAYOUT ═══ */
.layout { display: flex; margin-top: 120px; min-height: calc(100vh - 120px); }

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: 240px; background: #0f1219; border-right: 1px solid #1e2433;
  padding: 1rem 0; flex-shrink: 0; position: fixed; top: 72px; bottom: 0;
  overflow-y: auto;
}
.sidebar h3 {
  padding: 0.5rem 1rem; font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 1.2px; color: #9ca3af; font-weight: 600;
}
.sidebar-search {
  width: calc(100% - 2rem); margin: 0.3rem 1rem 0.4rem; padding: 0.35rem 0.6rem;
  background: #141821; border: 1px solid #1e2433; border-radius: 6px;
  color: #e2e6ef; font-size: 0.78rem; font-family: inherit;
  transition: border-color 0.2s;
}
.sidebar-search:focus { border-color: #4a90f7; outline: none; }
.sidebar-search::placeholder { color: #c8cdd8; }
.sidebar .group-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 1rem; cursor: pointer; font-size: 0.85rem;
  color: #c8cdd8; transition: all 0.15s; border-left: 3px solid transparent;
  flex-wrap: wrap;
}
.sidebar .group-item:hover { background: #141821; color: #fff; }
.sidebar .group-item.active {
  background: rgba(74,144,247,0.08); color: #4a90f7; font-weight: 600;
  border-left-color: #4a90f7;
}
.sidebar .group-item .count {
  background: #1e2433; padding: 0.1rem 0.5rem; border-radius: 10px;
  font-size: 0.7rem; color: #c8cdd8;
}

/* ═══ MAIN CONTENT ═══ */
.main { margin-left: 240px; padding: 1.5rem; flex: 1; }

/* ═══ FLEET SUMMARY BAR (compact inline) ═══ */
.fleet-bar {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 1rem;
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  margin-bottom: 1rem;
}
.fb-item { display: flex; align-items: baseline; gap: 0.3rem; white-space: nowrap; }
.fb-val { font-size: 1.05rem; font-weight: 700; color: #e2e6ef; }
.fb-lbl { font-size: 0.72rem; color: #9ca3af; }
.fb-sep { width: 1px; height: 18px; background: #2a3040; flex-shrink: 0; }
.fb-green { color: #22c55e; }
.fb-red { color: #ef4444; }
.fb-amber { color: #f59e0b; }
.fb-blue { color: #4a90f7; }

/* Legacy fleet cards (kept for backward compat) */
.fleet-overview {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem;
  margin-bottom: 1.5rem;
}
.fleet-card {
  background: #141821; border: 1px solid #1e2433; border-radius: 10px;
  padding: 0.8rem 1rem; text-align: center; position: relative; overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.fleet-card:hover { border-color: #2a3550; transform: translateY(-1px); }
.fleet-card-wide { grid-column: span 1; }
.fleet-label {
  font-size: 0.65rem; color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 600; height: 28px;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
}
.fleet-value { font-size: 1.6rem; font-weight: 800; color: #e2e6ef; }
.fleet-value.fleet-green { color: #22c55e; }
.fleet-value.fleet-red { color: #ef4444; }
.fleet-value.fleet-amber { color: #f59e0b; }
.fleet-spark { display: block; margin: 0.3rem auto 0; opacity: 0.5; }

/* ═══ DEVICE TOOLBAR ═══ */
.device-toolbar {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem;
}
.device-search {
  padding: 0.35rem 0.7rem; border: 1px solid #3a4260; border-radius: 6px;
  background: #141821; color: #e2e6ef; font-size: 0.82rem; font-family: inherit;
  transition: border-color 0.2s; width: 220px;
}
.device-search:focus { border-color: #4a90f7; outline: none; box-shadow: 0 0 0 2px rgba(74,144,247,0.15); }
.device-search::placeholder { color: #c8cdd8; }
.toolbar-select {
  padding: 0.35rem 0.6rem; border: 1px solid #3a4260; border-radius: 6px;
  background: #141821; color: #e2e6ef; font-size: 0.82rem; font-family: inherit;
  cursor: pointer;
}
.toolbar-select:focus { border-color: #4a90f7; outline: none; }

/* ═══ VIEW TOGGLE ═══ */
.view-toggle {
  display: flex; gap: 2px;
  background: #141821; border: 1px solid #1e2433; border-radius: 6px;
  padding: 2px; width: fit-content;
}
.vt-btn {
  padding: 0.3rem 0.5rem; border: none; border-radius: 4px;
  background: transparent; color: #9ca3af; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.vt-btn:hover { color: #e2e6ef; }
.vt-btn.active { background: rgba(74,144,247,.15); color: #4a90f7; border: 1px solid rgba(74,144,247,.3); }

/* ═══ GLOBAL ADMIN SIDEBAR TABS ═══ */
.ga-tab {
  display: block; width: 100%; text-align: left;
  padding: .5rem .8rem; border: none; border-left: 3px solid transparent;
  background: transparent; color: #9ca3af; cursor: pointer;
  font-size: .8rem; font-family: inherit; transition: all .12s;
}
.ga-tab:hover { color: #e2e6ef; background: rgba(255,255,255,.03); }
.ga-tab.active { color: #4a90f7; background: rgba(74,144,247,.08); border-left-color: #4a90f7; }

/* ═══ BATTERY INDICATOR ═══ */
.batt-indicator { font-size: .73rem; font-weight: 600; white-space: nowrap; margin-left: .3rem; }

/* ═══ STATUS GROUP SEPARATOR ═══ */
.status-separator td { padding: 0 !important; border: none !important; }
.sep-line {
  display: flex; align-items: center; gap: .6rem; padding: .3rem 0; margin: .2rem 0;
}
.sep-line::before, .sep-line::after {
  content: ''; flex: 1; height: 1px; background: var(--sep-color, #ef4444); opacity: .3;
}
.sep-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #ef4444; white-space: nowrap; opacity: .7;
}

/* ═══ COLUMN CHOOSER ═══ */
.col-chooser {
  position: absolute; z-index: 200; top: 100%; right: 0;
  background: #141821; border: 1px solid #2e3548; border-radius: 8px;
  padding: 0.5rem; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.col-chooser label {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.4rem;
  font-size: 0.78rem; color: #d0d5e4; cursor: pointer; border-radius: 4px;
  white-space: nowrap;
}
.col-chooser label:hover { background: #1e2433; }
.col-chooser input[type="checkbox"] { accent-color: #3b82f6; }
.device-toolbar { position: relative; }

/* ═══ DEVICE LIST VIEW ═══ */
.kiosk-list { width: 100%; }
.kiosk-list table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.kiosk-list th {
  text-align: left; padding: 0.5rem 0.6rem; font-size: 0.7rem; font-weight: 700;
  color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #1e2433; white-space: nowrap;
}
.kiosk-list td {
  padding: 0.5rem 0.6rem; border-bottom: 1px solid #141821;
  color: #e2e6ef; white-space: nowrap;
}
.kiosk-list tr { cursor: pointer; transition: background 0.12s; }
.kiosk-list tbody tr:hover { background: rgba(74,144,247,0.05); }
.kiosk-list .list-status {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  margin-right: 0.4rem; vertical-align: middle;
}
.kiosk-list .list-name { font-weight: 600; color: #fff; }
.kiosk-list .list-url { color: #4a90f7; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* Sortable columns */
.kiosk-list .sortable-th {
  cursor: pointer; user-select: none; transition: color 0.15s;
}
.kiosk-list .sortable-th:hover { color: #e2e6ef; }
.kiosk-list .sortable-th.sorted { color: #4a90f7; }
.kiosk-list .sort-hint { opacity: 0; transition: opacity 0.15s; font-size: 0.55rem; vertical-align: middle; }
.kiosk-list .sortable-th:hover .sort-hint { opacity: 0.4; }

/* EKG animation */
.ekg-line {
  display: inline-block; vertical-align: middle; margin-left: 4px; width: 32px; height: 14px;
}
.ekg-line path { stroke-dasharray: 60; stroke-dashoffset: 0; }
.ekg-line.online path { stroke: #22c55e; opacity: 0.3; }
.ekg-line.online.pulse path { animation: ekg-draw 1s ease-out forwards; opacity: 1; }
.ekg-line.offline path { stroke: #ef4444; stroke-dasharray: none; opacity: 0.5; }
@keyframes ekg-draw {
  0% { stroke-dashoffset: 60; opacity: 1; }
  70% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0.3; }
}

/* ═══ DEVICE CARDS ═══ */
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; }
.kiosk-card {
  background: #141821; border: 1px solid #1e2433; border-radius: 10px;
  padding: 1rem 1.1rem; cursor: pointer; position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  border-left: 3px solid #1e2433;
}
.kiosk-card:hover {
  border-color: #2a3550; transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.kiosk-card.online { border-left-color: #22c55e; }
.kiosk-card.offline { border-left-color: #ef4444; }
.kiosk-card .card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.kiosk-card .card-header .name { font-weight: 600; font-size: 0.95rem; color: #fff; }
.kiosk-card .card-header .status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.kiosk-card .card-body { font-size: 0.8rem; color: #b0b8c8; }
.kiosk-card .card-body .row { display: flex; justify-content: space-between; margin-bottom: 0.2rem; }
.kiosk-card .card-body .row span:first-child { color: #9ca3af; }
.kiosk-card .card-body .row span:last-child { color: #e2e6ef; }
.kiosk-card .card-body .url { color: #4a90f7; word-break: break-all; }
.kiosk-card .checkbox {
  position: absolute; top: 0.8rem; right: 0.8rem;
}

/* Custom dark-theme checkboxes */
.sw-check {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border: 2px solid #3a4260; border-radius: 3px;
  background: #0f1219; cursor: pointer; vertical-align: middle;
  transition: all 0.12s; position: relative;
}
.sw-check:hover { border-color: #4a90f7; }
.sw-check:checked {
  background: #4a90f7; border-color: #4a90f7;
}
.sw-check:checked::after {
  content: ''; position: absolute; left: 3px; top: 0px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* Online status pulse */
.status-dot.online-dot { animation: status-pulse 2s ease-in-out infinite; }
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

/* ═══ DETAIL PANEL ═══ */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 300;
}
.overlay.open { display: flex; justify-content: flex-end; }
.detail-panel {
  width: 520px; max-width: 100%; background: #0f1219; height: 100%;
  overflow-y: auto; padding: 1.5rem; border-left: 1px solid #1e2433;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  animation: slide-in 0.25s ease-out;
}
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.detail-panel .close-btn {
  float: right; background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: #9ca3af; line-height: 1; transition: color 0.15s;
}
.detail-panel .close-btn:hover { color: #fff; }
.detail-panel h2 { font-size: 1.2rem; margin-bottom: 0.6rem; color: #fff; }
.detail-panel h3 { color: #e2e6ef; }
.detail-panel .info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0;
}
.detail-panel .info-item label {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #9ca3af; display: block; font-weight: 600; margin-bottom: 0.1rem;
}
.detail-panel .info-item span { font-size: 0.9rem; color: #e2e6ef; }

/* Action buttons */
.detail-panel .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.detail-panel .actions .btn {
  padding: 0.5rem 1rem; border: none; border-radius: 8px; cursor: pointer;
  font-size: 0.8rem; font-family: inherit; font-weight: 600;
  transition: all 0.15s;
}
.btn { padding: 0.45rem 1rem; border: none; border-radius: 6px; font-size: 0.82rem; font-family: inherit; font-weight: 600; cursor: pointer; transition: all 0.12s; display: inline-flex; align-items: center; justify-content: center; }
.btn-blue { background: #4a90f7; color: #fff; }
.btn-blue:hover { background: #3a7de5; box-shadow: 0 2px 8px rgba(74,144,247,0.3); }
.btn-orange { background: #f59e0b; color: #fff; }
.btn-orange:hover { background: #d97706; box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.btn-red { background: #ef4444; color: #fff; }
.btn-red:hover { background: #dc2626; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.btn-gray { background: #1e2433; color: #c8cdd8; }
.btn-gray:hover { background: #2a3040; color: #fff; }

/* Screenshot box */
.detail-panel .screenshot-box {
  background: #0f1219; border: 1px solid #1e2433; border-radius: 6px;
  padding: 0.8rem; text-align: center; min-height: 80px; color: #9ca3af; font-size: 0.8rem;
}
.detail-panel .screenshot-box img { max-width: 100%; border-radius: 6px; }

/* Command history */
.detail-panel .history { max-height: 200px; overflow-y: auto; }
.detail-panel .history-item {
  display: flex; justify-content: space-between; padding: 0.35rem 0;
  border-bottom: 1px solid #1a1f2e; font-size: 0.8rem;
}
.history-item .action { font-weight: 600; color: #c8cdd8; }
.history-item .time { color: #9ca3af; }
.history-item .status { font-size: 0.75rem; }
.status-completed { color: #22c55e; }
.status-failed { color: #ef4444; }
.status-pending { color: #f59e0b; }

/* ═══ DETAIL PANEL — RICH LAYOUT ═══ */

/* Status bar at top */
.dp-status-bar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.75rem;
  border-radius: 8px; margin-bottom: 0.6rem; font-size: 0.82rem; font-weight: 700;
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2);
  letter-spacing: 0.02em;
}
.dp-status-bar.online { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.25); }
.dp-status-bar.offline { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); }
.dp-status-bar.degraded { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); }
.dp-hb-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  animation: dp-pulse 2s ease-in-out infinite;
}
.dp-status-bar.online .dp-hb-dot { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.dp-status-bar.offline .dp-hb-dot { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); animation: dp-pulse-red 1s ease-in-out infinite; }
.dp-status-bar.degraded .dp-hb-dot { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
@keyframes dp-pulse { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:.3;transform:scale(.75);} }
@keyframes dp-pulse-red { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:.6;transform:scale(.8);} }
.dp-status-label { font-size: 0.82rem; font-weight: 700; }
.dp-status-bar.online .dp-status-label { color: #22c55e; }
.dp-status-bar.offline .dp-status-label { color: #ef4444; }
.dp-status-bar.degraded .dp-status-label { color: #f59e0b; }
.dp-status-detail { font-size: 0.78rem; color: #c8cdd8; font-weight: 500; }
.dp-status-right { margin-left: auto; font-size: 0.75rem; color: #c8cdd8; font-weight: 500; }

/* Panel container */
.dp-panel {
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  padding: 0.7rem 0.8rem; margin-bottom: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.dp-panel-hd {
  font-size: 0.78rem; font-weight: 800; color: #e2e6ef; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.4rem; display: flex; align-items: center; gap: 0.4rem;
  padding-bottom: 0.3rem; border-bottom: 1px solid #1e2433;
}
.dp-section-label {
  font-size: 0.7rem; font-weight: 700; color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.35rem;
}

/* Badge */
.dp-badge {
  font-size: 0.65rem; padding: 2px 7px; border-radius: 4px; font-weight: 700;
  letter-spacing: 0.02em; line-height: 1.4;
}
.dp-badge-ok { background: rgba(34,197,94,0.14); color: #22c55e; }
.dp-badge-warn { background: rgba(245,158,11,0.14); color: #f59e0b; }
.dp-badge-bad { background: rgba(239,68,68,0.14); color: #ef4444; }

/* Network Core metric rows */
.dp-mr {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0;
  border-bottom: 1px solid rgba(30,36,51,0.7);
}
.dp-mr:last-child { border-bottom: none; }
.dp-mr-n { font-size: 0.88rem; color: #c8cdd8; font-weight: 600; width: 65px; flex-shrink: 0; }
.dp-mr-v {
  font-size: 1.25rem; font-weight: 800; color: #e2e6ef; font-variant-numeric: tabular-nums;
  min-width: 65px; flex-shrink: 0;
}
.dp-mr-v.g { color: #22c55e; } .dp-mr-v.w { color: #f59e0b; } .dp-mr-v.b { color: #ef4444; }
.dp-mr-u { font-size: 0.78rem; color: #c8cdd8; font-weight: 500; }

/* System Core rows with progress bars */
.dp-smr {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.32rem 0;
  border-bottom: 1px solid rgba(30,36,51,0.7);
}
.dp-smr:last-child { border-bottom: none; }
.dp-smr-n { font-size: 0.88rem; color: #c8cdd8; font-weight: 600; width: 65px; flex-shrink: 0; }
.dp-smr-v {
  font-size: 1.25rem; font-weight: 800; min-width: 55px; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.dp-smr-v.g { color: #22c55e; } .dp-smr-v.w { color: #f59e0b; } .dp-smr-v.b { color: #ef4444; }
.dp-smr-right { display: flex; align-items: center; flex: 1; min-width: 0; }
.dp-smr-bar {
  flex: 1; height: 10px; background: #1e2433; border-radius: 3px; overflow: hidden;
  -webkit-mask-image: repeating-linear-gradient(90deg, #fff 0px, #fff 4px, transparent 4px, transparent 6px);
  mask-image: repeating-linear-gradient(90deg, #fff 0px, #fff 4px, transparent 4px, transparent 6px);
}
.dp-smr-fill { height: 100%; border-radius: 0; transition: width 0.4s, background 0.3s; }

/* Connection Details grid */
.dp-conn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem 0.5rem; }
.dp-cr { display: flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0; }
.dp-cr-i { font-size: 0.9rem; width: 20px; text-align: center; flex-shrink: 0; }
.dp-cr-l { font-size: 0.65rem; color: #9ca3af; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.dp-cr-v { font-size: 0.85rem; color: #e2e6ef; font-weight: 700; word-break: break-all; line-height: 1.3; }
.dp-cr-s { font-size: 0.72rem; color: #c8cdd8; }

/* Uptime bars */
.dp-ur { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.2rem; }
.dp-ur:last-child { margin-bottom: 0; }
.dp-ur-l { font-size: 0.82rem; color: #c8cdd8; width: 28px; font-weight: 700; text-align: right; }
.dp-ur-b { flex: 1; height: 10px; background: #1e2433; border-radius: 5px; overflow: hidden; }
.dp-ur-f { height: 100%; border-radius: 5px; transition: width 0.5s; }
.dp-ur-f.dp-ur-gt { background: linear-gradient(90deg, #1ea54e, #22c55e); }
.dp-ur-f.dp-ur-ok { background: linear-gradient(90deg, #d48a10, #f59e0b); }
.dp-ur-f.dp-ur-po { background: linear-gradient(90deg, #c02020, #ef4444); }
.dp-ur-p { font-size: 0.85rem; font-weight: 700; width: 48px; text-align: right; color: #e2e6ef; font-variant-numeric: tabular-nums; }

/* ═══ BULK ACTION BAR ═══ */
.bulk-bar {
  display: none; position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: #1a1f2e; border: 1px solid #2a3550; color: #e2e6ef;
  padding: 0.8rem 1.5rem; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 200;
  align-items: center; gap: 1rem; font-size: 0.85rem;
}
.bulk-bar.show { display: flex; }
.bulk-bar .btn {
  padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 6px;
  border: none; cursor: pointer; font-family: inherit;
}

/* ═══ MODALS ═══ */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 400; align-items: center; justify-content: center;
}
.modal.open { display: flex; }
.modal-content {
  background: #141821; border: 1px solid #1e2433; border-radius: 12px;
  padding: 1.5rem; width: 100%; max-width: 420px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: modal-in 0.2s ease-out;
}
@keyframes modal-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-content { position: relative; }
.modal-content h3 { margin-bottom: 1rem; color: #fff; padding-right: 1.5rem; }
.modal-close {
  position: absolute; top: 0.8rem; right: 1rem; font-size: 1.3rem; color: #c8cdd8;
  cursor: pointer; line-height: 1; z-index: 1; background: none; border: none;
  padding: 0.2rem; font-family: inherit;
}
.modal-close:hover { color: #fff; }
.modal-content input, .modal-content select {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid #2a3040; border-radius: 8px;
  background: #0f1219; color: #e2e6ef; font-size: 0.9rem; font-family: inherit;
  margin-bottom: 1rem; transition: border-color 0.2s;
}
.modal-content input[type="checkbox"], .modal-content input[type="radio"] {
  width: auto !important; padding: 0 !important; margin: 0 !important; margin-bottom: 0 !important;
  border: none !important; background: none !important; box-shadow: none !important;
  flex-shrink: 0;
}

/* Global Admin checkbox rows */
.ga-check {
  display: flex; align-items: center; gap: .5rem; margin-top: .3rem; cursor: pointer;
}
.ga-check span { color: #c8cdd8; font-size: .82rem; line-height: 1.3; }
.ga-hint { font-size: .75rem; color: #9ca3af; margin-top: .3rem; }
.modal-content input:focus, .modal-content select:focus {
  border-color: #4a90f7; outline: none; box-shadow: 0 0 0 3px rgba(74,144,247,0.15);
}
.modal-content .modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.modal-content .modal-actions .btn {
  padding: 0.45rem 1rem; border: none; border-radius: 6px; font-size: 0.82rem;
  font-family: inherit; font-weight: 600; cursor: pointer; transition: all 0.12s;
}

/* ═══ EMPTY STATE ═══ */
.empty-state { text-align: center; padding: 4rem 2rem; color: #9ca3af; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: #c8cdd8; }

/* ═══ DEVICE BADGES ═══ */
.device-badge {
  display: inline-block; padding: 0.15rem 0.45rem; border-radius: 4px;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; margin-left: 0.3rem; vertical-align: middle;
}
.badge-kiosk { background: rgba(74,144,247,0.15); color: #4a90f7; }
.badge-watchdog { background: rgba(34,197,94,0.15); color: #22c55e; }

/* ═══ TYPE FILTER DROPDOWN ═══ */
.type-select {
  width: calc(100% - 1rem); margin: 0 0.5rem 0.5rem; padding: 0.45rem 0.6rem;
  border: 1px solid #1e2433; border-radius: 8px; background: #141821;
  color: #e2e6ef; font-size: 0.8rem; font-family: inherit; cursor: pointer;
  appearance: auto; transition: border-color 0.2s;
}
.type-select:focus { border-color: #4a90f7; outline: none; box-shadow: 0 0 0 3px rgba(74,144,247,0.15); }
.type-select option { background: #141821; color: #e2e6ef; }

/* ═══ NETWORK HEALTH ═══ */
.nh-status-bar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem;
  border-radius: 8px; margin-bottom: 0.6rem; font-size: 0.8rem; font-weight: 600;
}
.nh-status-bar.online { background: rgba(34,197,94,0.12); color: #4ade80; }
.nh-status-bar.degraded { background: rgba(245,158,11,0.12); color: #fbbf24; }
.nh-status-bar.offline { background: rgba(239,68,68,0.12); color: #f87171; }

.nh-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-bottom: 0.6rem;
}
.nh-metric {
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  padding: 0.45rem 0.5rem; text-align: center;
}
.nh-metric .label {
  font-size: 0.6rem; color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.nh-metric .value { font-size: 0.95rem; font-weight: 700; color: #e2e6ef; }
.nh-metric .value.good { color: #22c55e; }
.nh-metric .value.warn { color: #f59e0b; }
.nh-metric .value.bad { color: #ef4444; }

.nh-chart-container { margin-bottom: 0.6rem; }
.nh-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.nh-chart-tabs { display: flex; gap: 3px; }
.nh-tab {
  padding: 0.3rem 0.65rem; border: none; border-radius: 6px; cursor: pointer;
  font-size: 0.7rem; font-family: inherit; background: #1a1f2e; color: #b0b8c8;
  transition: all 0.15s;
}
.nh-tab:hover { background: #242b3d; color: #e2e6ef; }
.nh-tab.active { background: #4a90f7; color: #fff; }
.nh-time-tabs { display: flex; gap: 3px; }
.nh-time {
  padding: 0.25rem 0.5rem; border: none; border-radius: 6px; cursor: pointer;
  font-size: 0.65rem; font-family: inherit; background: #1a1f2e; color: #b0b8c8;
  transition: all 0.15s;
}
.nh-time:hover { background: #242b3d; }
.nh-time.active { background: #2a3550; color: #fff; }

.chart-wrapper {
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  padding: 0.5rem; position: relative; height: 180px;
}
.chart-wrapper canvas { width: 100% !important; height: 100% !important; }
.chart-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(20,24,33,0.8); border-radius: 8px; font-size: 0.75rem; color: #9ca3af;
}
.chart-empty {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: 0.8rem; color: #9ca3af;
}

/* WiFi & Location */
.nh-wifi { font-size: 0.75rem; color: #b0b8c8; padding: 0.3rem 0; border-bottom: 1px solid #1a1f2e; margin-bottom: 0.5rem; }
.nh-location { font-size: 0.75rem; color: #b0b8c8; padding: 0.3rem 0; margin-bottom: 0.5rem; }

/* Network events */
.nh-events { max-height: 120px; overflow-y: auto; margin-bottom: 0.5rem; }
.nh-event {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.3rem 0; border-bottom: 1px solid #1a1f2e; font-size: 0.75rem;
}
.nh-event .event-type { font-weight: 600; }
.event-internet_down { color: #f87171; }
.event-internet_up { color: #4ade80; }
.event-high_latency { color: #fbbf24; }

/* ═══ POWER STATUS ═══ */
.pw-status-bar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.7rem;
  border-radius: 8px; margin-bottom: 0.6rem; font-size: 0.8rem; font-weight: 600;
}
.pw-status-bar.pw-ac { background: rgba(34,197,94,0.12); color: #4ade80; }
.pw-status-bar.pw-battery { background: rgba(239,68,68,0.12); color: #f87171; }

.pw-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-bottom: 0.6rem;
}
.pw-metric {
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  padding: 0.45rem 0.5rem; text-align: center;
}
.pw-metric .label { font-size: 0.6rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.pw-metric .value { font-size: 0.95rem; font-weight: 700; color: #e2e6ef; }
.pw-metric .value.good { color: #22c55e; }
.pw-metric .value.warn { color: #f59e0b; }
.pw-metric .value.bad { color: #ef4444; }

/* Offline reason */
.pw-reason {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem;
  border-radius: 8px; margin-bottom: 0.6rem; font-size: 0.8rem;
}
.pw-reason strong { display: block; font-size: 0.85rem; }
.pw-reason-desc { font-size: 0.7rem; margin-top: 0.1rem; opacity: 0.8; }
.pw-reason-power { background: rgba(239,68,68,0.12); color: #f87171; }
.pw-reason-network { background: rgba(245,158,11,0.12); color: #fbbf24; }
.pw-reason-graceful { background: rgba(99,102,241,0.12); color: #93c5fd; }
.pw-reason-unknown { background: rgba(107,114,128,0.12); color: #d1d5db; }

/* Power events */
.pw-events { max-height: 120px; overflow-y: auto; margin-bottom: 0.5rem; }
.pw-event {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.3rem 0; border-bottom: 1px solid #1a1f2e; font-size: 0.75rem;
}
.pw-event-type {
  font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.7rem;
}
.pw-ev-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.pw-ev-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.pw-ev-warn { background: rgba(245,158,11,0.15); color: #fbbf24; }
.pw-ev-info { background: rgba(59,130,246,0.15); color: #93c5fd; }
.pw-event-time { color: #9ca3af; font-size: 0.7rem; }

/* Power alert badge */
.power-alert {
  display: inline-block; color: #ef4444; font-size: 0.75rem; margin-left: 0.3rem;
  vertical-align: middle; animation: pw-pulse 2s infinite;
}
@keyframes pw-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ═══ SENSOR CARDS ═══ */
.sensor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.sensor-card {
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  padding: 0.55rem 0.6rem; text-align: center; cursor: pointer;
  transition: border-color 0.2s;
}
.sensor-card:hover { border-color: #4a90f7; }
.sensor-card.active { border-color: #4a90f7; box-shadow: 0 0 0 1px #4a90f7; }
.sensor-card .sensor-label {
  font-size: 0.6rem; color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 0.2rem; font-weight: 600;
}
.sensor-card .sensor-value { font-size: 1rem; font-weight: 700; color: #e2e6ef; }
.sensor-card .sensor-value.good { color: #22c55e; }
.sensor-card .sensor-value.warn { color: #f59e0b; }
.sensor-card .sensor-value.bad { color: #ef4444; }
.sensor-card .sensor-unit { font-size: 0.7rem; color: #9ca3af; font-weight: 400; }
.sensor-card .sensor-extra { font-size: 0.65rem; color: #9ca3af; margin-top: 0.15rem; }

/* Info sensors (system info, security, etc) */
.info-sensor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.info-sensor-card {
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  padding: 0.6rem 0.7rem; display: flex; gap: 0.6rem; align-items: flex-start;
  transition: border-color 0.2s;
}
.info-sensor-card:hover { border-color: #2a3550; }
.info-sensor-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }
.info-sensor-body { flex: 1; min-width: 0; }
.info-sensor-label {
  font-size: 0.6rem; color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 0.15rem; font-weight: 600;
}
.info-sensor-value { font-size: 0.85rem; font-weight: 700; color: #e2e6ef; word-break: break-all; }
.info-sensor-value.good { color: #22c55e; }
.info-sensor-value.warn { color: #f59e0b; }
.info-sensor-value.bad { color: #ef4444; }
.info-sensor-detail { font-size: 0.7rem; color: #9ca3af; margin-top: 0.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sensor sparkline */
.sensor-sparkline-container {
  background: #141821; border: 1px solid #1e2433; border-radius: 8px;
  padding: 0.5rem; margin-bottom: 0.5rem; height: 140px; position: relative;
}
.sensor-sparkline-container canvas { width: 100% !important; height: 100% !important; }

/* ═══ LICENSE INFO ═══ */
.license-info {
  display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: #c8cdd8;
}

/* ═══ SUPER ADMIN ═══ */
#adminOrgSection .group-item {
  font-size: 0.8rem; padding: 0.55rem 0.75rem;
  flex-direction: column; align-items: stretch; gap: 0.15rem;
}
.org-item-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.5rem; width: 100%;
}
.org-name {
  font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; flex: 1; min-width: 0;
}
.org-owner {
  font-size: 0.7rem; color: #9ca3af; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.badge-super {
  background: rgba(245,158,11,0.15); color: #fbbf24;
  padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.65rem;
  font-weight: 800; letter-spacing: 0.04em; vertical-align: middle;
}

/* ═══ ORG SETTINGS / USER MANAGEMENT ═══ */
.org-info-row {
  display: flex; justify-content: space-between; padding: 0.5rem 0;
  border-bottom: 1px solid #1a1f2e; font-size: 0.85rem;
}
.org-info-row label { color: #9ca3af; font-weight: 600; }
.org-info-row span { color: #e2e6ef; }
.user-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0; border-bottom: 1px solid #1a1f2e; font-size: 0.8rem;
}
.user-row .user-info { flex: 1; }
.user-row .user-name { font-weight: 600; color: #e2e6ef; }
.user-row .user-email { color: #b0b8c8; font-size: 0.75rem; }
.user-row .user-role {
  padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.7rem;
  font-weight: 600; text-transform: uppercase;
}
.role-owner { background: rgba(245,158,11,0.15); color: #fbbf24; }
.role-co_owner { background: rgba(74,144,247,0.15); color: #4a90f7; }
.role-admin { background: rgba(74,144,247,0.15); color: #4a90f7; } /* legacy */
.role-manager { background: rgba(45,212,105,0.15); color: #2dd469; }
.role-viewer { background: rgba(107,114,128,0.15); color: #d1d5db; }
.role-basic_viewer { background: rgba(107,114,128,0.1); color: #9ca3af; }
.badge-role {
  font-size: 0.65rem; font-weight: 800; padding: 0.2rem 0.5rem;
  border-radius: 4px; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(74,144,247,0.15); color: #4a90f7; vertical-align: middle;
}
.user-row .user-actions { display: flex; gap: 0.3rem; }
.user-row .user-actions button {
  padding: 0.25rem 0.55rem; border: none; border-radius: 4px; cursor: pointer;
  font-size: 0.7rem; font-family: inherit; background: #1e2433; color: #c8cdd8;
  transition: background 0.15s;
}
.user-row .user-actions button:hover { background: #2a3550; color: #fff; }

/* Admin org modal */
.admin-org-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0; border-bottom: 1px solid #1a1f2e; font-size: 0.85rem;
  cursor: pointer; color: #c8cdd8;
}
.admin-org-row:hover { background: #141821; }
.admin-license-input {
  width: 60px; padding: 0.25rem 0.4rem; border: 1px solid #2a3040; border-radius: 4px;
  font-size: 0.85rem; text-align: center; background: #0f1219; color: #e2e6ef;
}

/* ═══ ACTIVATION KEYS ═══ */
.keys-summary {
  display: flex; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid #1e2433; margin-bottom: 0.8rem;
}
.keys-summary .ks-item { text-align: center; flex: 1; }
.keys-summary .ks-item .ks-val { font-size: 1.4rem; font-weight: 700; color: #e2e6ef; }
.keys-summary .ks-item .ks-label {
  font-size: 0.7rem; color: #c8cdd8; text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.keys-summary .ks-item.over-limit .ks-val { color: #ef4444; }

.keys-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.keys-table th {
  text-align: left; padding: 0.6rem 0.7rem; border-bottom: 2px solid #1e2433;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #c8cdd8; font-weight: 600; white-space: nowrap;
}
.keys-table td {
  padding: 0.6rem 0.7rem; border-bottom: 1px solid #1a1f2e;
  vertical-align: middle; color: #e2e6ef; white-space: nowrap;
}
.keys-table tr:hover { background: #141821; }
.key-cell { display: flex; align-items: center; gap: 0.5rem; }
.key-value {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-weight: 600; letter-spacing: 1px; font-size: 0.95rem; color: #e2e6ef;
}
.key-copy-btn {
  background: rgba(74,144,247,0.1); border: 1px solid rgba(74,144,247,0.25); color: #7ab3f7;
  cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 4px;
  font-size: 0.7rem; font-family: inherit; font-weight: 500;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.key-copy-btn:hover { background: rgba(74,144,247,0.2); color: #a0c8ff; }
.key-copy-btn.copied { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: #4ade80; }
.key-status {
  display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.key-status.unused { background: rgba(74,144,247,0.15); color: #4a90f7; }
.key-status.activated { background: rgba(34,197,94,0.15); color: #4ade80; }
.key-status.revoked { background: rgba(245,158,11,0.15); color: #f59e0b; }
.key-btn {
  padding: 0.3rem 0.7rem; border: none; border-radius: 4px; cursor: pointer;
  font-size: 0.8rem; font-family: inherit; font-weight: 500;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.key-btn-unlink { background: rgba(245,158,11,0.15); color: #fbbf24; }
.key-btn-unlink:hover { background: rgba(245,158,11,0.25); color: #fcd34d; }
.key-btn-delete { background: rgba(239,68,68,0.15); color: #f87171; }
.key-btn-delete:hover { background: rgba(239,68,68,0.25); color: #fca5a5; }

/* Plan selector */
.plan-select {
  padding: 0.35rem 0.5rem; border: 1px solid #2a3040; border-radius: 6px;
  font-size: 0.85rem; font-family: inherit; background: #0f1219; color: #e2e6ef;
}

/* ═══ UPTIME TIMELINE ═══ */
.uptime-bar {
  height: 14px; border-radius: 7px; background: #1e2433; overflow: hidden;
  display: flex; margin-bottom: 0.3rem;
}
.uptime-bar .ut-seg { height: 100%; min-width: 1px; transition: width 0.3s; }
.ut-online { background: #22c55e; }
.ut-power { background: #ef4444; }
.ut-network { background: #f59e0b; }
.ut-graceful { background: #3b82f6; }
.ut-unknown { background: #4b5563; }
.uptime-legend { display: flex; gap: 0.8rem; font-size: 0.65rem; color: #9ca3af; }
.legend-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  vertical-align: middle; margin-right: 0.2rem;
}

/* ═══ EVENT TIMELINE ═══ */
.event-timeline { max-height: 200px; overflow-y: auto; margin-bottom: 0.5rem; }
.ev-item {
  display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.4rem 0;
  border-bottom: 1px solid #1a1f2e; font-size: 0.75rem;
}
.ev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 0.2rem; }
.ev-dot-danger { background: #ef4444; }
.ev-dot-success { background: #22c55e; }
.ev-dot-warn { background: #f59e0b; }
.ev-dot-info { background: #3b82f6; }
.ev-dot-gray { background: #4b5563; }
.ev-body { flex: 1; }
.ev-label { font-weight: 600; color: #e2e6ef; }
.ev-detail { color: #9ca3af; font-size: 0.7rem; }
.ev-time { color: #9ca3af; font-size: 0.7rem; white-space: nowrap; flex-shrink: 0; }

/* ═══ TOAST NOTIFICATIONS ═══ */
.toast-container {
  position: fixed; top: 70px; right: 1.5rem; z-index: 500;
  display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
}
.toast {
  background: #1a1f2e; border: 1px solid #2a3550; border-radius: 8px;
  padding: 0.7rem 1rem; font-size: 0.85rem; color: #e2e6ef;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4); pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  display: flex; align-items: center; gap: 0.5rem; min-width: 260px; max-width: 400px; word-break: break-word;
}
.toast.toast-success { border-left: 3px solid #22c55e; }
.toast.toast-error { border-left: 3px solid #ef4444; }
.toast.toast-info { border-left: 3px solid #4a90f7; }
.toast.toast-out { animation: toast-out 0.3s ease-in forwards; }
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 0.5rem; }
  .kiosk-grid { grid-template-columns: 1fr; }
  .detail-panel { width: 100%; }
  .nh-metrics { grid-template-columns: repeat(2, 1fr); }
  .pw-metrics { grid-template-columns: repeat(2, 1fr); }
  .fleet-overview { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .fleet-card { padding: 0.5rem 0.6rem; }
  .fleet-value { font-size: 1.2rem; }
  .fleet-label { font-size: 0.58rem; height: 22px; }
  .nh-chart-header { flex-direction: column; gap: 0.3rem; align-items: flex-start; }
  .chart-wrapper { height: 150px; }
  .info-sensor-grid { grid-template-columns: 1fr; }
  .dp-conn-grid { grid-template-columns: 1fr; }

  /* Topbar */
  .topbar { height: auto; padding: 0.5rem 0.8rem; flex-wrap: wrap; gap: 0.5rem; }
  .topbar .logo img { height: 36px; }
  .topbar .stats { display: none; }
  .notif-bell { margin-bottom: 0; }
  .notif-panel { right: 0.5rem; left: 0.5rem; width: auto; }
  .user-menu .dropdown { right: 0; min-width: 150px; }

  /* Device toolbar */
  .device-toolbar { flex-wrap: wrap; gap: 0.4rem; }
  .device-search { width: 100%; order: 3; }
  .toolbar-select { flex: 1; min-width: 0; }

  /* List view */
  .kiosk-list table { font-size: 0.72rem; }
  .kiosk-list th, .kiosk-list td { padding: 0.4rem; }

  /* Modals */
  .modal-content { max-width: 95vw !important; margin: 0 0.5rem; padding: 1rem !important; }

  /* Cards */
  .kiosk-card { padding: 0.7rem 0.8rem; }
  .kiosk-card .card-header .name { font-size: 0.85rem; }
  .kiosk-card .card-body { font-size: 0.75rem; }
}

/* ═══ FOOTER BAR ═══ */
/* --- Monitoring Tier Bar --- */
.tier-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px; background: var(--surface, #161b26); border-bottom: 1px solid var(--border, #1e2433);
  flex-wrap: wrap; gap: 6px;
}
.tier-bar-left { display: flex; align-items: center; gap: 8px; }
.tier-bar-right { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tier-metrics-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 4px 18px 6px; background: var(--surface, #161b26);
  border-bottom: 1px solid var(--border, #1e2433);
}
.tier-bar-label { font-size: .75rem; color: var(--muted, #6b7280); font-weight: 500; }
.view-mode-toggle { display: flex; border: 1px solid var(--border, #1e2433); border-radius: 6px; overflow: hidden; }
.vmt-btn {
  font-size: .7rem; padding: 3px 12px; border: none; background: transparent;
  color: var(--muted, #6b7280); cursor: pointer; transition: all .15s;
}
.vmt-btn.active { background: #4a90f7; color: #fff; }
.vmt-btn:hover:not(.active) { background: rgba(74,144,247,.15); }
.tier-minimal-banner {
  text-align: center; padding: 30px 20px; margin: 12px 18px;
  background: var(--surface, #161b26); border: 1px dashed var(--border, #1e2433);
  border-radius: 10px;
}
/* View mode: card styles for Standard/Minimal views */
.vm-card { background: #161b26; border: 1px solid #1e2433; border-radius: 8px; padding: 12px 16px; }
.vm-card-hd { font-size: .72rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.vm-metric { flex: 1; min-width: 70px; text-align: center; padding: 6px 4px; }
.vm-metric-label { font-size: .72rem; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.vm-metric-val { font-size: 1.1rem; font-weight: 700; color: #e2e6ef; }
.vm-metric-val small { font-size: .65rem; font-weight: 400; color: #9ca3af; }

/* ═══ Standard View ═══ */
.sv-metrics {
  display: flex; gap: 2px; flex-wrap: wrap;
  background: var(--surface, #161b26); border-radius: 8px; padding: 8px 4px;
  border: 1px solid var(--border, #1e2433);
}
.sv-card {
  flex: 1; min-width: 80px; text-align: center; padding: 8px 6px;
  border-radius: 6px;
}
.sv-card.sv-sep { flex: 0 0 2px; min-width: 2px; padding: 0; background: var(--border, #1e2433); align-self: stretch; margin: 4px 4px; }
.sv-label { font-size: .65rem; color: var(--muted, #6b7280); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.sv-val { font-size: 1.15rem; font-weight: 700; color: #e2e6ef; }
.sv-section { background: #161b26; border: 1px solid #1e2433; border-radius: 8px; padding: 10px 14px; }
.sv-section-hd { font-size: .72rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.sv-info-row { display: flex; flex-wrap: wrap; gap: 16px; font-size: .8rem; color: #c8cdd8; }
.sv-info-row .sv-info-item { display: flex; flex-direction: column; }
.sv-info-row .sv-info-label { font-size: .65rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.sv-info-row .sv-info-val { font-weight: 600; color: #e2e6ef; }

/* ═══ Minimal View ═══ */
.mv-hero {
  max-width: 420px; margin: 0 auto; padding: 40px 30px;
  background: var(--surface, #161b26); border: 1px solid var(--border, #1e2433);
  border-radius: 16px;
}
.mv-status-dot {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 12px;
  box-shadow: 0 0 20px rgba(34,197,94,.3);
}
.mv-status-dot.online { background: #22c55e; box-shadow: 0 0 24px rgba(34,197,94,.4); }
.mv-status-dot.offline { background: #ef4444; box-shadow: 0 0 24px rgba(239,68,68,.4); }
.mv-status-label { font-size: 1.4rem; font-weight: 800; letter-spacing: .08em; color: var(--text, #e2e6ef); margin-bottom: 4px; }
.mv-uptime { font-size: 2rem; font-weight: 300; color: var(--text2, #c8cdd8); margin-bottom: 4px; }
.mv-lastseen { font-size: .82rem; color: var(--muted, #6b7280); margin-bottom: 16px; }
.mv-info { font-size: .78rem; color: var(--muted, #6b7280); line-height: 1.6; }
.mv-info span { display: inline-block; margin: 0 8px; }
@media (max-width: 768px) {
  .tier-bar { padding: 6px 10px; }
  .tier-bar-right { width: 100%; justify-content: flex-end; }
}

.dashboard-footer {
  position: fixed; bottom: 0; left: 240px; right: 0;
  height: 28px; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #5a6478; font-weight: 500;
  background: #0f1219; border-top: 1px solid #1e2433;
  z-index: 50; letter-spacing: 0.02em;
}
@media (max-width: 768px) {
  .dashboard-footer { left: 0; }
}
