* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background: #0f172a;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100vh;
    font-size: 14px;
    /* base lebih besar */
}

header {
    padding: 12px 20px;
    background: #020617;
    border-bottom: 1px solid #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

header span {
    font-size: 13px;
    color: #9ca3af;
}

main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Left: Topology */
.left-panel {
    flex: 1.1;
    border-right: 1px solid #1f2937;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.left-panel h2,
.right-panel h2 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #f9fafb;
}

#topologyContainer {
    flex: 1;
    background: #020617;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #1f2937;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

svg {
    width: 100%;
    height: 100%;
}

/* Router & link styles */
.router-node {
    fill: #0ea5e9;
    stroke: #38bdf8;
    stroke-width: 2;
    cursor: pointer;
    transition: transform 0.2s ease, fill 0.2s ease;
}

.router-label {
    fill: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
}

.link-line {
    stroke: #4b5563;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.link-cost {
    fill: #9ca3af;
    font-size: 12px;
}

/* Highlight states */
.highlight-lsa {
    stroke: #f97316 !important;
    stroke-width: 4;
}

.highlight-spf {
    stroke: #22c55e !important;
    stroke-width: 4;
}

.router-root {
    fill: #22c55e !important;
}

.router-visited {
    fill: #facc15 !important;
}

.router-final {
    fill: #22c55e !important;
}

/* Legend */
.legend {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #9ca3af;
}

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

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.legend-root {
    background: #22c55e;
}

.legend-lsa {
    background: #f97316;
}

.legend-spf {
    background: #22c55e;
}

.legend-node {
    background: #0ea5e9;
}

/* Link editor */
.link-editor {
    margin-top: 8px;
    padding: 8px 10px;
    background: #020617;
    border-radius: 10px;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.link-editor-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-editor-title {
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
}

.link-editor-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.link-editor-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
    margin-top: 4px;
}

.link-editor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 13px;
}

.link-editor-item label {
    color: #e5e7eb;
}

.link-editor-item input {
    width: 60px;
    padding: 4px 6px;
    border-radius: 999px;
    border: 1px solid #374151;
    background: #020617;
    color: #e5e7eb;
    font-size: 13px;
}

.link-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Right: Steps & Panels */
.right-panel {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.step-title {
    font-size: 15px;
    font-weight: 600;
}

.step-indicator {
    font-size: 12px;
    color: #9ca3af;
}

.step-description {
    font-size: 14px;
    color: #e5e7eb;
    line-height: 1.45;
    padding: 10px 12px;
    border-radius: 8px;
    background: #020617;
    border: 1px solid #1f2937;
    min-height: 72px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 4px;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    background: #111827;
    color: #e5e7eb;
    border: 1px solid #374151;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn:hover {
    background: #1f2937;
}

.btn-primary {
    background: #22c55e;
    border-color: #22c55e;
    color: #022c22;
    font-weight: 600;
}

.btn-primary:hover {
    background: #16a34a;
}

.btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Root selector */
.root-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9ca3af;
}

select {
    background: #020617;
    border-radius: 999px;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 4px 8px;
    font-size: 13px;
}

/* Tables panel */
.table-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-height: 0;
}

.panel {
    background: #020617;
    border-radius: 10px;
    border: 1px solid #1f2937;
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #f9fafb;
}

.panel small {
    font-size: 12px;
    color: #9ca3af;
}

.panel-content {
    margin-top: 4px;
    overflow: auto;
    font-size: 13px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    padding: 6px 8px;
    border-bottom: 1px solid #1f2937;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #020617;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:nth-child(even) td {
    background: #020617;
}

/* Status chip */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    gap: 4px;
    background: #065f46;
    color: #bbf7d0;
}
