﻿:root {
    --dialog-blue: #3e7593;
}

/* ===== ROT ===== */
.ui-dialog.appDialog {
    position: fixed !important;
    margin: auto;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

    /* ===== TITELRAD ===== */
    .ui-dialog.appDialog .ui-dialog-titlebar {
        flex: 0 0 auto;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 40px 8px 12px;
        background: var(--dialog-blue);
        color: #fff;
        font-weight: 600;
        border: none;        
        line-height: 1.2;
        cursor: move; /* så användaren kan dra */
        font-size: 15px;
    }

    /* ===== STÄNGKNAPP ===== */
    .ui-dialog.appDialog .ui-dialog-titlebar-close {
        position: absolute;
        right: 10px;
        top: 0;
        bottom: 0;
        margin: auto 0; /* vertikal centrering */
        width: 28px;
        height: 28px;
        display: flex; /* centrerar ikon automatiskt */
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
        text-indent: -9999px;
        overflow: hidden;
        line-height: 0;
        box-sizing: border-box;
        transition: background .2s;
    }

        .ui-dialog.appDialog .ui-dialog-titlebar-close:hover {
            background: rgba(255,255,255,0.25);
        }

        .ui-dialog.appDialog .ui-dialog-titlebar-close .ui-icon {
            width: 19px;
            height: 17px;
            background: center/contain no-repeat url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'>\
<path d='M2 2 L14 14 M14 2 L2 14' stroke='white' stroke-width='2' stroke-linecap='round'/>\
</svg>");
            pointer-events: none;            
        }

    /* ===== INNEHÅLL ===== */
    .ui-dialog.appDialog .ui-dialog-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        box-sizing: border-box;
        padding: 16px;
        height: auto !important;         
    }

    .ui-dialog.appNoScrollDialog .ui-dialog-content {
        overflow: hidden;
        padding: 0;
    }

    /* ===== KNAPPANEL ===== */
    .ui-dialog.appDialog .ui-dialog-buttonpane {
        flex: 0 0 auto;
        width: auto;
        box-sizing: border-box;
        padding: 8px 12px;
        background: #f3f3f3;
        border-top: 1px solid #ddd;
        overflow-x: hidden;
    }

    .ui-dialog.appDialog .ui-dialog-buttonset {
        float: none;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

        .ui-dialog.appDialog .ui-dialog-buttonset .ui-button {
            margin: 0;
            background: var(--dialog-blue);
            color: #fff;
            border: none;
            border-radius: 4px;
            padding: 6px 14px;
            font-size: 14px;
        }

            .ui-dialog.appDialog .ui-dialog-buttonset .ui-button:hover {
                background: #315d76;
            }
