:root {
    --bg: #eef3ea;
    --panel: #f8fbf5;
    --panel-strong: #ffffff;
    --text: #182118;
    --muted: #5d6b5f;
    --line: #d9e2d3;
    --accent: #1f8f63;
    --accent-dark: #14563d;
    --shadow: 0 20px 60px rgba(20, 46, 31, 0.14);
    --radius: 20px;
    --radius-sm: 12px;
    --font-ui: "Segoe UI", "Helvetica Neue", sans-serif;
    --font-display: "Georgia", "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(31, 143, 99, 0.18), transparent 30%),
        linear-gradient(160deg, #ecf2e8 0%, #f8faf5 45%, #edf4ef 100%);
    color: var(--text);
    font-family: var(--font-ui);
}

button,
input,
select,
textarea {
    font: inherit;
}

.shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 32px 24px;
    border-right: 1px solid rgba(93, 107, 95, 0.14);
    background: rgba(248, 251, 245, 0.8);
    backdrop-filter: blur(18px);
}

.sidebar-head h1,
.content-head h2,
.modal-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
}

.sidebar-head h1 {
    font-size: 2rem;
    line-height: 1.05;
}

.subtle,
.eyebrow,
.stats,
.modal-status,
.field-hint {
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
}

.control {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}

.control span {
    font-size: 0.9rem;
    font-weight: 600;
}

.control input,
.control select,
.value-input,
.value-textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    outline: none;
}

.control input:focus,
.control select:focus,
.value-input:focus,
.value-textarea:focus {
    border-color: rgba(31, 143, 99, 0.5);
    box-shadow: 0 0 0 3px rgba(31, 143, 99, 0.14);
}

.stats {
    margin-top: 20px;
    font-size: 0.92rem;
    line-height: 1.7;
}

.content {
    padding: 32px;
}

.content-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.content-head h2 {
    font-size: 2.4rem;
}

.status-pill {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(31, 143, 99, 0.1);
    color: var(--accent-dark);
    font-size: 0.88rem;
    font-weight: 700;
}

.list-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
}

.product-table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th,
.product-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(217, 226, 211, 0.7);
}

.product-table th {
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: rgba(248, 251, 245, 0.9);
}

.product-table tbody tr {
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

.product-table tbody tr:hover {
    background: rgba(31, 143, 99, 0.06);
}

.product-table tbody tr:active {
    transform: scale(0.997);
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 22, 17, 0.45);
    backdrop-filter: blur(10px);
}

.modal-panel {
    position: relative;
    margin: 28px auto;
    width: min(1180px, calc(100vw - 24px));
    max-height: calc(100vh - 56px);
    overflow: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 245, 0.98));
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(12, 28, 17, 0.28);
    padding: 28px;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.primary-button,
.ghost-button,
.tiny-button {
    border: none;
    border-radius: 999px;
    padding: 11px 16px;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent), #3da87b);
    color: white;
    font-weight: 700;
}

.ghost-button,
.tiny-button {
    background: rgba(24, 33, 24, 0.07);
    color: var(--text);
}

.primary-button:hover,
.ghost-button:hover,
.tiny-button:hover {
    transform: translateY(-1px);
}

.modal-status {
    min-height: 1.4rem;
    margin-bottom: 18px;
    font-size: 0.92rem;
}

.editor-root {
    display: grid;
    gap: 14px;
}

.node-group {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    overflow: hidden;
}

.node-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 700;
}

.node-group > summary::-webkit-details-marker {
    display: none;
}

.node-group-body {
    padding: 0 16px 16px;
    display: grid;
    gap: 12px;
}

.field-row {
    border: 1px solid rgba(217, 226, 211, 0.82);
    border-radius: 14px;
    padding: 12px;
    background: rgba(248, 251, 245, 0.9);
}

.field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.field-label {
    font-size: 0.95rem;
    font-weight: 700;
}

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

.value-textarea {
    min-height: 140px;
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.array-item-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.empty-state {
    padding: 30px 24px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 980px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(93, 107, 95, 0.14);
    }

    .content {
        padding: 20px;
    }

    .content-head h2 {
        font-size: 2rem;
    }
}

@media (max-width: 720px) {
    .product-table th:nth-child(3),
    .product-table td:nth-child(3),
    .product-table th:nth-child(7),
    .product-table td:nth-child(7) {
        display: none;
    }

    .modal-panel {
        margin: 12px auto;
        width: min(100vw - 12px, 1180px);
        max-height: calc(100vh - 24px);
        padding: 18px;
    }

    .modal-head {
        flex-direction: column;
    }
}

