﻿.widget-editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.28);
    display: flex;
    justify-content: flex-end;
}

.widget-editor-drawer {
    width: min(620px, 94vw);
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.16);
}

.widget-editor {
    padding: 20px;
}

.widget-editor-header,
.widget-editor-preview-header,
.widget-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .widget-editor-header h3 {
        margin: 0;
    }

    .widget-editor-header p {
        margin: 4px 0 0;
        color: #666;
    }

.widget-editor-close {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.widget-editor-form {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: center;
    margin-top: 22px;
}

    .widget-editor-form input,
    .widget-editor-form select {
        width: 100%;
        min-height: 34px;
    }

.widget-editor-preview {
    margin-top: 22px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.widget-editor-preview-header {
    padding: 10px 12px;
    background: #f7f7f7;
    border-bottom: 1px solid #ddd;
}

.widget-editor-preview-content {
    min-height: 240px;
    padding: 12px;
    overflow: auto;
}

.widget-editor-state,
.widget-editor-error {
    padding: 18px;
}

.widget-editor-error {
    color: #9e1c1c;
}

.widget-editor-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

    .widget-editor-actions button,
    .widget-editor-preview-header button {
        padding: 7px 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #fff;
        color: #222;
        cursor: pointer;
    }

    .widget-editor-actions .primary {
        color: #fff;
        background: #c00055;
        border-color: #c00055;
    }

.dashboard-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-panel-title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-panel-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

    .dashboard-panel-actions button {
        border: 1px solid #d0d0d0;
        border-radius: 4px;
        background: #fff;
        color: #333;
        padding: 3px 7px;
        font-size: 11px;
        cursor: pointer;
    }

        .dashboard-panel-actions button:hover {
            background: #f2f2f2;
        }

        .dashboard-panel-actions button.danger:hover {
            background: #fff0f0;
            border-color: #d89a9a;
        }

@media (max-width: 800px) {
    .widget-editor-form {
        grid-template-columns: 1fr;
    }

    .dashboard-panel-actions button {
        padding: 3px 5px;
        font-size: 10px;
    }
}


.widget-editor-custom-metric-container {
    min-width: 0;
}

.widget-editor-custom-metric-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .widget-editor-custom-metric-row select {
        flex: 1;
        min-width: 0;
    }

    .widget-editor-custom-metric-row button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

.widget-editor-custom-metric-hint {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    color: #777;
}