:root {
    --bg: #0f1110;
    --panel: #161a18;
    --panel-strong: #1d231f;
    --panel-soft: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f5f4ef;
    --muted: rgba(245, 244, 239, 0.68);
    --accent: #f0bf57;
    --accent-strong: #ffd980;
    --danger: #ff7b63;
    --shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(240, 191, 87, 0.12), transparent 30%),
        linear-gradient(180deg, #0d0f0e 0%, #111512 100%);
    color: var(--text);
    font-family: "Pretendard Variable", "Noto Sans KR", sans-serif;
}

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

a {
    color: var(--accent-strong);
}

code {
    display: inline-block;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff4d8;
    word-break: break-all;
}

.adminShell {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 24px;
    border-right: 1px solid var(--line);
    background: rgba(10, 12, 11, 0.86);
    backdrop-filter: blur(16px);
}

.brandBlock h1,
.topBar h2,
.emptyState h3,
.sectionHeader h3 {
    margin: 0;
}

.brandBlock p,
.topBar p,
.emptyState p,
.helperSection p {
    margin: 0;
    line-height: 1.6;
    color: var(--muted);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
}

.metaPanel,
.emptyState,
.fieldSection,
.statusBanner {
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.metaPanel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.metaLabel,
.profileListHeader,
.fieldBlock span,
.toggleBlock span {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.profileListHeader {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
}

.addButtons {
    display: grid;
    gap: 10px;
}

.profileList {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

.profileListItem {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel-soft);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.profileListItem:hover,
.profileListItem:focus {
    border-color: rgba(240, 191, 87, 0.45);
    transform: translateY(-1px);
    outline: none;
}

.profileListItem[selected="true"] {
    border-color: rgba(240, 191, 87, 0.72);
    background: rgba(240, 191, 87, 0.1);
}

.profileListName {
    font-size: 16px;
    font-weight: 800;
}

.profileListMeta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profileListDescription {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.45;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.editorPane {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px;
}

.topBar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.topBarActions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.editorForm {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sectionHeader {
    margin-bottom: 16px;
}

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

.fieldBlock,
.toggleBlock {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fieldBlockFull {
    grid-column: 1 / -1;
}

.toggleBlock {
    justify-content: flex-end;
}

.toggleBlock input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.toggleBlock {
    flex-direction: row;
    align-items: center;
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: var(--panel-strong);
    color: var(--text);
}

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

.uploadField {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
}

.fieldHelpText {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.primaryAction,
.secondaryAction,
.dangerAction {
    padding: 13px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primaryAction {
    background: var(--accent);
    color: #211808;
    font-weight: 800;
}

.secondaryAction {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.dangerAction {
    background: rgba(255, 123, 99, 0.1);
    border-color: rgba(255, 123, 99, 0.3);
    color: #ffb4a5;
}

.primaryAction:hover,
.secondaryAction:hover,
.dangerAction:hover {
    transform: translateY(-1px);
}

.primaryAction:disabled,
.secondaryAction:disabled,
.dangerAction:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.statusBanner {
    font-size: 14px;
    line-height: 1.5;
}

.statusBanner[data-tone="success"] {
    border-color: rgba(115, 208, 144, 0.3);
    background: rgba(115, 208, 144, 0.1);
}

.statusBanner[data-tone="error"] {
    border-color: rgba(255, 123, 99, 0.3);
    background: rgba(255, 123, 99, 0.1);
}

.statusBanner[data-tone="info"] {
    border-color: rgba(240, 191, 87, 0.28);
    background: rgba(240, 191, 87, 0.1);
}

.modalBackdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 6, 6, 0.72);
    backdrop-filter: blur(12px);
    z-index: 20;
}

.modalPanel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(1100px, 100%);
    max-height: calc(100vh - 48px);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #111412;
    box-shadow: var(--shadow);
    pointer-events: auto;
    overflow-y: auto;
}

#distributionEditorStatus {
    margin-top: -4px;
}

.distributionSummary {
    padding-bottom: 16px;
}

.distributionSummaryValue {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: var(--panel-strong);
    color: var(--text);
}

.distributionEditorForm {
    gap: 16px;
}

.modalHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.distributionTextarea {
    min-height: 420px;
    resize: vertical;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.55;
}

.modalActions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

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

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 760px) {
    .editorPane,
    .sidebar {
        padding: 20px;
    }

    .fieldGrid,
    .uploadField,
    .topBar {
        grid-template-columns: 1fr;
    }

    .topBar {
        display: flex;
        flex-direction: column;
    }
}
