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

:root {
  --bg: #f5f7fb;
  --sidebar: #1f2937;
  --sidebar-soft: #374151;
  --text: #1f2937;
  --text-light: #6b7280;
  --white: #ffffff;
  --border: #dbe3ee;
  --yellow: #facc15;
  --blue: #3b82f6;
  --green: #22c55e;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
  width: 280px;
  background: var(--sidebar);
  color: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
}

.logo h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.logo p {
  font-size: 14px;
  color: #d1d5db;
}

.menu {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-btn {
  border: none;
  background: var(--sidebar-soft);
  color: var(--white);
  padding: 14px 16px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s ease;
}

.menu-btn:hover {
  transform: translateY(-1px);
  background: #4b5563;
}

.menu-btn.active {
  background: var(--yellow);
  color: #111827;
  font-weight: bold;
}

.sidebar-footer {
  color: #cbd5e1;
  font-size: 12px;
}

/* MAIN */

.main-content {
  margin-left: 280px;
  width: calc(100% - 280px);
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 22px 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h2 {
  font-size: 24px;
}

.content {
  padding: 24px;
}

/* CARDS */

.card {
  background: var(--white);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  color: var(--text-light);
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* NOTAS */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note-item {
  background: var(--white);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  border-left: 6px solid var(--blue);
}

.note-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.note-title {
  font-size: 18px;
  margin-bottom: 8px;
}

/* MAPA */

.map-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-canvas {
  position: relative;
  width: 100%;
  min-height: 700px;
  background: linear-gradient(180deg, #f8fafc, #eef4fb);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: auto;
  box-shadow: var(--shadow);
}

.map-inner {
  position: relative;
  width: 1400px;
  height: 900px;
}

/* SVG de líneas */
.edge-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 1400px;
  height: 900px;
  pointer-events: none;
  z-index: 1;
}

/* NODOS */

.node {
  position: absolute;
  border-radius: 18px;
  padding: 16px;
  color: #111827;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 2;
  border: 2px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.node:hover {
  transform: scale(1.02);
}

.node h4 {
  margin-bottom: 8px;
  font-size: 18px;
}

.node p {
  font-size: 14px;
  color: #334155;
}

.node-chip {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: bold;
}

.node-process {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.node-action {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
}

.node-decision {
  background: linear-gradient(135deg, #fef9c3, #fefce8);
}

/* DETALLE */

.detail-panel {
  background: var(--white);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.detail-panel h3 {
  margin-bottom: 12px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-item {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}

/* ESTADOS */

.loading,
.empty,
.error {
  background: var(--white);
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .app {
    flex-direction: column;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}