* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: #101418; color: #e8eef2; }

header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #171d23; border-bottom: 1px solid #2a333c;
  position: relative; z-index: 3000;
}
header h1 { font-size: 18px; font-weight: 600; }

.badge {
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.badge.online { background: #14532d; color: #86efac; }
.badge.offline { background: #450a0a; color: #fca5a5; }
.badge.nodata { background: #374151; color: #d1d5db; }

#appMain { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
main { display: flex; flex: 1 1 auto; min-height: 0; }
.map-wrap { flex: 1; position: relative; }
#map { height: 100%; background: #1b2229; }

.layer-switch {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  gap: 4px;
}
.layer-btn {
  background: rgba(16, 20, 24, 0.85);
  border: 1px solid #2a333c;
  color: #e8eef2;
  padding: 6px 12px;
}
.layer-btn.active { background: #2563eb; border-color: #2563eb; }
.layer-btn:hover:not(.active) { background: #1e293b; }

.follow-switch {
  position: absolute;
  top: 50px;
  right: 10px;
  z-index: 1000;
}
.follow-switch .layer-btn { width: 100%; }

.ign { font-weight: 600; }
.ign.on { color: #16a34a; }
.ign.off { color: #6b7280; }
.ign::before { content: "●"; margin-right: 4px; }

aside {
  width: 340px; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
  background: #12181e; border-left: 1px solid #2a333c;
}

.card {
  background: #1a2129; border: 1px solid #2a333c; border-radius: 8px; padding: 12px;
}
.card h2 { font-size: 13px; text-transform: uppercase; color: #8ba0b3; margin-bottom: 8px; }

table.kv { width: 100%; font-size: 13px; border-collapse: collapse; }
table.kv td { padding: 3px 0; }
table.kv td:first-child { color: #8ba0b3; width: 45%; }
table.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.muted { color: #7a8a99; font-size: 12px; margin-top: 6px; }

button {
  background: #2563eb; color: #fff; border: 0; border-radius: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
button:hover { background: #1d4ed8; }
.btnrow { display: flex; flex-direction: column; gap: 6px; }

.cal-wrap { position: relative; margin-bottom: 8px; }
.cal-btn {
  width: 100%; text-align: left; background: #101418;
  border: 1px solid #2a333c; color: #e8eef2;
}
.cal-btn:hover { background: #1e293b; }

.cal-popup {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: #1a2129; border: 1px solid #2a333c; border-radius: 8px;
  padding: 10px; margin-top: 4px;
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 13px; }
.cal-arrow { background: none; border: 0; color: #8ba0b3; padding: 4px 8px; font-size: 12px; }
.cal-arrow:hover { color: #e8eef2; }

.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 11px; color: #7a8a99; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 12px; background: none; border: 0;
  color: #e8eef2; cursor: pointer; position: relative;
}
.cal-cell.empty { visibility: hidden; }
.cal-cell.no { color: #4b5c6b; cursor: default; }
.cal-cell.has { background: #1e3a5f; }
.cal-cell.has:hover { background: #2563eb; }
.cal-cell.sel { background: #2563eb; font-weight: 700; }
.cal-cell.has::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: #60a5fa;
}
.cal-cell.sel::after { background: #fff; }

.sms-item {
  background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  padding: 8px; margin-bottom: 8px; cursor: pointer; position: relative;
}
.sms-item .t { font-size: 12px; color: #8ba0b3; margin-bottom: 4px; }
.sms-item .c { font-size: 12px; font-family: monospace; word-break: break-all; color: #93c5fd; }
.sms-item:hover { border-color: #2563eb; }
.sms-item::after {
  content: "копировать"; position: absolute; top: 8px; right: 8px;
  font-size: 10px; color: #4b5c6b;
}

.alarm { color: #fca5a5; font-weight: 600; }
.ok { color: #86efac; }

.tracker-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: #101418; border: 1px solid #2a333c; color: #e8eef2;
  margin-bottom: 6px; text-align: left;
  cursor: pointer; user-select: none;
}
.tracker-btn.active { border-color: #2563eb; background: #17233a; }
.tracker-btn:hover { background: #1e293b; }
.tracker-btn .muted { margin-left: auto; }
.tracker-btn .tname { font-weight: 600; }

.rename {
  color: #6b7280; font-size: 14px; padding: 0 4px;
}
.rename:hover { color: #e8eef2; }

.popup { line-height: 1.5; max-width: 280px; }
.popup .addr { color: #2563eb; }

.collapsible { cursor: pointer; user-select: none; }
.collapsible:hover { color: #93c5fd; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.online { background: #4ade80; }
.dot.offline { background: #ef4444; }
.dot.nodata { background: #6b7280; }

.pin {
  width: 40px;
  height: 40px;
  position: relative;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.pin::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
}

.pin.pin-suspect {
  background: #dc2626;
  border-color: #fecaca;
  animation: suspectBlink 1s steps(2, start) infinite;
}
.suspect-wrap { position: relative; width: 40px; height: 40px; }
.suspect-wrap .pin { position: absolute; inset: 0; }
.gps-drop {
  position: absolute; width: 7px; height: 9px; background: #ef4444;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  animation: gpsDrop 1.4s ease-in-out infinite;
}
.gps-drop.drop-1 { left: 32px; top: 0; }
.gps-drop.drop-2 { left: -2px; top: 9px; animation-delay: .45s; }
.gps-dot {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: #fca5a5; animation: gpsDot 1.2s ease-in-out infinite;
}
.gps-dot.gdot-1 { right: 0; top: 20px; }
.gps-dot.gdot-2 { left: 0; bottom: 1px; animation-delay: .3s; }
.gps-dot.gdot-3 { right: 4px; bottom: -2px; animation-delay: .6s; }
.dot.suspect { background: #ef4444; animation: gpsDot 1s ease-in-out infinite; }
.badge.suspect {
  background: #450a0a; color: #fecaca; border: 1px solid #7f1d1d;
  animation: suspectBadge 1s steps(2, start) infinite;
}
.help-pin.pin-suspect { background: #ef4444; animation: suspectBlink 1s steps(2, start) infinite; }
@keyframes suspectBlink {
  0%, 100% { opacity: 1; box-shadow: 0 1px 4px rgba(0,0,0,.6), 0 0 0 0 rgba(239,68,68,.55); }
  50% { opacity: .45; box-shadow: 0 1px 4px rgba(0,0,0,.6), 0 0 0 9px rgba(239,68,68,0); }
}
@keyframes gpsDrop {
  0%, 100% { transform: translateY(0) rotate(-45deg); opacity: .9; }
  50% { transform: translateY(3px) rotate(-45deg); opacity: .45; }
}
@keyframes gpsDot {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}
@keyframes suspectBadge {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.6); }
}


/* ─── Login ─────────────────────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: #0c1014;
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: #1a2129; border: 1px solid #2a333c; border-radius: 12px;
  padding: 32px; width: 340px; text-align: center;
}
.login-logo { margin-bottom: 12px; }
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-box .muted { margin-bottom: 20px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }
.login-box input {
  background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 10px 12px; font-size: 14px;
}
.login-box input:focus { outline: none; border-color: #2563eb; }
.login-box button { padding: 10px; font-size: 14px; margin-top: 4px; }
.login-error { color: #fca5a5; font-size: 13px; min-height: 18px; }

/* ─── Header user menu ──────────────────────────────────────────────────── */
.header-right { margin-left: auto; }
.user-menu { position: relative; }
.user-btn {
  background: #1e293b; border: 1px solid #2a333c; color: #e8eef2;
  padding: 6px 12px; font-size: 13px; cursor: pointer; border-radius: 6px;
}
.user-btn:hover { background: #334155; }
.user-dropdown {
  position: absolute; top: 100%; right: 0; z-index: 5000;
  background: #1a2129; border: 1px solid #2a333c; border-radius: 8px;
  min-width: 160px; margin-top: 4px; overflow: hidden;
}
.user-dropdown-info { padding: 10px 12px; border-bottom: 1px solid #2a333c; font-size: 13px; }
.dropdown-item {
  display: block; width: 100%; text-align: left; background: none;
  border: 0; padding: 10px 12px; font-size: 13px; color: #e8eef2; cursor: pointer;
}
.dropdown-item:hover { background: #1e293b; }
.dropdown-item.danger { color: #fca5a5; }

/* ─── Admin nav ─────────────────────────────────────────────────────────── */
.admin-nav {
  display: flex; gap: 0; background: #171d23; border-bottom: 1px solid #2a333c;
  padding: 0 16px;
}
.nav-btn {
  background: none; border: 0; border-bottom: 2px solid transparent;
  text-decoration: none; display: inline-block;
  color: #8ba0b3; padding: 10px 16px; font-size: 13px; cursor: pointer;
  border-radius: 0;
}
.nav-btn:hover { color: #e8eef2; background: none; }
.nav-btn.active { color: #e8eef2; border-bottom-color: #2563eb; }

/* ─── Users panel ───────────────────────────────────────────────────────── */
.users-panel {
  flex: 1; overflow-y: auto; padding: 20px; background: #101418; min-height: 0;
}
.users-inner { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-row input[type="text"], .form-row input[type="password"] {
  background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 8px 10px; font-size: 13px; flex: 1; min-width: 120px;
}
.form-row input:focus { outline: none; border-color: #2563eb; }
.chk { font-size: 13px; color: #8ba0b3; white-space: nowrap; cursor: pointer; }
.chk.mini { font-size: 11px; }

.user-card {
  background: #101418; border: 1px solid #2a333c; border-radius: 8px;
  padding: 12px; margin-bottom: 8px;
}
.user-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-card-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.user-trackers { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tracker-chip {
  background: #1e3a5f; border: 1px solid #2563eb; border-radius: 12px;
  padding: 3px 10px; font-size: 12px; color: #93c5fd;
  display: inline-flex; align-items: center; gap: 4px;
}
.chip-x { color: #6b7280; cursor: pointer; font-weight: 700; }
.chip-x:hover { color: #fca5a5; }
.admin-badge { background: #4c1d95; color: #c4b5fd; padding: 2px 8px; border-radius: 8px; font-size: 11px; }
.me-badge { background: #14532d; color: #86efac; padding: 2px 8px; border-radius: 8px; font-size: 11px; }
.mini-btn {
  background: #1e293b; border: 1px solid #2a333c; color: #e8eef2;
  padding: 4px 8px; font-size: 11px; cursor: pointer; border-radius: 4px;
}
.mini-btn:hover { background: #334155; }
.mini-btn.danger { color: #fca5a5; border-color: #7f1d1d; }
.mini-btn.danger:hover { background: #450a0a; }
.mini-btn.accent { color: #93c5fd; border-color: #2563eb; }
.mini-btn.accent:hover { background: #17233a; }

.badge-count {
  display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px;
  border-radius: 8px; background: #ef4444; color: #fff;
  font-size: 11px; line-height: 16px; text-align: center; vertical-align: middle;
}

.events-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.event-item { padding: 8px 10px; border-bottom: 1px solid #2a333c; }
.event-item.unread { background: #17233a; }
.event-item .et { color: #8ba0b3; font-size: 12px; margin-top: 3px; }

.fence-item { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #2a333c; }
.fence-item .fname { flex: 1; font-size: 13px; }
.fence-item .fmeta { color: #8ba0b3; font-size: 11px; margin-top: 2px; }

#fenceForm input[type="text"], #fenceForm input[type="number"], #fenceForm select {
  width: 100%; margin-bottom: 6px; background: #101418; border: 1px solid #2a333c;
  border-radius: 6px; color: #e8eef2; padding: 7px 9px; font-size: 13px;
}
#fenceForm input[type="text"]:focus, #fenceForm input[type="number"]:focus, #fenceForm select:focus {
  outline: none; border-color: #2563eb;
}
#fenceForm .chk {
  display: flex; align-items: center; justify-content: flex-start; gap: 6px;
  text-align: left; width: 100%; margin: 4px 0 8px;
}
#fenceForm .chk input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; }
#fenceForm .btnrow { flex-direction: row; }
#fenceForm .btnrow button { flex: 1; }
#fenceRadiusHint { font-size: 11px; margin: -2px 0 6px; }
#map.drawing .leaflet-interactive,
#map.drawing .leaflet-marker-icon,
#map.drawing .leaflet-overlay-pane,
#map.drawing .leaflet-marker-pane,
#map.drawing .leaflet-popup-pane { pointer-events: none !important; }

.code {
  display: inline-block; padding: 3px 8px; background: #0f151a; border: 1px solid #2a333c;
  border-radius: 5px; font-family: monospace; font-size: 14px; color: #93c5fd;
}
.sep { border: none; border-top: 1px solid #2a333c; margin: 12px 0; }
.notify-quiet { margin: 10px 0; }
.notify-quiet input[type="time"] {
  background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 5px 7px;
}
.notify-email { margin: 8px 0; }
.notify-email input { width: 100%; }
#notifyEmail, #smtpHost, #smtpPort, #smtpUser, #smtpPass {
  width: 100%; background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 8px 10px; margin-bottom: 6px;
}
#notifyEmail:focus, #smtpHost:focus, #smtpPort:focus, #smtpUser:focus, #smtpPass:focus {
  outline: none; border-color: #2563eb;
}
#smtpCard .btnrow { flex-direction: row; }
.user-email { font-size: 12px; color: #8ba0b3; margin: 2px 0 4px; }

.speed-row { display: flex; gap: 6px; }
.speed-row input {
  flex: 1; width: auto; background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 7px 9px; font-size: 13px;
}
.speed-row input:focus { outline: none; border-color: #2563eb; }
.speed-row button { flex: 0 0 auto; }
.nowork-days { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 6px 0; }
.nowork-days .chk { margin: 0; }
#noworkCard .notify-quiet { display: flex; align-items: center; gap: 6px; }

.report-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.report-controls select, .report-controls input[type="date"] {
  background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 6px 8px; font-size: 12px;
}
.rep-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.rep-summary .item { background: #0f151a; border: 1px solid #2a333c; border-radius: 6px; padding: 8px 10px; }
.rep-summary .item b { display: block; font-size: 16px; }
.rep-summary .item span { color: #8ba0b3; font-size: 10px; text-transform: uppercase; }
.rep-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rep-tab {
  background: #1e293b; border: 1px solid #2a333c; color: #e8eef2;
  padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.rep-tab.active { background: #2563eb; border-color: #2563eb; }
.rep-actions { margin-bottom: 8px; display: flex; gap: 6px; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rep-table th, .rep-table td { padding: 6px 8px; border-bottom: 1px solid #2a333c; text-align: left; }
.rep-table th { color: #8ba0b3; font-weight: 600; }

#pbBox { margin-top: 8px; }
.pb-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
#pbSlider { flex: 1; }
#pbSpeed {
  background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 4px 6px; font-size: 12px;
}

.poi-item { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #2a333c; }
.poi-item .picon { font-size: 16px; }
.poi-item .pname { flex: 1; font-size: 13px; }
.poi-icon {
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: rgba(16, 20, 24, 0.85); border: 1px solid #2a333c; border-radius: 50%;
}
#poiForm input[type="text"], #poiForm select {
  width: 100%; margin-bottom: 6px; background: #101418; border: 1px solid #2a333c;
  border-radius: 6px; color: #e8eef2; padding: 7px 9px; font-size: 13px;
}
#poiForm .btnrow { flex-direction: row; }
#poiForm .btnrow button { flex: 1; }
#trackerPhone {
  width: 100%; background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 7px 9px; font-size: 13px; margin-bottom: 6px;
}
#smsText {
  width: 100%; background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 7px 9px; font-size: 13px; margin: 6px 0;
}
#alertsCard .chk { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
#alertsCard .chk input { flex: 0 0 auto; }
#alertsSave { margin-top: 4px; }
#alertsMsg { font-size: 11px; margin-top: 6px; }

.all-tracker-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid #1e293b; font-size: 13px; flex-wrap: wrap;
}
.all-tracker-row:last-child { border-bottom: 0; }
.assign-sel {
  background: #101418; border: 1px solid #2a333c; border-radius: 4px;
  color: #e8eef2; padding: 3px 6px; font-size: 12px; margin-left: auto;
}
.owner-tag {
  background: #1e3a5f; color: #93c5fd; padding: 1px 8px; border-radius: 8px;
  font-size: 11px;
}
.owner-tag.none { background: #2a2a2a; color: #6b7280; }

/* ─── Tracker list extras ───────────────────────────────────────────────── */
.user-filter { margin-bottom: 8px; }
.user-filter select {
  width: 100%; background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 6px 8px; font-size: 12px;
}

@media (max-width: 800px) {
  main { flex-direction: column; overflow-y: auto; }  aside { width: 100%; border-left: 0; border-top: 1px solid #2a333c; overflow: visible; }
  #map { min-height: 45vh; }
}

/* ─── Help ──────────────────────────────────────────────────────────────── */
.help-panel { scroll-behavior: smooth; }
.help-inner { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.help-hero h1 { font-size: 24px; margin-bottom: 4px; }
.help-hero p { margin: 4px 0; }
.help-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; }
.help-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #b6c2ce; }
.help-pin {
  width: 24px; height: 24px; flex-shrink: 0; position: relative;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6);
  display: inline-block; margin: 0 2px 6px 0;
}
.help-pin::after {
  content: ""; position: absolute; width: 8px; height: 8px; top: 50%; left: 50%;
  transform: translate(-50%, -50%); background: #fff; border-radius: 50%;
}
.help-pin.pin-sel { background: #2563eb; }
.help-pin.pin-unsel { background: #eab308; }
.help-pin.pin-nodata { background: #6b7280; }
.help-pin.pin-lost { background: #ef4444; }

.help-toc { background: #171d23; border: 1px solid #2a333c; border-radius: 10px; padding: 16px; }
.help-toc h2 { font-size: 16px; margin-bottom: 10px; }
.help-toc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.help-toc a { color: #93c5fd; text-decoration: none; font-size: 13px; padding: 3px 0; display: block; }
.help-toc a:hover { color: #e8eef2; text-decoration: underline; }

.help-sec { background: #171d23; border: 1px solid #2a333c; border-radius: 10px; padding: 18px; scroll-margin-top: 8px; }
.help-sec h2 { font-size: 17px; margin-bottom: 10px; }
.help-sec h3 { font-size: 14px; margin: 16px 0 6px; color: #cbd5e1; }
.help-sec p, .help-sec li { font-size: 13px; line-height: 1.6; color: #b6c2ce; }
.help-sec p { margin: 6px 0; }
.help-sec ul, .help-sec ol { margin: 6px 0 6px 22px; }
.help-sec li { margin: 4px 0; }
.help-sec b { color: #e8eef2; }
.help-sec a { color: #93c5fd; }

.help-note { border-left: 3px solid #2563eb; background: #122033; padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 12px 0; font-size: 13px; line-height: 1.55; color: #b6c2ce; }
.help-warn { border-left: 3px solid #f59e0b; background: #2a2112; padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 12px 0; font-size: 13px; line-height: 1.55; color: #f3d9a4; }

.help-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.help-btn {
  background: #1e293b; border: 1px solid #2a333c; color: #e8eef2;
  padding: 4px 9px; font-size: 11px; border-radius: 4px; display: inline-block;
  text-decoration: none;
}
.help-btn:hover { background: #334155; }
.help-btn.primary { color: #93c5fd; border-color: #2563eb; }
.help-btn.danger { color: #fca5a5; border-color: #7f1d1d; }

.help-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.help-table th, .help-table td { border-bottom: 1px solid #2a333c; padding: 6px 8px; text-align: left; vertical-align: top; }
.help-table th { color: #8ba0b3; font-weight: 600; }
.help-table tr:last-child td { border-bottom: 0; }

.help-code {
  display: block; background: #0c1014; border: 1px solid #2a333c; border-radius: 6px;
  padding: 8px 10px; font-family: Consolas, "Courier New", monospace; font-size: 12px;
  color: #93c5fd; margin: 6px 0; overflow-x: auto; white-space: pre-wrap;
}
code { background: #0c1014; border: 1px solid #2a333c; border-radius: 4px; padding: 1px 5px; font-size: 12px; color: #93c5fd; }

.help-fig { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.help-fig .item { background: #101418; border: 1px solid #2a333c; border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-width: 210px; }
.help-fig .item .txt { font-size: 12px; color: #b6c2ce; line-height: 1.4; }
.help-fig .item .txt b { display: block; color: #e8eef2; font-size: 13px; }

.help-mock { background: #101418; border: 1px solid #2a333c; border-radius: 8px; padding: 10px; margin: 10px 0; }
.help-mock .tracker-btn { margin: 0; }
.help-mock .kv td { font-size: 12px; }
.help-mock .kv td:first-child { color: #8ba0b3; }

.help-state { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; font-size: 13px; color: #b6c2ce; line-height: 1.5; }
.help-state .dot { margin-top: 6px; }
.help-top-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 4000;
  width: 40px; height: 40px; border-radius: 50%;
  background: #1e293b; border: 1px solid #2a333c; color: #93c5fd;
  font-size: 18px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.help-top-btn:hover { background: #334155; }

@media (max-width: 800px) {
  header h1 { font-size: 14px; line-height: 1.2; }
  .admin-nav { flex-wrap: wrap; overflow-x: visible; padding: 0 8px; }
  .nav-btn { flex: 0 0 auto; padding: 8px 10px; font-size: 12px; }
  .help-toc-grid { grid-template-columns: 1fr; }
  .help-sec { padding: 14px; }
  .help-inner { gap: 12px; }
  .help-fig .item { min-width: 100%; }
}


/* ─── Modal ─────────────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 7000; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  background: #1a2129; border: 1px solid #2a333c; border-radius: 10px;
  padding: 18px; width: 360px; max-width: 100%;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.modal-box h2 { font-size: 16px; }
.modal-box input {
  width: 100%; background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 9px 10px; font-size: 14px;
}
.modal-box input:focus { outline: none; border-color: #2563eb; }
.modal-box .btnrow { flex-direction: row; justify-content: flex-end; }
.modal-box #pwMsg { min-height: 18px; font-size: 12px; margin: 0; }
/* ─── Auth / registration ───────────────────────────────────────────────── */
.login-screen { overflow-y: auto; padding: 16px; }
.login-box { margin: auto; }
.auth-switch { margin-top: 10px; font-size: 13px; }
.auth-switch a { color: #93c5fd; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-legal { font-size: 11px; color: #7a8a99; line-height: 1.4; margin: 0; text-align: left; }
.auth-legal a { color: #93c5fd; text-decoration: none; }
.auth-legal a:hover { text-decoration: underline; }
#registerMsg { min-height: 18px; }

/* ─── Users search / activation ─────────────────────────────────────────── */
#userSearch {
  width: 100%; background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 8px 10px; font-size: 13px; margin-bottom: 8px;
}
#userSearch:focus { outline: none; border-color: #2563eb; }
.user-card-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.activation-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 8px; white-space: nowrap;
}
.activation-badge.active { background: #14532d; color: #86efac; }
.activation-badge.inactive { background: #450a0a; color: #fca5a5; }
.pw-hint { font-size: 11px; color: #7a8a99; margin: -4px 0 0; text-align: left; }
/* ─── Login journal ─────────────────────────────────────────────────────── */
.journal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.journal-head h2 { margin: 0; }
#journalMsg { font-size: 12px; margin: 0 0 6px; }
.journal-row {
  font-size: 14px; line-height: 1.45; color: #b6c2ce;
  padding: 5px 0; border-bottom: 1px solid #2a333c;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.journal-row:last-child { border-bottom: 0; }
.j-time, .j-sep { color: #8ba0b3; white-space: nowrap; }
.j-ip { color: #e8eef2; }
.j-user { color: #f5d76e; }
.j-action { color: #93c5fd; }
.j-details { color: #b6c2ce; }
.j-ok { color: #86efac; }
.j-no { color: #fca5a5; }
/* Payment / my trackers */
.pay-warning {
  background: #2a2413; border: 1px solid #6b5a1e; color: #fde68a;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45;
  margin: 4px 0 12px;
}
.pay-tracker {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid #2a333c;
}
.pay-tracker:last-child { border-bottom: 0; }
.pay-tracker-main { min-width: 0; overflow-wrap: anywhere; }
.pay-status { font-size: 13px; margin: 4px 0; }
.pay-ok { color: #86efac; }
.pay-no { color: #fbbf24; }
.pay-tracker-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pay-selected { font-weight: 600; color: #e8eef2; margin: 0 0 4px; }
.tariff-list {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px;
}
.tariff-btn {
  background: #101418; border: 1px solid #2a333c; border-radius: 8px;
  color: #e8eef2; padding: 12px 10px; cursor: pointer; text-align: center;
}
.tariff-btn b { display: block; font-size: 16px; margin-bottom: 4px; }
.tariff-btn span { color: #93c5fd; font-size: 13px; }
.tariff-btn:hover { border-color: #2563eb; background: #16202b; }
.tariff-btn:disabled, .mini-btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 700px) {
  .pay-tracker { flex-direction: column; }
  .pay-tracker-actions { align-self: stretch; }
  .tariff-list { grid-template-columns: 1fr; }
}

/* Journal filters / pagination */
.journal-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 6px 0 10px;
}
.journal-filters input,
.journal-filters select {
  background: #101418; border: 1px solid #2a333c; border-radius: 6px;
  color: #e8eef2; padding: 7px 9px; font-size: 13px; min-width: 0;
}
.journal-filters input[type="date"] { width: 145px; }
.journal-filters input[type="text"] { flex: 1 1 180px; }
.journal-filters select { flex: 1 1 190px; }
.journal-filters input:focus,
.journal-filters select:focus { outline: none; border-color: #2563eb; }
.journal-pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #2a333c;
  color: #8ba0b3; font-size: 12px;
}
@media (max-width: 700px) {
  .journal-filters input[type="date"] { width: 100%; flex: 1 1 130px; }
}
