:root {
    --ink: #0e1a2a;
    --ink-soft: #415063;
    --accent: #ff5d2a;
    --accent-2: #0fa3b1;
    --surface: rgba(255, 255, 255, 0.82);
    --line: rgba(24, 39, 59, 0.12);
    --ok: #0d9f6e;
    --warn: #bf7d00;
    --bad: #d64545;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans KR", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 10% 10%, #fff3d6 0%, #e8f4ff 35%, #f4fff8 70%, #f6f0ff 100%);
    min-height: 100vh;
}

.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(to right, rgba(14, 26, 42, 0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(14, 26, 42, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 95%);
}

.app-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 16px 40px;
    position: relative;
}

.hero {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68));
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: reveal 0.45s ease;
}

.hero-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-2);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    font-family: "Space Grotesk", sans-serif;
    margin: 0;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero-sub {
    margin: 10px 0 0;
    color: var(--ink-soft);
}

.hero-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.kpi-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    animation: reveal 0.6s ease;
}

.kpi-card h2 {
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.kpi-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.6rem;
}

.workspace {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px;
}

.side-menu {
    position: sticky;
    top: 10px;
    height: fit-content;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.menu-btn {
    text-align: left;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.menu-btn.active {
    background: linear-gradient(135deg, #163a62, #2b5e8e);
    color: #fff;
    border-color: transparent;
}

.page-stack {
    display: grid;
    gap: 12px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.preview-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-grid article {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
}

.kpi-mini-grid {
    margin: 12px 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    animation: reveal 0.7s ease;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.panel-head span {
    font-size: 0.82rem;
    color: var(--ink-soft);
}

.stack-form {
    display: grid;
    gap: 8px;
}

.stack-form.compact {
    grid-template-columns: 1fr 1fr;
}

.stack-form.compact button {
    grid-column: span 2;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(14, 26, 42, 0.18);
    border-radius: 10px;
    padding: 10px 11px;
    font: inherit;
    background: rgba(255, 255, 255, 0.86);
}

textarea {
    min-height: 72px;
    resize: vertical;
}

h4 {
    margin: 14px 0 8px;
    font-family: "Space Grotesk", sans-serif;
}

.list {
    display: grid;
    gap: 8px;
    max-height: 210px;
    overflow: auto;
}

.list.short {
    max-height: 170px;
}

.list-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
}

.meta {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge.draft {
    background: #fff0db;
    color: #9a4b00;
    border-color: #ffd8b3;
}

.badge.ready {
    background: #e8fff4;
    color: #056f49;
    border-color: #b7f0d8;
}

.badge.running,
.badge.queued {
    background: #e9f3ff;
    color: #124d8e;
    border-color: #bfd8ff;
}

.badge.failed,
.badge.cancelled {
    background: #ffebeb;
    color: #8f1f1f;
    border-color: #ffc5c5;
}

.badge.deployed {
    background: #e6fffa;
    color: #0b7f72;
    border-color: #b9f1e8;
}

.filter-row,
.row-inline {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}

.row-inline.wrap {
    flex-wrap: wrap;
}

.row-inline.between {
    justify-content: space-between;
    align-items: center;
}

.panel-subsection {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px dashed rgba(14, 26, 42, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.65);
}

.btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), #ff8c45);
    color: white;
}

.btn.secondary {
    background: linear-gradient(135deg, #1f6e8c, #0fa3b1);
    color: white;
}

.btn.ghost {
    background: white;
    color: var(--ink);
    border-color: var(--line);
}

.btn:hover {
    filter: brightness(0.96);
}

.actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    right: 14px;
    bottom: 14px;
    background: #13263f;
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(7, 20, 38, 0.32);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.22s ease;
}

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

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    .kpi-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stack-form.compact {
        grid-template-columns: 1fr;
    }

    .stack-form.compact button {
        grid-column: span 1;
    }
}