/* ======================================== */
/* page-layout.css - Page layout, info-box,*/
/* unlock-box, drag-handle styles          */
/* ======================================== */

/* ======================================== */
/*              Info-Box                    */
/* ======================================== */
.info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #d7ece6;
    padding: 12px 16px;
    border-radius: 2px;
    color: #2d3e50;
    font-size: var(--font-size);
    margin-bottom: 16px;
}

    .info-box > i:first-child {
        font-size: 1.2em;
        color: var(--primary);
    }

    .info-box .save-status {
        margin-left: auto;
        color: var(--muted-color);
    }

.unlock-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background-color: #fff5e6;
    border-radius: 2px;
    margin-bottom: 16px;
}

.url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 4px;
}

    .url-row code {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.9em;
    }

    .info-box.warning {
        background-color: #fff5e6;
        border-left-color: #ff9800;
    }

    .info-box.success {
        background-color: #eaf7ea;
        border-left-color: #4caf50;
    }

    .info-box.error {
        background-color: #fdecea;
        border-left-color: #f44336;
    }

/* ======================================== */
/*              Drag and Drop               */
/* ======================================== */

.col-order {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}

.handle-cell {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0;
    text-align: center;
}

.drag-handle {
    cursor: grab;
    opacity: 0.4;
    padding: 0.25rem;
    background: transparent;
    border: none;
    width:100%;
    transition: opacity 0.15s ease;
}

    .drag-handle:hover {
        opacity: 0.7;
    }

    .drag-handle:active {
        cursor: grabbing;
        opacity: 1;
    }

/* ======================================== */
/*            Page Layout              */
/* ======================================== */

.page-content {
    max-width: 2000px;
    padding: 25px;
    row-gap: 8px;
    display: grid;
}

@media (max-width: 768px) {
    .page-content {
        padding: 15px;
    }
}

@media (max-width: 400px) {
    .page-content {
        padding: 5px;
    }
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 12px 10px;


    margin-bottom: 5px;
}

    .page-header .tx-search-input {
        flex: 1;
        max-width: 280px;
        min-width: 150px;
    }

    .page-header .btn {
        height: var(--input-min-height);
        padding: 0 12px;
        white-space: nowrap;
        min-width:100px;
    }

.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

    .page-title i {
        font-size: 20px;
        color: var(--primary);
    }

.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    position: sticky;
    top: -25px;
    margin: -25px -25px 0 -25px;
    padding: 25px 25px 10px 25px;
    background: var(--body-bg);
    z-index: 15;
}

    .page-toolbar .tx-search-input {
        flex: 1;
        max-width: 280px;
        min-width: 150px;
    }

    .page-toolbar .btn {
        height: var(--input-min-height);
        padding: 0 12px;
        white-space: nowrap;
    }

@media (max-width: 768px) {
    .page-toolbar {
        top: -15px;
        margin: -15px -15px 0 -15px;
        padding: 15px 15px 10px 15px;
    }
}

@media (max-width: 400px) {
    .page-toolbar {
        top: -5px;
        margin: -5px -5px 0 -5px;
        padding: 5px 5px 10px 5px;
    }
}

.header-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* Two-row toolbar (z.B. RoomAndTables, HotelUnits) */
.page-toolbar.two-rows {
    flex-direction: column;
    align-items: stretch;
}

    .page-toolbar.two-rows .toolbar-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .page-toolbar.two-rows .toolbar-row.controls {
        justify-content: flex-start;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

        .page-toolbar.two-rows .toolbar-row.controls .tx-select {
            margin: 0;
        }

.page-controls {
    display: flex;
    gap: 16px;
    align-items: end;
    padding: 12px 14px;

}

    .page-controls .form-field {
        margin-bottom: 0;
        min-width: 180px;
    }

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

@media (min-width: 700px) {
    .settings-form {
        max-width: 800px;
    }
}

    
    .settings-form h3 {
        margin: 8px 0 0 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-color);
    }

    .settings-form .mandatory-field {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px 0;
        border-bottom: 1px solid var(--gray-100);
    }



.settings-intro {
    margin: 0;
    padding: 0 4px;
    color: var(--gray-500);
    font-size: 12.5px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

    .settings-intro i {
        color: var(--gray-400);
        font-size: 14px;
        line-height: 1.4;
    }

.settings-group {
    background: var(--white);
    border: none;
    border-radius: 2px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
}

    .settings-group h3 {
        margin: 0 0 4px 0;
        font-size: 12px;
        font-weight: 700;
        border-bottom: 1px solid var(--gray-100);
        color: var(--gray-600);
        text-transform: uppercase;
        letter-spacing: 0.6px;
        padding-bottom: 14px;
    }

/* Subtitle direkt unter dem Header (z.B. Erklärungstext). */
.settings-group-hint {
    margin: -4px 0 4px 0;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.4;
}

/* Hint-Text unter dem Label — gilt auf allen Breiten. */
.settings-group .form-field-hint {
    display: block;
    margin-top: 2px;
    color: var(--gray-500);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.35;
}

.range-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 36px;
}

    .range-row input[type="range"] {
        flex: 1;
        height: 6px;
        -webkit-appearance: none;
        appearance: none;
        background: var(--gray-100);
        border-radius: 3px;
        outline: none;
    }

        .range-row input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            background: var(--primary);
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
        }

        .range-row input[type="range"]::-moz-range-thumb {
            width: 18px;
            height: 18px;
            background: var(--primary);
            border-radius: 50%;
            cursor: pointer;
            border: none;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
        }

.range-value {
    min-width: 50px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

/* Auf größeren Screens 2-Spalten-Layout: Label links, Control rechts.
   Bewusst auf .settings-group gescoped (damit settings-form OHNE Cards, z.B.
   AdmNotifications, nicht betroffen ist) UND nur auf DIREKTE Kinder (>), damit
   mehrspaltige block-c4-Formulare innerhalb einer Card (z.B. Restaurant) ihr
   eigenes Grid behalten. */
@media (min-width: 700px) {
    .settings-group > .form-field {
        display: grid;
        grid-template-columns: 1fr auto !important;
        align-items: center;
        column-gap: 16px;
        min-height: 36px;
    }

    .settings-group > .form-field > label {
        margin-bottom: 0;
    }

    .settings-group > .form-field.range-field > .range-row {
        min-width: 150px;
    }

    /* tx-option-group liegt im form-field verschachtelt → Descendant (nicht >). */
    .settings-group .tx-option-group {
        min-width: 150px;
    }

    .settings-group > .form-field.switch-field > .tx-switch {
        justify-self: start;
    }
}

.notification-type-block {
    padding: 0 16px 10px 0px;
    border-bottom: 1px solid var(--gray-100);
    display: grid;
    gap: 4px;
}

    .notification-type-block:last-child {
        border-bottom: none;
    }

.notification-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

    .notification-type-header h3 {
        margin: 0;
        font-size: 15px;
        font-weight: 600;
    }

.page-loading {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.page-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--gray-400);
}

    .page-empty i {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .page-empty p {
        margin: 0;
        font-size: 14px;
    }

.page-body {
    padding: 0;
}

/* List Items (card-style) */
.list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
}

    .list-item:last-child {
        border-bottom: none;
    }

@media (hover: hover) {
    .list-item:hover {
        background: var(--gray-100);
    }
}

    .list-item:active {
        background: var(--gray-200);
    }

.list-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.list-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.list-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--gray-500);
}

.list-item-icon {
    color: var(--gray-400);
    font-size: 18px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .tx-search-input {
        max-width: none;
    }

    .header-buttons {
        justify-content: flex-start;
    }

    .page-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-controls .form-field {
        min-width: auto;
    }
}
