.ps-layout {
    display: flex;
    flex-direction: row; /* Sidebar maintenue sur le côté */
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.ps-main-area {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* En-tête Toolbar & Zoom */
.ps-toolbar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ps-toolbar {
    display: flex;
    gap: 10px;
    flex: 1;
}

.ps-input-new {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.ps-btn-add {
    background-color: #27ae60;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

/* Module Zoom UI */
.ps-zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f3f5;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #dcdfe6;
}

.ps-zoom-btn {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.ps-zoom-btn:hover {
    background: #e9ecef;
}

.ps-zoom-slider {
    width: 100px;
    cursor: pointer;
}

.ps-zoom-value {
    font-size: 13px;
    font-weight: bold;
    min-width: 42px;
    text-align: center;
}

.ps-zoom-reset {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

/* ZONE DE DÉPLACEMENT SANS NATIVE SCROLLBARS */
.ps-scroll-viewport {
    width: 100%;
    overflow: hidden; /* Suppression définitive des barres de défilement */
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    cursor: grab;
    position: relative;
}

.ps-scroll-viewport.is-panning {
    cursor: grabbing;
    user-select: none;
}

.ps-zoom-wrapper {
    width: 100%;
    height: auto;
    display: block;
    transform-origin: 0 0;
    transition: width 0.1s ease-out;
}

.ps-container {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
}

/* IMAGE À HAUTEUR NATURELLE SANS CONTRAINTE */
.ps-bg {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    display: block;
}

/* BLOCS SUR LE PLAN (AVEC CADRE BLEU CLAIR) */
.ps-item {
    position: absolute;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    padding: 2px;
    border-radius: 4px;
    border: 2px solid #3498db; /* Cadre bleu clair */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.is-visitor-user .ps-item {
    cursor: default;
}

.is-admin-user .ps-item {
    cursor: move;
}

.ps-item.ps-selected {
    border: 2px dashed #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.ps-label {
    outline: none;
    color: #2c3e50;
    font-weight: bold;
    font-size: 17px;
    line-height: 1;
    text-align: center;
    opacity: 1 !important;
    word-break: break-word;
}

.is-admin-user .ps-label {
    cursor: text;
}

.ps-resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #2980b9;
    right: 0;
    bottom: 0;
    cursor: se-resize;
    border-top-left-radius: 3px;
}

/* SIDEBAR SUR LE CÔTÉ DROIT */
.ps-sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    height: fit-content;
    box-sizing: border-box;
}

.ps-sidebar h3 {
    margin-top: 0;
    font-size: 16px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
}

.ps-no-selection {
    color: #7f8c8d;
    font-size: 13px;
    font-style: italic;
}

.ps-field {
    margin-bottom: 15px;
}

.ps-field label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.ps-field input[type="text"],
.ps-field input[type="color"],
.ps-field input[type="range"] {
    width: 100%;
    box-sizing: border-box;
}

.ps-btn-delete {
    width: 100%;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.ps-btn-delete:hover {
    background-color: #c0392b;
}

@media screen and (max-width: 768px) {
    .ps-layout {
        flex-direction: column;
    }

    .ps-sidebar {
        width: 100%;
        min-width: 100%;
    }
}