.popup-area-window{
    width: 90vw;
    max-width: 1600px !important;
}

.popup-area-window2{
    width: 87vw;
    max-width: 1450px !important;
}

.popup-area-window3{
    width: 84vw;
    max-width: 1300px !important;
}

.popup-area-window4{
    width: 82vw;
    max-width: 1240px !important;
}

.popup-area-window5{
    width: 80vw;
    max-width: 1180px !important;
}

.popup-area-window6{
    width: 77vw;
    max-width: 1000px;
}

.popup-area-window-notification-content-alignment .popup-area-window-notification{
    width: 100vw;
    max-width: 550px;
    min-height: 45px;
    background: var(--hn-notification-poupup-background-color);
    color: var(--hn-basic-text-color);
    transform: none;
    top: initial;
    left: initial;
    position: initial;
}

.popup-area-window-notification-content-alignment .popup-area-window-content{
    max-width: 900px;
    min-height: 45px;
    background: var(--hn-notification-poupup-background-color);
    color: var(--hn-basic-text-color);
    transform: none;
    top: initial;
    left: initial;
    position: initial;
}

#ajax-form{
    position: relative;
    align-items: center;
}

.ajax-form-headline-wrapper{
    border: none;
    margin-top: -35px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.ajax-form-headline-wrapper H2{
    font-size: var(--hn-popup-form-headline-font-size);
    color: black;
}

.ajax-form-headline{
    width: 50%;
}

.actionIconArea{
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: center;
    margin-bottom: -8px;
}

.api-call-icons {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

.api-button-decline, .api-button-accept {
    display: flex;
    min-width: 135px !important;
    height: 37px !important;
    padding: 0 5px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    justify-content: center;
    align-items: center;
    border-radius: 3px !important;
    margin: 5px !important;
}

.api-button-decline {
    background-color: var(--hn-red-color);
    border: 1px solid var(--hn-red-color);
}

.api-button-accept {
    background-color: var(--hn-green-color);
    border: 1px solid var(--hn-green-color);
}

.api-button-decline:hover {
    color: var(--hn-red-color);
    border: 1px solid var(--hn-red-color);
    background: white;
}

.api-button-accept:hover {
    color: var(--hn-green-color) !important;
    border: 1px solid var(--hn-green-color);
    background: white;
}

.actionIconArea button{
    height: 30px;
    min-width: max-content;
    margin: 5px;
    border: none;
    color: white;
    border-radius: var(--hn-button-border-radius);
    cursor: pointer;
}

.actionIconArea .buttonAdd{
    background: var(--hn-add-button-color);
}

.actionIconArea .buttonEdit{
    background: var(--hn-edit-button-color);
}

.actionIconArea .buttonDelete{
    background: var(--hn-delete-button-color);
}

.actionIconArea .buttonDuplicate{
    background: var(--hn-duplicate-button-color);
}

.actionIconArea .buttonAdd:hover{
    background: var(--hn-add-button-color-hover);
}

.actionIconArea .buttonEdit:hover{
    background: var(--hn-edit-button-color-hover);
}

.actionIconArea .buttonDelete:hover{
    background: var(--hn-delete-button-color-hover);
}

.actionIconArea .buttonDuplicate:hover{
    background: var(--hn-duplicate-button-color-hover);
}

.ajax-form-item-headline H3{
    font-size: var(--hn-basic-text-size);
}

.ajax-form-item-headline{
    padding-top: 5px;
}

.ajax-form-item-input-section input{
    outline: none;
    border: none;
    border-bottom: var(--hn-input-bordrder);
    font-size: var(--hn-basic-text-size);
    line-height: 20px;
    z-index: 1;
}

.ajax-form-item-input-section{
    max-width: 250px;
    width: 100%;
}

#close-popup-window{
    cursor: pointer;
    width: 20px;
    font-weight: 600;
    font-size: 25px;
    top: -20px;
    position: relative;
}

.close-popup-window-wrapper{
    width: 100%;
    display: flex;
    align-items: end;
    justify-content: end;
}

.ajax-form-button-wrapper{
    display: flex;
    justify-content: end;
    width: 100%;
}

.ajax-form-button-row{
    margin-top: 15px;
}

.popup-area-close-cross-line{
    display: flex;
    width: 100%;
    justify-content: end;
    position: relative;
    top: -13px;
}

/* FIELDSETY - zachováváme původní design */
.ajax-form-fieldset-wrapper {
    background: var(--hn-box-background-color);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: box-shadow 0.2s ease;
    width: auto;
    display: block;
    flex-shrink: 0;
    min-height: auto;
    position: relative;
    z-index: 1;
}


.ajax-form-fieldset-headline {
    width: 100%;
    height: 17px;
    background: var(--hn-table-header-background-color);
    margin-left: -20px;
    margin-top: -20px;
    margin-bottom: 10px;
    border-bottom: 5px solid white;
    color: white;
    padding: 8px 20px 8px 20px;
    font-size: var(--hn-basic-text-size) !important;
    font-weight: 600;
    cursor: default;
    position: relative;
    z-index: 2;
    display: flex; /* přidáno */
    align-items: center; /* vertikální zarovnání */
    justify-content: space-between; /* rozstrčí název vlevo, šipečku vpravo */
}

/* Clickable headline pro toggle funkcionalitu */
.ajax-form-fieldset-headline.clickable-headline {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}

.ajax-form-fieldset-headline.clickable-headline:hover {
    position: relative;
}

.ajax-form-fieldset-headline.clickable-headline:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Toggle ikona */
.fieldset-toggle-icon {
    margin-right: 0; /* změna z 12px na 0, protože je už napravo */
    font-size: 16px;
    display: inline-block;
    width: 20px;
    text-align: center;
    font-weight: bold;
    color: #ffffff;
    z-index: 1;
    position: relative;
}


/* ČISTÉ GRID PRAVIDLA - žádné duplikáty *//* NOVÉ: Základní Grid pravidla pro všechna rozlišení */
.ajax-form-fieldset-wrapper {
    background: var(--hn-box-background-color);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 5px;
    width: auto;
    display: block;
    flex-shrink: 0;
    min-height: auto;

    /* KLÍČOVÁ OPRAVA - relativní positioning */
    position: relative;
    z-index: auto;
    isolation: isolate; /* Vytvoří nový stacking context */
}

/* OPRAVA Grid layoutu - přidáme auto-rows minmax */
.ajax-form-items-wrapper{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;

    /* ZMĚNA: Místo 1fr použijeme min-content s minimem */
    grid-auto-rows: 1fr; /* ← ZMĚNA: z minmax(min-content, auto) na 1fr */
    align-items: stretch; /* ← ZMĚNA: z start na stretch */

    /* Explicitní grid-gap pro jistotu */
    grid-row-gap: var(--grid-row-gap, 30px);
    grid-column-gap: 16px;
}

/* Fieldsety NEBUDEME roztahovat - necháme přirozenou výšku */
.ajax-form-fieldset-wrapper:not(.collapsed) {
    /* ODSTRANÍME flex roztahování */
    display: block !important;
    height: auto !important;
    min-height: auto !important;
}

.ajax-form-fieldset-wrapper:not(.collapsed) .ajax-form-fieldset-content {
    /* ODSTRANÍME flex roztahování */
    display: block !important;
    flex: none !important;
}

/* Definujeme CSS custom property pro row-gap */
:root {
    --grid-row-gap: 30px;
}

/* Různé row-gap pro různá rozlišení */
@media(min-width: 1670px){
    :root {
        --grid-row-gap: 30px;
    }

    .ajax-form-items-wrapper-files{
        display: flex;
        gap: 16px;
        padding: 25px;
    }

    .ajax-form-items-wrapper-files label{
        width: 220px;
        margin-top: 13px;
        margin-bottom: 8px;
        font-size: var(--hn-basic-text-size);
    }
}

@media(max-width: 1670px){
    :root {
        --grid-row-gap: 35px;
    }

    .ajax-form-items-wrapper-files{
        display: flex;
        gap: 16px;
        padding: 25px;
    }

    .ajax-form-items-wrapper-files label{
        width: 220px;
        font-size: var(--hn-basic-text-size);
        margin-top: 13px;
        margin-bottom: 8px;
    }
}



/* Collapsed fieldsety */
.ajax-form-fieldset-wrapper.collapsed {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important; /* ← PŘIDAT! */
    grid-row: span 1 !important;
    grid-column: span 1 !important;
    min-height: 45px !important;
    max-height: 45px !important;
    flex-shrink: 0 !important;
    align-self: start !important;
    justify-self: stretch !important;
    display: block !important;
    width: 100% !important;
    overflow: hidden !important;
}

.ajax-form-fieldset-wrapper.collapsed .ajax-form-fieldset-headline {
    margin: 0 !important;
    display: flex !important;
    width: calc(100% - 35px) !important;
    overflow: hidden !important;
    border-radius: 0 !important; /* ← UŽ MÁTE */
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
}

/* Text v headeru */
.ajax-form-fieldset-headline span:last-child {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    position: relative;
    justify-content: end;
    display: flex;
}

/* Obsah fieldsetu */
.ajax-form-fieldset-content {
    display: block;
    position: relative;
    z-index: 1;
}

.ajax-form-fieldset-content.collapsed {
    display: none !important;
}

.ajax-form-fieldset-content.expanded {
    display: block !important;
}

/* Chat styly */
.chat-headline{
    height: 17px;
    padding: 8px 0px 10px 20px;
    margin: -5px -8px 10px -9px;
    color: white;
    font-size: var(--hn-basic-text-size);
    font-weight: 600;
}

.ajax-form-item-content-section{
    margin-top: -24px;
    font-size: var(--hn-basic-text-size);
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.ajax-form-item-headline{
    margin-top: -15px;
}

/* Responsivní úpravy */
@media (max-width: 768px) {
    .ajax-form-fieldset-headline.clickable-headline {
        font-size: calc(var(--hn-basic-text-size) - 1px);
    }

    .fieldset-toggle-icon {
        margin-right: 8px;
        font-size: 14px;
        width: 16px;
    }
}

@media (max-width: 480px) {
    .ajax-form-fieldset-headline.clickable-headline {
        font-size: calc(var(--hn-basic-text-size) - 2px);
    }

    .fieldset-toggle-icon {
        margin-right: 6px;
        font-size: 12px;
        width: 14px;
    }
}

/* Fallback pro starší fieldsety */
.ajax-form-fieldset-headline:not(.clickable-headline) {
    cursor: default;
    background: var(--hn-table-header-background-color);
}

.actionIconsPopup{
    cursor: pointer;
}

.action-icon-wrapper{
    padding: 0 3px;
    margin-top: 3px;
}

.actionIconsPopup:hover{
    position: relative;
    top: -1px;
    right: -1px;
}

@media(min-width: 800px){
    .popup-area-wrapper{
        width: var(--page-real-width);
        height: var(--page-real-height);
        position: absolute;
        top: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #ffffff8f;
        z-index: 1;
        padding-bottom: 200px;
    }
}

@media(max-width: 800px){
    .popup-area-wrapper{
        background: #ffffff8f;
        height: var(--page-real-height);
        position: absolute;
        top: 120px;
        display: flex;
        width: 100vw;
        justify-content: center;
        align-items: start;
        padding-bottom: 150px;
    }
}

@media(max-width: 650px) {
    .api-call-icons{
        display: flex;
        justify-content: start !important;
        margin-top: 18px;
        width: calc(100% - 22px) !important;
        padding-left: 0px;
    }
    .api-call-icons a{
        font-size: calc(var(--hn-basic-text-size) - 2px);
    }
}

.sing-in-form-area table{
    width: 100%;
}

.sing-in-form-area table td:last-child{
    text-align: end;
}

.sing-in-form-area table tr td{
    padding-top: 10px;
}

.sing-in-form-area .forgotten-password{
    text-align: end;
    padding-right: 5px;
}

.sing-in-form-area .forgotten-password a:hover{
    background: none !important;
    color: #252323;
}

.sing-in-form-area th {
    text-align: start;
}

.netteFormsModal{
    border: 0 !important;
    font-size: var(--hn-basic-text-size);
    box-shadow: var(--hn-popup-window-shadow);
    padding: 30px !important;
}

.netteFormsModal button{
    width: 160px;
    max-width: 160px;
    border-radius: 3px;
    background: var(--action-button-color) !important;
    border: 1px solid var(--action-button-color);
    color: white;
    cursor: pointer;
    margin-top: 15px;
    height: 32px;
}

.netteFormsModal button:hover{
    border-radius: 3px;
    border: 1px solid var(--action-button-color-hover);
    background: var(--action-button-color-hover) !important;
}

.popup-checkbox{
    position: absolute;
    left: 0px;
    margin-top: 2px;
    width: 60% !important;
    min-width: 200px;
}

.popup-checkbox[type='checkbox'] {
    width: 20px;
    height: 20px;
    accent-color: var(--hn-footer-background-color);
    cursor: pointer;
}

.alertPopupContentArea{
    min-height: 70px;
    display: flex;
    font-size: var(--hn-basic-text-size);
    justify-content: center;
    align-items: start;
    padding-top: 50px;
}

.alertPopupButtonArea{
    display: flex;
    flex-direction: row;
    justify-content: end;
}

.alertPopupSeparator{
    width: 20px;
}

.sub-table-action-icon-line{
    margin-bottom: -13px;
    width: 50%;
    display: flex;
    flex-direction: row;
    justify-content: end;
    position: relative;
    z-index: 10;
}

.ajax-sub-table-header-row-wrapper{
    width: 100%;
    display: flex;
    flex-direction: row;
    position: relative;
    z-index: 10;
}

.ajax-sub-table-column-documents{
    position: relative;
    z-index: 10;
}

.notification-error-message-row{
    display: flex;
    flex-direction: row;
    line-height: 30px;
}

.notification-error-message-column-name{
    font-weight: 500;
    min-width: 30%;
}

.notification-error-messages-headline{
    font-weight: 600;
    padding-bottom: 20px;
}

.json-dynamic-div H3{
    padding-bottom: 7px;
}

#newFileName{
    height: 27px;
    font-size: 15px;
}

.ajax-sub-table-header-icons{
    align-items: center;
    display: flex;
    flex-direction: row;
    min-width: 300px;
    width: 20%;
}

.sub-table-directory-path-line{
    display: flex;
    justify-content: start;
    width: 60%;
    margin-bottom: -13px;
    line-height: 24px;
}

.image-preview-content > *{
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-content iframe{
    width: 100%;
    height: 100%;
    min-height: 85vh;
}

#json-dynamic-div-notification{
    min-height: 50px;
    align-content: start;
    position: relative;
}

.popup-area-window-notification .drag-handle{
    cursor: auto;
}

.action-button.role-edit{
    width: 150px;
    height: 30px;
    line-height: 29px;
    position: relative;
    top: -17px;
}

.ajax-form-item-headline.role-headline H3{
    padding-bottom: 1px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    color: black !important;
    font-size: var(--hn-basic-text-size) !important;

}
.select2-container .select2-selection--single .select2-selection__rendered .select2-selection__placeholder{
    color: black !important;
    font-size: var(--hn-basic-text-size) !important;
}

.select2-container .select2-selection--single {
    width: 100% !important;
    background: var(--hn-box-background-color) !important;
    border: none !important;
    min-height: 33px !important;
    border-radius: 0 !important;

}

.select2-selection.select2-selection--multiple {
    height: auto !important;
    line-height: initial !important;
    width: 100% !important;
}

#popup-area-wrapper-notification{
    align-items: center;
    justify-content: center;
    display: flex;
    transform: none !important;
}

.popup-area-window-notification-content-alignment{
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    padding: 0 !important;
    top: 0 !important;
    max-width: 100vw !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    background: #ffffff00 !important;
}

.notification-error-messages-area{
    min-height: 150px;
}

.alertPopupHeadlineArea,
.notification-error-messages-headline{
    font-size: var(--hn-popup-form-headline-font-size);
    font-weight: 600;
    width: 100%;
    height: 17px;
    margin-left: -35px;
    margin-top: -17px;
    background: var(--hn-table-header-background-color);
    color: white;
    padding: 10px 18px 17px 30px;
}

.notification-error-message-row{
    padding-top: 30px;
    font-size: var(--hn-basic-text-size);
}

.colorPicker {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: initial;
}

.colorPicker:hover {
    border-color: #007bff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.colorPicker:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 4px 2px rgba(0, 123, 255, 0.4);
}

label[for^="frm-"][for$="-use_current_file_name"] input,
label[for="frm-addInternItemForm-use_current_file_name"] input,
label[for^="frm-"][for$="__send_notify_before_deadline"] input,
label[for^="frm-"][for$="use_default_notify"] input,
label[for="frm-addItemForm-use_current_file_name"] input{
    width: 27px;
    margin-top: 15px;
}

label[for^="frm-"][for$="-use_current_file_name"],
label[for="frm-addInternItemForm-use_current_file_name"],
label[for="frm-addItemForm-use_default_notify"],
label[for="frm-addInternItemForm-use_default_notify"],
label[for^="frm-"][for$="__send_notify_before_deadline"],
label[for="frm-addItemForm-use_current_file_name"]{
    font-size: var(--hn-basic-text-size);
}

.ajax-form-wrapper.user-settings-popup label{
    font-size: var(--hn-basic-text-size);
    font-family: var(--hn-default-font-family);
    width: 70%;
}

.popup-area-window1:has(.ajax-form-wrapper.user-settings-popup){
    max-width: 700px;
}

.ajax-form-wrapper.user-settings-popup .ajax-form-items-wrapper{
    padding: 4px 0;
}

.ajax-form-wrapper.user-settings-popup .label-column{
    padding-left: 15px;
    width: 60%;
}

.ajax-form-wrapper.user-settings-popup .content-column{
    width: 35%;
    padding-right: 22px;
}

.ajax-form-wrapper.user-settings-popup .ajax-form-items-wrapper{
    display: flex;
    flex-direction: row;
}

.ajax-form-wrapper.user-settings-popup .ajax-form-headline-wrapper{
    background: var(--hn-table-header-background-color);
    padding-left: 15px;
    line-height: 10px;
    margin-top: -10px;
}

.ajax-form-wrapper.user-settings-popup .ajax-form-headline-wrapper H2{
    color: white;
}

.ajax-form-wrapper.user-settings-popup .paginator-select-limit{
    margin-left: 0;
    width: 100%;
}

.ajax-form-wrapper.user-settings-popup .color-picker{
    width: 100%;
    padding: 0 1px;
    height: 40px;
}

.ajax-form-wrapper.user-settings-popup button{
    width: 170px;
    line-height: 27px;
}

.ajax-form-wrapper.user-settings-popup .button-column{
    display: flex;
    width: 100%;
    justify-content: end;
    padding-right: 22px
}

input[type=file]{
    background: none !important;
    padding-left: 11px !important;
}

.popup-area-wrapper:has(#frm-tableControl-addDocumentItemForm) [class^="popup-area-window"] {
    max-width: 500px !important;
}

.user-settings-close-default-values-column img{
    position: relative;
    width: 22px;
    top: 4px;
    left: -15px;
    cursor: pointer;
}

.user-settings-close-default-values-column.per-page img{
    top: -1px;
}

.user-settings-close-default-values-column{
    width: 5%;
}

.ajax-sub-table-column-documents.documents-deactivate-custom-width-on-small-screen-devices.name-column{
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 5px;
}

@media(max-width: 1250px){
    .ajax-sub-table-column-documents.documents-deactivate-custom-width-on-small-screen-devices.name-column{
        width: 75% !important;
    }
}

.chat-title{
    margin: 0;
    font-size: 10px;
    color: #666;
    font-style: italic;
}

.chat-message{
    margin: 0;
    font-size: 14px;
}

.chat-system-message{
    margin: 0px 0px 5px 0px;
    font-size: 12px;
    font-style: italic;
    color: #666;
}

.chat-area ul {
    margin: 0px 0px 5px 0px;
    font-size: 12px;
    font-style: italic;
    color: #666;
}

.sign-in-again-form-button{
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 850px){
    .ajax-form-header-icons-wrapper{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 850px){
    .ajax-form-header-icons-wrapper{
        display: flex;
        flex-direction: column-reverse;
        justify-content: space-between;
        align-items: center;
    }
    .api-call-icons{
        display: flex;
        justify-content: flex-end !important;
        width: 100%;
        padding-bottom: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 650px){
    .api-button-accept{
        min-width: 115px;
    }
    .api-button-decline{
        min-width: 115px;
    }
}

#myDialog {
    min-width: 550px;
    max-width: 400px;
    border: none;
    border-radius: 6px;
    padding: 0;
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.20);
    background: #f6f6f8;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #222;
    animation: dialog-pop 0.18s cubic-bezier(.3,1.5,.5,1.0);
    z-index: 1000;
}

@keyframes dialog-pop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dialog-header {
    background: #63687a;
    color: #fff;
    padding: 14px 20px 12px 20px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-size: var(--hn-basic-text-size);
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dedede;
}

.dialog-body {
    padding: 22px 20px 12px 20px;
    font-size: 0.8em;
    background: #f6f6f8;
    color: #222;
}

.dialog-footer {
    padding: 20px;
    background: #e2e4ea;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    border-top: 1px solid #dedede;
    display: flex;
    justify-content: flex-end;
}

.dialog-button {
    min-width: 155px;
    max-width: fit-content;
    border-radius: 3px;
    background: #6887a1;
    color: white;
    padding: 0 20px !important;
    border: none;
    min-height: 30px;
}


