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

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: aliceblue;
    overflow: hidden;
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 540px;
}

#network {
    width: 100%;
    height: 100%;
    background-color: aliceblue;
}

.title {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: bold;
    color: #1a237e;
    background-color: rgba(255, 255, 255, 0.92);
    padding: 4px 12px;
    border-radius: 4px;
    z-index: 10;
}

.legend {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.legend-title {
    font-weight: bold;
    color: #37474f;
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 2px 0;
    color: #263238;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border: 1.5px solid #455a64;
    margin-right: 6px;
}

.swatch-supplier   { background: #f57c00; border-radius: 50%; }
.swatch-product    { background: #3949ab; border-radius: 0; }
.swatch-warehouse  { background: #00897b; transform: rotate(45deg); }
.swatch-order      { background: #757575; border-radius: 50%; }

.legend-line {
    display: inline-block;
    width: 22px;
    height: 0;
    margin-right: 6px;
    margin-bottom: 2px;
}

.line-supplies  { border-top: 2.5px solid #f57c00; }
.line-stocks    { border-top: 2.5px dashed #00897b; }
.line-fulfills  { border-top: 2.5px solid #3949ab; }

.right-panel {
    position: absolute;
    top: 44px;
    right: 8px;
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.detail-panel {
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    max-height: 380px;
    overflow-y: auto;
}

.detail-title {
    font-weight: bold;
    color: #1a237e;
    font-size: 13px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 4px;
}

.detail-body {
    font-size: 12px;
    color: #37474f;
    line-height: 1.5;
}

.detail-body .row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
    padding: 2px 0;
    border-bottom: 1px dotted #eceff1;
}

.detail-body .row .k {
    color: #607d8b;
    font-weight: bold;
}

.detail-body .row .v {
    color: #263238;
    text-align: right;
}

.detail-body .pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    margin-bottom: 6px;
}

.controls {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn {
    background-color: #3949ab;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.btn:hover {
    background-color: #283593;
}

@media (max-width: 700px) {
    .right-panel { width: 180px; }
    .legend { font-size: 11px; }
}
