@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root{
  --primary:#2563EB;--secondary:#60A5FA;--accent:#06B6D4;
  --bg:#0F172A;--surface:#1E293B;--surface2:#273548;
  --text:#E2E8F0;--text-dim:#94A3B8;--border:#334155;
  --success:#22C55E;--warning:#FBBF24;--error:#EF4444;
  --radius:10px;--font:'Inter',system-ui,sans-serif;
}

html{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.6}
body{min-height:100vh;display:flex;flex-direction:column}

.header{padding:.75rem 1.25rem;display:flex;align-items:center;justify-content:space-between;gap:.5rem;border-bottom:1px solid var(--border);flex-wrap:wrap}
.header h1{font-size:1rem;font-weight:800;background:linear-gradient(135deg,var(--primary),var(--accent));-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.header-actions{display:flex;gap:.3rem;flex-wrap:wrap}

.btn{padding:.35rem .7rem;border-radius:8px;font-size:.72rem;font-weight:600;cursor:pointer;border:none;transition:all .15s;display:inline-flex;align-items:center;gap:.3rem;font-family:var(--font)}
.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:#3B82F6}
.btn-ghost{background:transparent;color:var(--text-dim);border:1px solid var(--border)}.btn-ghost:hover{background:var(--surface2);color:var(--text)}

.layout{flex:1;display:grid;grid-template-columns:240px 1fr 320px;gap:0;overflow:hidden}

/* Catalog */
.catalog{border-right:1px solid var(--border);padding:.75rem;overflow-y:auto}
.catalog h3{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-dim);margin-bottom:.4rem}
.svc-card{display:flex;align-items:center;gap:.4rem;padding:.4rem .5rem;border-radius:8px;cursor:pointer;font-size:.78rem;transition:all .15s;margin-bottom:.2rem}
.svc-card:hover{background:var(--surface)}
.svc-card .icon{font-size:1.1rem}
.svc-card .cat{font-size:.6rem;color:var(--text-dim)}

/* Builder */
.builder{padding:.75rem;overflow-y:auto}
.builder h3{font-size:.72rem;font-weight:700;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;margin-bottom:.4rem}
.active-services{display:flex;flex-direction:column;gap:.5rem}
.active-svc{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.6rem .75rem}
.active-svc .svc-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.4rem}
.active-svc .svc-name{font-weight:700;font-size:.82rem;display:flex;align-items:center;gap:.3rem}
.del-btn{width:24px;height:24px;border-radius:6px;border:1px solid var(--border);background:transparent;color:var(--error);cursor:pointer;font-size:.8rem;display:flex;align-items:center;justify-content:center}
.svc-field{display:flex;gap:.3rem;align-items:center;margin-bottom:.3rem}
.svc-field label{font-size:.68rem;color:var(--text-dim);min-width:55px}
.svc-field input,.svc-field select{flex:1;padding:.25rem .4rem;border-radius:6px;border:1px solid var(--border);background:var(--surface2);color:var(--text);font-size:.72rem;outline:none;font-family:var(--font)}
.kv-row{display:flex;gap:.2rem;margin-bottom:.2rem}
.kv-row input{flex:1;padding:.2rem .3rem;border-radius:4px;border:1px solid var(--border);background:var(--surface2);color:var(--text);font-size:.68rem;outline:none;font-family:var(--font)}

/* Preview */
.preview{border-left:1px solid var(--border);padding:.75rem;display:flex;flex-direction:column}
.preview h3{font-size:.72rem;font-weight:700;color:var(--text-dim);text-transform:uppercase;letter-spacing:.04em;margin-bottom:.4rem}
.yaml-output{flex:1;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.6rem;font-family:'Courier New',monospace;font-size:.72rem;color:var(--accent);white-space:pre-wrap;overflow-y:auto;line-height:1.5}

.toast{position:fixed;bottom:1.5rem;right:1.5rem;background:var(--surface);border:1px solid var(--primary);color:var(--primary);padding:.4rem .8rem;border-radius:8px;font-size:.72rem;font-weight:500;z-index:200;transform:translateY(80px);opacity:0;transition:all .3s}
.toast.show{transform:translateY(0);opacity:1}
@media(max-width:900px){.layout{grid-template-columns:1fr;grid-template-rows:auto 1fr auto}.catalog{border-right:none;border-bottom:1px solid var(--border);max-height:120px}.preview{border-left:none;border-top:1px solid var(--border);max-height:250px}}
