/* ─── RustIQ Dashboard – shared styles for /dashboard/* pages ─── */

.dash-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 94px max(16px, env(safe-area-inset-left, 0px)) 50px max(16px, env(safe-area-inset-right, 0px));
  position: relative;
  z-index: 1;
  flex: 1;
  animation: fadeUp 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 94px;
  align-self: start;
  padding: 14px 10px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.dash-sidebar-section {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 12px 6px;
}

.dash-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.dash-sidebar a:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
}
.dash-sidebar a.active {
  background: rgba(90,156,245,0.13);
  color: var(--accent-2);
}
.dash-sidebar a.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(90,156,245,0.6);
}
.dash-sidebar a { position: relative; }

.dash-sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-sidebar-icon svg { width: 18px; height: 18px; }

/* ─── Per-nav-item customization ───────────────────────────────────────────
   Icon size:   .dash-sidebar a[data-nav-key="KEY"] .dash-sidebar-icon svg { width: Xpx; height: Xpx; }
   Active line: .dash-sidebar a[data-nav-key="KEY"].active::before { width: Xpx; height: Xpx; }

   Keys: home | servers | server | events | teamchat | activity |
         devices | trackers | commands | settings
   ────────────────────────────────────────────────────────────────────────── */

/* ─── Per-page individual SVG icon customization ────────────────────────────
   Every SVG icon has a unique class. Change width/height for size,
   stroke-width for line thickness. Example:
     .svg-events-title       { stroke-width: 1.5; }   — Events page title icon
     .svg-filter-heli        { width: 20px; height: 20px; } — Heli filter tab

   EVENTS page:
     .svg-events-title       — page title icon
     .svg-events-panel       — "Events" panel header icon
     .svg-filter-heli        — filter tab: Heli
     .svg-filter-cargo       — filter tab: Cargo
     .svg-filter-oil         — filter tab: Oil Rig
     .svg-filter-bradley     — filter tab: Bradley
     .svg-filter-ch47        — filter tab: CH47
     .svg-filter-locked      — filter tab: Locked Crate
     .svg-filter-vending     — filter tab: Vending
     .svg-filter-merchant    — filter tab: Travelling Vendor
     .svg-filter-deepsea     — filter tab: Deep Sea

   TEAM CHAT page:
     .svg-teamchat-title     — page title icon
     .svg-teamchat-panel     — "Recent Messages" panel header icon

   ACTIVITY page:
     .svg-activity-title     — page title icon

   SMART DEVICES page:
     .svg-devices-title      — page title icon
     .svg-tab-switches       — tab: Switches
     .svg-tab-groups         — tab: Groups
     .svg-tab-alarms         — tab: Alarms
     .svg-tab-storage        — tab: Storage Monitors
     .svg-panel-switches     — panel header: Smart Switches
     .svg-panel-groups       — panel header: Switch Groups
     .svg-panel-alarms       — panel header: Smart Alarms
     .svg-panel-storage      — panel header: Storage Monitors

   SETTINGS page:
     .svg-settings-title     — page title icon
     .svg-tab-account        — tab: Account
     .svg-tab-bot            — tab: Bot
     .svg-tab-ingame         — tab: In-game notification
     .svg-tab-alerts         — tab: Alerts
     .svg-panel-rustplus     — panel header: Rust+ Credentials
     .svg-panel-subscription — panel header: Subscription
     .svg-panel-ingame       — panel header: In-game notification
     .svg-panel-bot          — panel header: General Bot Settings
     .svg-panel-alerts       — panel header: Alert Preferences
   ────────────────────────────────────────────────────────────────────────── */

/* ─── EVENTS ─────────────────────────────────────────────── */
.svg-events-title   { width: 26px; height: 26px; stroke-width: 2; }
.svg-events-panel   { width: 16px; height: 16px; stroke-width: 2; }
.svg-filter-heli    { width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-cargo   { width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-oil     { width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-bradley { width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-ch47    { width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-locked  { width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-vending { width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-merchant{ width: 22px; height: 22px; stroke-width: 2; }
.svg-filter-deepsea { width: 22px; height: 22px; stroke-width: 2; }

/* ─── TEAM CHAT ──────────────────────────────────────────── */
.svg-teamchat-title { width: 26px; height: 26px; stroke-width: 2; }
.svg-teamchat-panel { width: 16px; height: 16px; stroke-width: 2; }

/* ─── ACTIVITY ───────────────────────────────────────────── */
.svg-activity-title { width: 26px; height: 26px; stroke-width: 2; }

/* ─── SMART DEVICES ──────────────────────────────────────── */
.svg-devices-title   { width: 26px; height: 26px; stroke-width: 2; }
.svg-tab-switches    { width: 18px; height: 18px; stroke-width: 2; }
.svg-tab-groups      { width: 18px; height: 18px; stroke-width: 2; }
.svg-tab-alarms      { width: 18px; height: 18px; stroke-width: 2; }
.svg-tab-storage     { width: 18px; height: 18px; stroke-width: 2; }
.svg-panel-switches  { width: 16px; height: 16px; stroke-width: 2; }
.svg-panel-groups    { width: 16px; height: 16px; stroke-width: 2; }
.svg-panel-alarms    { width: 16px; height: 16px; stroke-width: 2; }
.svg-panel-storage   { width: 16px; height: 16px; stroke-width: 2; }

/* ─── SETTINGS ───────────────────────────────────────────── */
.svg-settings-title      { width: 26px; height: 26px; stroke-width: 2; }
.svg-tab-account         { width: 22px; height: 22px; stroke-width: 2; }
.svg-tab-bot             { width: 22px; height: 22px; stroke-width: 2; }
.svg-tab-ingame          { width: 22px; height: 22px; stroke-width: 2; }
.svg-tab-alerts          { width: 22px; height: 22px; stroke-width: 2; }
.svg-panel-rustplus      { width: 16px; height: 16px; stroke-width: 2; }
.svg-panel-subscription  { width: 16px; height: 16px; stroke-width: 2; }
.svg-panel-ingame        { width: 18px; height: 18px; stroke-width: 2; }
.svg-panel-bot           { width: 16px; height: 16px; stroke-width: 2; }
.svg-panel-alerts        { width: 16px; height: 16px; stroke-width: 2; }

.dash-sidebar-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent-2);
}
.dash-sidebar-badge.green {
  background: var(--green-dim);
  border-color: var(--green-border);
  color: var(--green);
}

/* ─── Main content area ────────────────────────────────────── */
.dash-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-page-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-1);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-page-title svg { color: var(--accent); flex-shrink: 0; }
.dash-page-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-3);
}

/* ─── Server selector ───────────────────────────────────────── */
.server-select-wrap {
  position: relative;
  min-width: 240px;
}
.server-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s;
}
.server-select:hover { border-color: rgba(90,156,245,0.35); }
.server-select-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--green); box-shadow: 0 0 8px rgba(62,207,135,0.6); }
.server-select-dot.offline { background: var(--text-3); box-shadow: none; }
.server-select-text { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-select-arrow { opacity: 0.6; flex-shrink: 0; transition: transform 0.2s; }
.server-select.open .server-select-arrow { transform: rotate(180deg); }

.server-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(6,14,28,0.97);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  backdrop-filter: blur(20px);
}
.server-select-dropdown.open { display: block; }
.server-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.server-option:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.server-option.active { background: rgba(90,156,245,0.13); color: var(--accent-2); font-weight: 700; }
.server-option-info { flex: 1; min-width: 0; }
.server-option-name { font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-option-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ─── Generic content panel (reused on every page) ────────── */
.dpanel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.dpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dpanel-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-1);
}
.dpanel-head h3 svg { color: var(--accent); flex-shrink: 0; width: 18px; height: 18px; }
.dpanel-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Tab pills ─────────────────────────────────────────────── */
.dtabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dtab {
  padding: 8px 16px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dtab svg { flex-shrink: 0; width: 22px; height: 22px; }
.dtab:hover { color: var(--text-1); }
.dtab.active {
  background: rgba(90,156,245,0.18);
  color: var(--accent-2);
}
.dtab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-3);
}
.dtab.active .dtab-badge { background: rgba(90,156,245,0.25); color: var(--accent-2); }

.dtab-panel { display: none; }
.dtab-panel.active { display: block; }

/* ─── Event filter dropdown (multi-select) ─────────────────── */
.evt-filter-dropdown {
  position: relative;
  z-index: 10;
}
.evt-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.evt-filter-btn:hover {
  background: rgba(255,255,255,0.09);
  color: var(--text-1);
}
.evt-filter-dropdown.open .evt-filter-btn {
  background: rgba(90,156,245,0.14);
  border-color: rgba(90,156,245,0.35);
  color: var(--accent-2);
}
.evt-filter-dropdown.filtered .evt-filter-btn {
  background: rgba(90,156,245,0.14);
  border-color: rgba(90,156,245,0.35);
  color: var(--accent-2);
}
.evt-filter-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.evt-filter-dropdown.open .evt-filter-chevron {
  transform: rotate(180deg);
}
.evt-filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  min-width: 220px;
  background: var(--surface, #1a1d24);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}
.evt-filter-dropdown.open .evt-filter-menu {
  display: block;
  animation: evtMenuIn 0.15s ease;
}
@keyframes evtMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.evt-filter-menu-inner {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.evt-filter-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.evt-filter-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-1);
}
.evt-filter-item input[type="checkbox"] {
  display: none;
}
.evt-filter-check {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
  position: relative;
}
.evt-filter-check::after {
  content: '';
  display: none;
  width: 9px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.evt-filter-item input[type="checkbox"]:checked ~ .evt-filter-check {
  background: var(--accent, #5a9cf5);
  border-color: var(--accent, #5a9cf5);
}
.evt-filter-item input[type="checkbox"]:checked ~ .evt-filter-check::after {
  display: block;
}
.evt-filter-item input[type="checkbox"]:checked ~ .evt-filter-item-label {
  color: var(--text-1);
}
.evt-filter-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.75;
}
.evt-filter-item--all {
  font-weight: 800;
}
.evt-filter-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 4px 4px;
}
/* active-filter tags shown next to the button */
.evt-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 10px;
  background: rgba(90,156,245,0.14);
  border: 1px solid rgba(90,156,245,0.28);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-2);
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: background 0.12s, border-color 0.12s;
}
.evt-filter-tag:hover {
  background: rgba(90,156,245,0.25);
  border-color: rgba(90,156,245,0.5);
}
.evt-filter-tag svg {
  opacity: 0.6;
  flex-shrink: 0;
  transition: opacity 0.12s;
}
.evt-filter-tag:hover svg { opacity: 1; }

/* ─── Generic table ────────────────────────────────────────── */
.dtable {
  width: 100%;
  border-collapse: collapse;
}
.dtable thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dtable tbody td {
  padding: 12px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dtable tbody tr:hover td { background: rgba(255,255,255,0.02); }
.dtable tbody tr:last-child td { border-bottom: none; }

/* ─── Device cards grid (switches/alarms/monitors) ─────────── */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.device-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s;
}
.device-card:hover { border-color: rgba(90,156,245,0.35); transform: translateY(-2px); }
.device-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.device-card-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}
.device-card-loc {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}
.device-card-body {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.device-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ─── Toggle switch ────────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #39cd84 0%, #228a54 100%);
  border-color: rgba(62,207,135,0.5);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Empty state inside dpanel ────────────────────────────── */
.dempty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-3);
}
.dempty svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
  margin-bottom: 12px;
}
.dempty h4 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.dempty p {
  font-size: 13px;
  line-height: 1.55;
  max-width: 320px;
  margin: 0 auto;
}

/* ─── Form controls ────────────────────────────────────────── */
.dform-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.dform-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-3);
}
.dform-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.dinput,
.dselect {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--text-1);
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.dselect {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.dselect option {
  background: #1a1f2e;
  color: var(--text-1);
}

/* ─── Custom dropdown ──────────────────────────────────────── */
.cdropdown {
  position: relative;
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
}
.cdropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cdropdown-trigger.has-value { color: var(--text-1); }
.cdropdown-trigger:hover,
.cdropdown.open .cdropdown-trigger {
  border-color: var(--accent);
  background: rgba(0,0,0,0.4);
}
.cdropdown-trigger svg { flex-shrink: 0; transition: transform .2s; }
.cdropdown.open .cdropdown-trigger svg { transform: rotate(180deg); }
.cdropdown-list {
  display: none;
  position: fixed;
  background: #181c27;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow-y: auto;
  max-height: 240px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  min-width: 200px;
}
.cdropdown.open .cdropdown-list { display: block; }
.cdropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.cdropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--text-1); }
.cdropdown-item.selected { color: var(--accent); }
.cdropdown-item.disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.dinput:focus,
.dselect:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0,0,0,0.4);
}

/* ─── Server map preview ───────────────────────────────────── */
.map-preview {
  width: 100%;
  aspect-ratio: 1;
  max-width: 560px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1a2c4a, #0d1a30);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  user-select: none;
  -webkit-user-select: none;
}
.map-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rust-leaflet-map { width: 100%; height: 100%; }

/* ─── Stat tile (smaller variant) ──────────────────────────── */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stat-tile {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 16px;
}
.stat-tile-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.stat-tile-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.1;
}
.stat-tile-value.accent { color: var(--accent-2); }
.stat-tile-value.gold { color: #e7b25a; }
.stat-tile-value.green { color: var(--green); }
.stat-tile-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ─── Chat / log list ──────────────────────────────────────── */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 8px;
}
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--accent);
}
.log-item.event-heli  { border-left-color: var(--red); }
.log-item.event-cargo { border-left-color: #d68f2e; }
.log-item.event-oil   { border-left-color: #b865f5; }
.log-item.event-deepsea { border-left-color: var(--accent); }
.log-item.event-vending { border-left-color: var(--green); }
.log-item.event-locked { border-left-color: var(--green); }
.log-item-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.log-item-body { flex: 1; min-width: 0; }
.log-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
}
.log-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}
.log-item-meta b { color: var(--text-2); font-weight: 700; }

/* ─── Tracker player row ───────────────────────────────────── */
.player-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 6px;
}
.player-row:hover { border-color: rgba(255,255,255,0.10); }
.player-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-2);
  font-weight: 800;
}
.player-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.player-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.player-status.online .player-status-dot { background: var(--green); box-shadow: 0 0 8px rgba(62,207,135,0.6); }
.player-status.online { color: var(--green); }
.player-status.afk .player-status-dot { background: #ffa940; box-shadow: 0 0 8px rgba(255,169,64,0.55); }
.player-status.afk { color: #ffa940; }
.player-status.dead .player-status-dot { background: #ff5454; box-shadow: 0 0 8px rgba(255,84,84,0.55); }
.player-status.dead { color: #ff5454; }
.player-status.afk .player-status-dot,
.player-status.dead .player-status-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(62,207,135,0.6);
}
.player-status.offline .player-status-dot,
.player-status.dead.offline .player-status-dot {
  background: var(--text-3);
  box-shadow: none;
}
.player-status-content {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(127,148,178,0.22);
  background: rgba(127,148,178,0.08);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.status-chip.online {
  color: var(--green);
  border-color: rgba(62,207,135,0.32);
  background: rgba(62,207,135,0.09);
}
.status-chip.afk {
  color: #ffa940;
  border-color: rgba(255,169,64,0.32);
  background: rgba(255,169,64,0.09);
}
.status-chip.dead {
  color: #ff5454;
  border-color: rgba(255,84,84,0.34);
  background: rgba(255,84,84,0.09);
}
.player-time {
  font-size: 11px;
  color: var(--text-3);
  font-family: ui-monospace, monospace;
}
.player-grid-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(90,156,245,0.28);
  background: rgba(90,156,245,0.10);
  color: var(--text-1);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-shell { grid-template-columns: 1fr; gap: 12px; }
  .dash-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    padding: 8px;
  }
  .dash-sidebar-section { display: none; }
  .dash-sidebar a {
    padding: 8px 12px;
    font-size: 12px;
  }
  .dash-sidebar a.active::before { display: none; }
  .dash-sidebar-badge { display: none; }
}
@media (max-width: 600px) {
  .dash-page-title { font-size: 22px; }
  .dpanel { padding: 16px 16px; }
  .map-preview { max-width: 100%; }
  .player-row { grid-template-columns: 28px 1fr auto; }
  .player-row .player-time { display: none; }
}
/* ─── Дополнения к dashboard-shared.css ───
   Вставить эти блоки В КОНЕЦ существующего файла dashboard-shared.css.
   Никакие старые правила не удалять/менять. */


/* ─── Sidebar: sub-label под пунктом меню ──────────────────── */
/* (Используется для "Smart devices" / "switches, alarms, storage") */

.dash-sidebar a .dash-sidebar-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
  line-height: 1.15;
}
.dash-sidebar-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.2px;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-sidebar a.active .dash-sidebar-sub {
  color: var(--accent-2);
  opacity: 0.75;
}

/* ─── Sidebar: numeric badge (events / chat / activity counters) ── */
/* Default .dash-sidebar-badge style stays, but for numbers we use
   accent color (blue/gold) to stand out among the icons. */

.dash-sidebar a .dash-sidebar-badge {
  margin-left: auto;
  min-width: 22px;
  text-align: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  animation: badgePop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-sidebar a.active .dash-sidebar-badge {
  background: rgba(90,156,245,0.25);
  color: var(--accent-2);
}
@keyframes badgePop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* На мобильной раскладке badges скрыты — оставляем как было */


/* ─── Empty state: "no server connected" ──────────────────── */

.no-server-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 28px;
  background: var(--panel-bg);
  border: 1px dashed rgba(90, 156, 245, 0.25);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.no-server-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(90, 156, 245, 0.08);
  border: 1px solid rgba(90, 156, 245, 0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  margin-bottom: 18px;
}
.no-server-empty-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.3px;
  margin: 0 0 8px;
}
.no-server-empty-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 380px;
  margin: 0 0 18px;
}
.no-server-empty-cta {
  padding: 10px 22px !important;
  font-size: 13px !important;
}


/* ─── Activity: двухколоночная раскладка ──────────────────── */

.activity-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.activity-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.activity-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-2);
  padding: 0 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.activity-col-head .activity-col-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-col-head.smart .activity-col-dot { background: var(--accent); box-shadow: 0 0 6px rgba(90,156,245,0.6); }
.activity-col-head.players .activity-col-dot { background: var(--green); box-shadow: 0 0 6px rgba(62,207,135,0.6); }

.activity-col .log-list {
  max-height: 520px;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 6px;
}

@media (max-width: 900px) {
  .activity-cols { grid-template-columns: 1fr; }
}


/* ─── Player name → Steam profile link (на /server) ───────── */

.player-name-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-1);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s;
}
.player-name-link:hover {
  color: var(--accent-2);
  text-decoration: none;
}
.player-name-link .player-name-arrow {
  display: inline-flex;
  opacity: 0.5;
  transition: transform 0.15s, opacity 0.15s;
}
.player-name-link:hover .player-name-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* ─── Status dot (generic) ─────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px rgba(62,207,135,0.55); }
.status-dot.offline { background: rgba(255,255,255,0.15); box-shadow: none; }

/* ─── player-name-link visited fix ─────────────────────── */
.player-name-link:visited { color: var(--text-1); }
.player-name-link:visited:hover { color: var(--accent-2); }

/* Steam avatar img inside .player-avatar / .ov-team-avatar */
.player-avatar img,
.ov-team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ─── Custom select (csel) — shared across all dashboard pages ── */
.csel { position: relative; width: 100%; }
.csel-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px; cursor: pointer;
  color: var(--text-1); font-size: 14px; font-family: inherit;
  text-align: left; transition: border-color 0.15s; user-select: none;
}
.csel-trigger:hover { border-color: rgba(90,156,245,0.5); }
.csel.open .csel-trigger { border-color: var(--accent); }
.csel-trigger .fi { width: 20px; height: 15px; border-radius: 2px; flex-shrink: 0; }
.csel-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csel-arrow { color: var(--text-3); flex-shrink: 0; transition: transform 0.2s; }
.csel.open .csel-arrow { transform: rotate(180deg); }
.csel-menu {
  display: none; position: absolute;
  z-index: 99999; background: rgba(6,14,30,0.98);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 12px;
  max-height: 240px; overflow-y: auto; padding: 5px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}
/* Portal menus are appended to body and positioned via JS */
.csel-menu-portal { position: fixed; }
.csel-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-1); transition: background 0.1s;
}
.csel-opt:hover { background: rgba(90,156,245,0.10); }
.csel-opt.active { background: rgba(90,156,245,0.14); color: var(--accent); }
.csel-opt .fi { width: 20px; height: 15px; border-radius: 2px; flex-shrink: 0; }
.csel-role-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.csel-prefix-char {
  font-size: 16px; font-weight: 800; font-family: 'Rajdhani', monospace;
  color: var(--accent); width: 22px; text-align: center; flex-shrink: 0;
}
.csel-placeholder { color: var(--text-3); }

/* Arrow link hover animation (shared across all dashboard pages) */
.sub-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-2); text-decoration: none; font-weight: 600;
  transition: color 0.18s;
}
.dash-tile-link {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--accent-2); text-decoration: none; font-weight: 700;
  transition: color 0.18s;
}
.sub-link-arrow {
  display: inline-block;
  transition: transform 0.18s, opacity 0.18s;
  opacity: 0.5;
}
.sub-link:hover { color: var(--accent); }
.sub-link:hover .sub-link-arrow { transform: translateX(3px); opacity: 1; }
.dash-tile-link:hover { color: var(--accent); }
.dash-tile-link:hover .sub-link-arrow { transform: translateX(3px); opacity: 1; }
