.ques-browse-toolbar {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border: 1px solid #dce5ed;
    border-radius: 8px;
    background: #ffffff;
}

.ques-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ques-toolbar-primary {
    flex-wrap: nowrap;
}

.ques-scope-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.ques-scope-controls > label {
    margin: 0;
    color: #526476;
    font-size: 12px;
}

.ques-export-actions {
    flex: 0 0 auto;
    border-color: #d8eadf;
    background: #f6fbf8;
}

.ques-download-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ques-export-icon-btn {
    min-width: 32px;
    min-height: 30px;
    padding-left: 8px;
    padding-right: 8px;
}

.ques-record-icon-btn,
.ques-admin-icon-btn {
    min-width: 32px;
    padding-left: 8px;
    padding-right: 8px;
}

.ques-global-search {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 1 340px;
    width: 340px;
    margin: 0;
    color: #607080;
}

.ques-global-search .form-control {
    width: 100%;
}

.ques-table-command-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 7px 0;
}

#quesTableSummary {
    flex: 1 1 auto;
    min-width: 0;
}

.ques-table-summary-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ques-table-summary-content #totalrecords {
    white-space: nowrap;
}

.ques-table-summary-content label {
    margin: 0 0 0 8px;
    color: #526476;
    font-size: 12px;
}

.ques-table-summary-content .select2-container {
    min-width: 210px;
    width: 210px !important;
}

.ques-filter-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: 14px;
    vertical-align: middle;
}

.ques-filter-bar label {
    margin: 0;
    font-size: 12px;
    color: #586069;
}

.ques-save-actions {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ques-save-toggle {
    white-space: nowrap;
}

.ques-save-icon-btn {
    min-width: 30px;
    padding-left: 7px;
    padding-right: 7px;
}

.ques-save-state-cell {
    text-align: center;
    white-space: nowrap;
}

#quesTableScroll {
    height: calc(100vh - 38vh);
    overflow-y: scroll;
    overflow-x: auto;
}

#quesTableScroll th {
    cursor: pointer;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.ques-detail-layout-split #quesTableScroll {
    height: calc(100vh - 260px);
}

.ques-detail-layout-fullscreen #quesTableScroll {
    height: auto;
}

.ques-detail-workspace {
    display: flex;
    gap: 12px;
    align-items: start;
    width: 100%;
}

.ques-detail-layout-split {
    display: flex;
}

.ques-detail-layout-split #quesBrowseTableRegion {
    flex: 0 0 38%;
    min-width: 320px;
}

.ques-detail-layout-split #quesRightSidePanelContainer {
    flex: 1 1 62%;
    min-width: 520px;
}

.ques-detail-layout-detail {
    display: flex;
}

.ques-detail-layout-detail #quesRightSidePanelContainer {
    flex: 1 1 100%;
    width: 100%;
}

.ques-detail-layout-detail #quesBrowseTableRegion,
.ques-detail-layout-table #quesRightSidePanelContainer {
    display: none;
}

.ques-detail-layout-fullscreen {
    position: fixed;
    z-index: 1050;
    inset: 0;
    overflow: hidden;
    background: #f7f9fb;
    padding: 14px;
    display: flex;
}

.ques-detail-layout-fullscreen #quesBrowseTableRegion {
    display: none;
}

.ques-detail-layout-fullscreen #quesRightSidePanelContainer {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

body.ques-detail-fullscreen-active {
    overflow: hidden;
}

.ques-browse-row {
    cursor: pointer;
}

.ques-browse-row:hover,
.ques-browse-row:focus {
    background: #edf6ff !important;
    outline: 2px solid #b8ddff;
    outline-offset: -2px;
}

.ques-detail-panel {
    position: sticky;
    top: 12px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    min-height: 360px;
    max-height: calc(100vh - 190px);
    overflow: auto;
    padding: 16px;
}

.ques-detail-layout-fullscreen .ques-detail-panel {
    position: relative;
    top: 0;
    width: 100%;
    max-height: calc(100vh - 36px);
}

.ques-detail-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: -16px;
    background: #ffffff;
    z-index: 2;
    padding: 4px 0 12px;
    border-bottom: 1px solid #edf1f5;
}

.ques-detail-toolbar small {
    display: block;
    color: #697386;
    margin-top: 2px;
}

.ques-detail-section-filter {
    margin: 12px 0;
}

.ques-detail-panel section {
    border-bottom: 1px solid #edf1f5;
    padding: 12px 0;
}

.ques-detail-panel h5 {
    margin: 0 0 10px;
    font-weight: 700;
    color: #263238;
}

.ques-detail-field,
.ques-detail-prompt-text,
.ques-detail-transcription {
    background: #f8fafc;
    border: 1px solid #e6edf3;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.ques-detail-field span,
.ques-detail-prompt-text span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #607080;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 4px;
}

.ques-detail-field p,
.ques-detail-prompt-text p {
    margin: 0;
    white-space: pre-wrap;
}

.ques-detail-media-item {
    display: block;
    gap: 12px;
    border: 1px solid #e6edf3;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.ques-detail-media-item small {
    display: block;
    color: #697386;
    word-break: break-word;
}

.ques-detail-media-item audio {
    width: 100%;
}

.ques-detail-media-item img {
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #f4f6f8;
    border-radius: 4px;
    cursor: zoom-in;
    margin-top: 8px;
}

.ques-image-lightbox {
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgba(10, 18, 28, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ques-image-lightbox img {
    max-width: 96vw;
    max-height: 94vh;
    object-fit: contain;
    background: #ffffff;
}

.ques-image-lightbox button {
    position: fixed;
    top: 16px;
    right: 16px;
}

.ques-detail-footer {
    position: sticky;
    bottom: -16px;
    background: #ffffff;
    padding: 12px 0 0;
    border-top: 1px solid #edf1f5;
}

#browsequesdropdowns {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
}

.ques-browse-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: auto;
}

.ques-action-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 4px;
    border: 1px solid #d9e4ee;
    border-radius: 6px;
    background: #f8fbfe;
}

.ques-download-menu {
    border-color: #d8eadf;
    background: #f6fbf8;
}

.ques-download-toggle {
    min-height: 32px;
    font-size: 12px;
    font-weight: 800;
}

.ques-download-dropdown {
    min-width: 170px;
    padding: 5px 0;
}

.ques-download-dropdown li {
    margin: 0;
}

.ques-download-dropdown .ques-download-format {
    display: block;
    width: 100%;
    padding: 7px 14px;
    border: 0;
    background: transparent;
    color: #243447;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.ques-download-dropdown .ques-download-format:hover,
.ques-download-dropdown .ques-download-format:focus {
    background: #f2f6fb;
    color: #1d5f8f;
    outline: none;
}

.ques-download-audio {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    margin: 0;
    padding: 0 4px;
    color: #34495e;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.ques-download-audio input {
    margin: 0;
}

.ques-admin-actions {
    border-color: #efd6d6;
    background: #fff8f8;
}

.ques-admin-actions #browseactiondropdown {
    min-width: 120px;
}

.ques-admin-actions .select2-container {
    min-width: 130px;
}

.ques-admin-actions .btn {
    min-height: 30px;
    font-size: 12px;
    font-weight: 700;
}

.ques-admin-actions .glyphicon,
.ques-download-toggle .glyphicon {
    margin-right: 4px;
}

@media (max-width: 992px) {
    .ques-detail-layout-split,
    .ques-detail-layout-fullscreen {
        flex-direction: column;
    }

    .ques-detail-layout-split #quesBrowseTableRegion,
    .ques-detail-layout-split #quesRightSidePanelContainer {
        flex: 1 1 auto;
        min-width: 0;
    }

    #browsequesdropdowns,
    .ques-browse-actions {
        justify-content: flex-start;
    }

    .ques-toolbar-primary {
        flex-wrap: wrap;
    }

    .ques-global-search {
        flex: 1 1 280px;
        width: 100%;
    }

    .ques-table-command-row {
        align-items: flex-start;
        flex-direction: column;
    }

    #browsequesdropdowns {
        width: 100%;
        margin-left: 0;
    }
}
