﻿.widget-editor-custom-metric-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

    .widget-editor-custom-metric-row select {
        min-width: 0;
    }

.custom-metric-manager-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.35);
}

.custom-metric-manager-shell {
    width: min(1000px, 96vw);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
}

.custom-metric-manager {
    padding: 20px;
}

.custom-metric-manager-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

    .custom-metric-manager-header h3,
    .custom-metric-manager-header p {
        margin: 0;
    }

    .custom-metric-manager-header p {
        margin-top: 4px;
        color: #666;
    }

.custom-metric-close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.custom-metric-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
}

.custom-metric-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 16px;
    border-right: 1px solid #ddd;
}

.custom-metric-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 12px;
    text-align: left;
    color: #222 !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 5px;
    cursor: pointer;
}

    .custom-metric-list-item.selected {
        background: #f4f4f4 !important;
        border-color: #999 !important;
    }

    .custom-metric-list-item small {
        color: #666;
    }

.custom-metric-form {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 10px 14px;
    align-items: center;
}

    .custom-metric-form input,
    .custom-metric-form select,
    .custom-metric-form textarea {
        width: 100%;
        min-width: 0;
    }

.custom-metric-fixed {
    padding: 8px 10px;
    background: #f5f5f5;
    border-radius: 4px;
    color: #555;
}

.custom-metric-form-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    margin-top: 12px;
}

.custom-metric-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    color: #8b0000;
    background: #fff1f1;
    border: 1px solid #efc5c5;
    border-radius: 4px;
}

.custom-metric-manager .primary,
.custom-metric-form-actions .primary {
    color: #fff !important;
    background: #c00055 !important;
    border-color: #c00055 !important;
}

.custom-metric-manager .danger {
    color: #a40000 !important;
    background: #fff !important;
    border: 1px solid #d8aaaa !important;
}

@media (max-width: 800px) {
    .custom-metric-layout {
        grid-template-columns: 1fr;
    }

    .custom-metric-list {
        padding-right: 0;
        padding-bottom: 16px;
        border-right: 0;
        border-bottom: 1px solid #ddd;
    }

    .custom-metric-form {
        grid-template-columns: 1fr;
    }
}

.custom-metric-manager-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.custom-metric-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0 !important;
    color: #222 !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer;
    visibility: visible !important;
    opacity: 1 !important;
}

    .custom-metric-close:hover {
        background: #f3f3f3 !important;
    }
