:root {
  --blue: #0d6efd;
  --purple: #8b5cf6;
  --orange: #e0701f;
  --green: #16a34a;
  --gray: #f6f7fb;
  --text: #0f172a;
  --muted: #475569;
  --border: #e5e7eb;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f8fafc;
  color: var(--text);
}
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
h1 { margin: 0; font-size: 20px; color: var(--text); }
nav { display: flex; gap: 10px; flex-wrap: wrap; }
nav a {
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
  background: #fff;
}
nav a.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.container { padding: 20px; }
.panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.panel h2 { margin: 0 0 12px 0; font-size: 16px; color: var(--text); }
form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: flex-end;
}
label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
input, select, textarea {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}
button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.btn-delete {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  color: var(--text);
}
th { color: var(--muted); font-weight: 600; }
.tag { padding: 4px 8px; border-radius: 12px; font-weight: 700; font-size: 12px; display: inline-block; }
.tag.transfer { background: #e9d5ff; color: #6b21a8; }
.tag.direct { background: #dbeafe; color: #1d4ed8; }
.tag.lastmile { background: #fee2e2; color: #b91c1c; }
.tag.active { background: #dcfce7; color: #166534; }
.tag.restricted { background: #fef3c7; color: #b45309; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.card h3 { margin: 4px 0; color: var(--text); }
.pill { background: var(--gray); padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; color: var(--text); display: inline-block; }
.graph { position: relative; width: 100%; height: 600px; }
.column { background: transparent; border: none; border-radius: 0; padding: 4px; min-height: 320px; position: relative; width: 240px; }
.node-chip {
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  margin-bottom: 28px;
  font-size: 13px;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: absolute;
  cursor: grab;
  user-select: none;
}
.tag-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tag-dc { background: rgba(13,110,253,0.15); color: #0f172a; }
.tag-hub { background: rgba(139,92,246,0.15); color: #0f172a; }
.tag-cust { background: rgba(224,112,31,0.15); color: #0f172a; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal h3 { margin: 0; }
.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.modal form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.node-dc { background: #fff; }
.node-hub { background: #fff; }
.node-cust { background: #fff; }
.legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--text); }
.circle { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
