:root {
  --primary-dark: #021f3d;
  --primary: #0a6ee8;
  --accent: #00c2ff;
  --light-bg: #e8f4ff;
  --text: #1a1a2e;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --sidebar-w: 280px;
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: #f8fafc;
  line-height: 1.7;
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
}

.header-logo {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: 24px;
  color: #fff;
  text-decoration: none;
  letter-spacing: -1px;
}

.header-logo span { color: var(--accent); }

.header-search {
  flex: 1;
  max-width: 400px;
  margin-left: auto;
}

.header-search input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search input:focus { border-color: var(--accent); }

.header-version {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
  z-index: 90;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 12px;
}

.sidebar-section:first-child { margin-top: 0; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar a:hover {
  background: var(--light-bg);
  color: var(--primary);
}

.sidebar a.active {
  background: var(--light-bg);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar a .icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  opacity: 0.7;
}

/* ── Content ── */
.content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 40px;
  max-width: 900px;
}

.content h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 8px;
  line-height: 1.2;
}

.content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--light-bg);
}

.content h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin: 28px 0 12px;
}

.content p { margin-bottom: 16px; }

.content ul, .content ol {
  margin: 0 0 16px 24px;
}

.content li { margin-bottom: 6px; }

.content code {
  background: var(--light-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--primary-dark);
}

.content pre {
  background: var(--primary-dark);
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}

.content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.subtitle {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 32px;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--primary);
}

.card-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--primary-dark);
  border: none;
  padding: 0;
}

.card p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Tables ── */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}

.content th {
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

.content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.content tr:hover td { background: var(--light-bg); }

/* ── Callouts ── */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid;
}

.callout-info {
  background: #eff6ff;
  border-color: var(--primary);
  color: #1e40af;
}

.callout-warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.callout-success {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
}

.callout strong { display: block; margin-bottom: 4px; }

/* ── Steps ── */
.steps { counter-reset: step; margin: 20px 0; }

.step {
  position: relative;
  padding: 0 0 24px 48px;
  border-left: 2px solid var(--border);
  margin-left: 16px;
}

.step:last-child { border-left-color: transparent; padding-bottom: 0; }

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -15px;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.step h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--primary-dark);
}

.step p { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-admin { background: #fef3c7; color: #92400e; }
.badge-plan { background: #dbeafe; color: #1e40af; }

/* ── Hamburger (mobile) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* ── UI Map (interactive annotated diagram) ── */
.ui-map {
  position: relative;
  width: 100%;
  background: var(--primary-dark);
  border-radius: 12px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.ui-map-inner {
  position: relative;
  display: flex;
  min-height: 420px;
}

/* Panels */
.ui-panel {
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  color: #ccc;
  font-size: 12px;
}

.ui-panel-sidebar { width: 28%; background: #fff; color: var(--text); }
.ui-panel-chat { flex: 1; background: #e5ddd5; }
.ui-panel-contact { width: 28%; background: #fff; color: var(--text); }

/* Header bar simulation */
.ui-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 11px;
  font-weight: 600;
  min-height: 36px;
}

.ui-bar-dark {
  background: var(--primary-dark);
  color: #fff;
  border-bottom: none;
}

/* Hotspot: clickable/hoverable annotation point */
.ui-hotspot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 0 0 3px rgba(10,110,232,0.3);
  animation: hotspot-pulse 2s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ui-hotspot:hover {
  transform: scale(1.3);
  box-shadow: 0 0 0 5px rgba(10,110,232,0.4);
  animation: none;
}

@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(10,110,232,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(10,110,232,0.1); }
}

/* Tooltip on hover */
.ui-hotspot .ui-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  width: 220px;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  pointer-events: none;
  z-index: 20;
}

.ui-hotspot .ui-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--primary-dark);
}

.ui-hotspot:hover .ui-tooltip { display: block; }

/* Tooltip variants for edge positioning */
.ui-hotspot .ui-tooltip-left {
  left: auto;
  right: calc(100% + 10px);
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}

.ui-hotspot .ui-tooltip-left::after {
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--primary-dark);
}

.ui-hotspot .ui-tooltip-right {
  left: calc(100% + 10px);
  right: auto;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}

.ui-hotspot .ui-tooltip-right::after {
  top: 50%;
  right: 100%;
  left: auto;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--primary-dark);
}

.ui-hotspot .ui-tooltip-bottom {
  bottom: auto;
  top: calc(100% + 10px);
}

.ui-hotspot .ui-tooltip-bottom::after {
  top: auto;
  bottom: 100%;
  border: 6px solid transparent;
  border-bottom-color: var(--primary-dark);
  border-top-color: transparent;
}

/* Simulated UI elements inside the map */
.ui-tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: #fff;
}

.ui-tab {
  padding: 6px 12px;
  font-size: 10px;
  text-align: center;
  flex: 1;
  opacity: 0.5;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.ui-tab.active {
  opacity: 1;
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.ui-ticket-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-left: 3px solid var(--primary);
  font-size: 11px;
}

.ui-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.ui-msg-bubble {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  max-width: 70%;
  margin: 3px 8px;
}

.ui-msg-in { background: #fff; align-self: flex-start; }
.ui-msg-out { background: #dcf8c6; align-self: flex-end; margin-left: auto; }

.ui-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}

.ui-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--light-bg);
  border-radius: 8px;
  font-size: 13px;
}

.ui-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ui-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* ── Screenshot Map (image with hotspots) ── */
.screenshot-map {
  position: relative;
  width: 100%;
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.screenshot-map img {
  width: 100%;
  display: block;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: 24px 16px; }
  .hamburger { display: block; }
  .header-search { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .ui-map-inner { flex-direction: column; }
  .ui-panel-sidebar, .ui-panel-contact { width: 100%; }
  .ui-hotspot .ui-tooltip { width: 180px; }
}
