.summaryPanel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-surface);
}

.summaryItems {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.summaryItem {
    min-width: 120px;
}

.summaryLabel,
.meta {
    display: block;
    color: var(--color-text-muted);
    font-size: 12px;
}

.summaryValue {
    display: block;
    margin-top: 4px;
    color: var(--color-text);
    font-size: 18px;
    font-weight: 700;
}

.summaryActions {
    display: flex;
    gap: 10px;
}

.tabsBar {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.tab {
    min-height: 40px !important;
    padding-right: 18px !important;
    padding-left: 18px !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    text-transform: none !important;
}

.giftCell {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: var(--space-3);
}

.giftIcon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card-strong);
    object-fit: cover;
}

.amount {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
}

.relationBadge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-card-strong);
    font-size: 12px;
    font-weight: 800;
}

.relationBadge_cp {
    color: #be123c;
    background: #ffe4e6;
}

.relationBadge_brother {
    color: #1d4ed8;
    background: #dbeafe;
}

.relationBadge_sister {
    color: #a21caf;
    background: #fae8ff;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.name {
    color: var(--color-text);
    font-weight: 700;
}

.statusBadge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.statusActive {
    color: #12603a;
    background: #dcfce7;
}

.statusDisabled {
    color: #475569;
    background: #e2e8f0;
}

.statusPending {
    color: #92400e;
    background: #fef3c7;
}

.statusDanger {
    color: #b91c1c;
    background: #fee2e2;
}

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

.levelPill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 999px;
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-size: 12px;
    white-space: nowrap;
}

.relationEditorList,
.levelEditorList {
    display: grid;
    gap: 16px;
}

.configDialogPaper {
    width: min(1040px, calc(100vw - 32px)) !important;
    max-width: min(1040px, calc(100vw - 32px)) !important;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    box-shadow: var(--shadow-dialog);
}

.configDialogForm {
    display: grid;
    max-height: calc(100vh - 56px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.configDialogTitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-5) var(--space-3) !important;
    border-bottom: 1px solid var(--border);
}

.configDialogTitle h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.configDialogTitle span {
    display: inline-flex;
    margin-top: 4px;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 650;
}

.configDrawerStats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-2);
}

.configDrawerStats span {
    display: inline-flex;
    height: var(--admin-tag-height);
    align-items: center;
    padding: 0 var(--space-3);
    border: 1px solid var(--admin-tag-border);
    border-radius: var(--admin-tag-radius);
    background: var(--admin-tag-bg);
    color: var(--admin-tag-color);
    font-size: 12px;
    font-weight: 700;
}

.configDialogContent {
    display: grid;
    gap: 18px;
    min-height: 0;
    overflow: auto;
    padding: var(--space-5) !important;
}

.configDialogActions {
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5) var(--space-5) !important;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.relationEditor {
    border: 1px solid var(--color-border-subtle);
    border-radius: 8px;
    background: var(--bg-card);
}

.relationEditor {
    padding: 18px;
}

.levelEditor {
    display: grid;
    gap: var(--space-3);
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-card-strong);
}

.relationEditorHeader,
.levelEditorHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-weight: 700;
}

.levelEditorList {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    margin-top: 16px;
}

.relationTitleGroup,
.levelTitleGroup {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.relationTitle,
.levelTitle {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 800;
}

.relationSubtitle,
.levelMeta {
    min-width: 0;
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.relationControls {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: var(--space-3);
}

.levelFields {
    display: grid;
    grid-template-columns: minmax(140px, 0.7fr) minmax(220px, 1fr);
    gap: var(--space-3);
}

.levelFields > :last-child {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .summaryPanel {
        align-items: stretch;
        flex-direction: column;
    }

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

    .tabsBar {
        overflow-x: auto;
    }

    .configDialogPaper {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin: 12px !important;
    }

    .configDialogTitle {
        align-items: flex-start;
        flex-direction: column;
        padding: var(--space-4) var(--space-4) var(--space-3) !important;
    }

    .configDialogContent {
        padding: var(--space-4) !important;
    }

    .configDialogActions {
        padding: var(--space-3) var(--space-4) var(--space-4) !important;
    }

    .levelEditorList,
    .relationControls,
    .levelFields {
        grid-template-columns: 1fr;
    }

    .levelFields > :last-child {
        grid-column: auto;
    }
}
