:root {
    --bg: #080c0b;
    --surface: #0f1512;
    --surface2: #151c18;
    --border: #1e2b24;
    --border-bright: #2a3d31;
    --text: #c8ddd3;
    --text-dim: #5a7060;
    --text-bright: #e8f5ee;
    --accent: #00d4aa;
    --accent-dim: #00a882;
    --accent-glow: rgba(0, 212, 170, 0.08);
    --amber: #f5a623;
    --red: #e05c5c;
    --blue: #5c9ee0;
    --purple: #9b6bcc;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Barlow Condensed', sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 52px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-bright);
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--bg);
    font-weight: 700;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 7px 16px;
    border-radius: 5px;
    border: 1px solid var(--border-bright);
    cursor: pointer;
    background: transparent;
    color: var(--text-dim);
    transition: all 0.15s;
    text-transform: uppercase;
}

.btn:hover {
    color: var(--text);
    border-color: var(--text-dim);
    background: var(--surface2);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
    color: var(--bg);
}

.btn-ghost {
    border-color: transparent;
}

.btn-ghost:hover {
    border-color: var(--border-bright);
}

.app-layout {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0 16px 8px;
}

.kind-group {
    margin-bottom: 20px;
}

.kind-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    border-left: 2px solid transparent;
    transition: all 0.1s;
    user-select: none;
}

.kind-item:hover {
    color: var(--text);
    background: var(--accent-glow);
}

.kind-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-glow);
}

.kind-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: 0.6;
}

.kind-item.active .kind-dot {
    opacity: 1;
}

.form-panel {
    overflow-y: auto;
    padding: 24px;
    border-right: 1px solid var(--border);
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.form-subtitle {
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--mono);
    margin-bottom: 28px;
}

.form-subtitle span {
    color: var(--accent);
}

.section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
}

.field {
    margin-bottom: 14px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

label .required {
    color: var(--red);
    margin-left: 2px;
}

label .optional {
    color: var(--text-dim);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
    opacity: 0.7;
}

input,
select,
textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border-bright);
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    padding: 9px 12px;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

select option {
    background: var(--surface2);
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface2);
    border: 1px solid var(--border-bright);
    border-radius: 5px;
}

.toggle-label {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.toggle {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-bright);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-dim);
    top: 3px;
    left: 3px;
    transition: transform 0.2s, background 0.2s;
}

.toggle input:checked+.toggle-slider {
    background: rgba(0, 212, 170, 0.25);
}

.toggle input:checked+.toggle-slider::after {
    transform: translateX(16px);
    background: var(--accent);
}

.kv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kv-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 1px solid var(--border-bright);
    background: transparent;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-icon:hover {
    color: var(--red);
    border-color: var(--red);
    background: rgba(224, 92, 92, 0.08);
}

.btn-icon.add:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.add-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.port-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.env-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-family: var(--mono);
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--surface2);
    border: 1px solid var(--border-bright);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
}

.env-type-badge.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.yaml-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.yaml-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.yaml-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.yaml-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.yaml-actions {
    display: flex;
    gap: 8px;
}

.yaml-output {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--text);
    white-space: pre;
}

.y-key {
    color: #7ec8e3;
}

.y-val-str {
    color: #c8daa8;
}

.y-val-num {
    color: #f5a623;
}

.y-val-bool {
    color: #cc9bcc;
}

.y-comment {
    color: #3d5a45;
    font-style: italic;
}

.y-dash {
    color: var(--accent);
}

.y-apiversion {
    color: #7ec8e3;
}

.y-kind {
    color: var(--accent);
    font-weight: 500;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s;
    pointer-events: none;
    z-index: 999;
    font-family: var(--sans);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface2);
    border: 1px solid var(--border-bright);
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text);
}

.tag-del {
    cursor: pointer;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1;
    transition: color 0.1s;
}

.tag-del:hover {
    color: var(--red);
}

.hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 5px;
    font-family: var(--mono);
}

.radio-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.radio-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-bright);
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--mono);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.radio-btn:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.radio-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.probe-section {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-top: 8px;
}

.probe-section .field {
    margin-bottom: 10px;
}

.probe-section .field:last-child {
    margin-bottom: 0;
}

.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ms-tag {
    padding: 5px 10px;
    border: 1px solid var(--border-bright);
    border-radius: 3px;
    font-size: 12px;
    font-family: var(--mono);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
}

.ms-tag:hover {
    color: var(--text);
}

.ms-tag.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.ingress-rule {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 10px;
}

.rule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rule-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}