
/*
 * MedExam Content Studio — visual refresh
 * ---------------------------------------
 * Presentation-only override layer.
 *
 * This file intentionally contains no functional behaviour and does not alter
 * any IDs used by the existing authoring JavaScript. Remove its <link> from
 * workspace.html to return to the previous visual styling.
 */

:root {
    --refresh-navy: #092d5b;
    --refresh-navy-deep: #06264e;
    --refresh-navy-soft: #123d70;
    --refresh-aqua: #23b7ba;
    --refresh-aqua-soft: #e6f7f6;
    --refresh-blue-soft: #eef5fb;
    --refresh-purple: #7057d9;
    --refresh-purple-soft: #f0edff;
    --refresh-page: #f3f8fb;
    --refresh-card: #ffffff;
    --refresh-border: #d9e5ee;
    --refresh-border-soft: #e8eff4;
    --refresh-text: #0e2b50;
    --refresh-muted: #6e8299;
    --refresh-success: #22b977;
}

.markdown-content > :last-child {
    margin-bottom: 0;
}

.markdown-content table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.markdown-content th,
.markdown-content td {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.markdown-content th {
    font-weight: 700;
    background: var(--page);
}

/* Hide the header row when every Markdown table heading is blank. */
.markdown-content thead:not(:has(th:not(:empty))) {
    display: none;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

/* ---------- Shared icon language ---------- */

.ui-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Header ---------- */

.app-header {
    min-height: 78px;
    background: linear-gradient(90deg, var(--refresh-navy-deep), var(--refresh-navy));
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 1px 0 rgba(6, 38, 78, .08);
}

.brand-block {
    gap: 18px;
}

.header-logo {
    max-height: 50px;
}

.studio-divider {
    height: 40px;
    opacity: .45;
}

.studio-name {
    color: #f4fbff;
    font-size: 17px;
    font-weight: 760;
    letter-spacing: .01em;
    text-transform: none;
}

.header-actions {
    gap: 16px;
}

.save-status {
    color: rgba(245, 252, 255, .86);
    font-size: 13px;
    font-weight: 600;
}

.save-status::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border-radius: 50%;
    background: #26c783;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    vertical-align: -1px;
}

#save-button.btn-aqua {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 17px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(180deg, #2bbec1, #20aeb2);
    box-shadow: 0 5px 14px rgba(1, 25, 53, .18);
    color: #fff;
    font-weight: 750;
}

#save-button.btn-aqua:hover {
    background: linear-gradient(180deg, #32c7ca, #22b7bb);
}

.save-button-icon {
    width: 17px;
    height: 17px;
    stroke-width: 2;
}

.user-badge {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #16477e;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    font-weight: 750;
}

/* ---------- Workspace shell ---------- */

.workspace {
    background: var(--refresh-page);
}

.content-sidebar {
    background: linear-gradient(180deg, #082b58 0%, #07264f 100%);
    border-right: 1px solid rgba(255, 255, 255, .05);
}

.sidebar-heading {
    padding-top: 22px;
}

.sidebar-title {
    color: #fff;
    font-size: 17px;
    font-weight: 780;
}

#new-content-button.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 9px;
    background: linear-gradient(180deg, #27bec2, #18a8ad);
    box-shadow: 0 6px 15px rgba(2, 22, 48, .22);
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

#new-content-button.icon-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #30c8cb, #1ab2b6);
}

.sidebar-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 12px 0;
}

.sidebar-search-row .search-wrapper {
    min-width: 0;
    flex: 1;
    padding: 0;
}

.sidebar-search-row #new-content-button.icon-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    flex: 0 0 42px;
    margin: 0;
    padding: 0;
    align-self: center;
}

/* ---------- Search ---------- */

.search-wrapper {
    position: relative;
}

.search-wrapper .search-icon {
    position: absolute;
    z-index: 2;
    left: 14px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: #d8e8f5;
    pointer-events: none;
}

.tree-search.form-control {
    height: 42px;
    padding-left: 42px;
    border: 1px solid rgba(191, 220, 243, .46);
    border-radius: 8px;
    background: rgba(7, 37, 76, .45);
    color: #f4fbff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
}

.tree-search.form-control::placeholder {
    color: #9bb5ce;
}

.tree-search.form-control:focus {
    border-color: #55d0d2;
    background: rgba(7, 37, 76, .65);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(34, 183, 186, .16);
}

/* ---------- Tree ---------- */

.content-tree {
    padding-top: 12px;
}

.tree-heading,
.tree-node,
.tree-question {
    border-radius: 7px;
}

.tree-question,
.tree-node.manifest {
    margin: 1px 8px;
    width: calc(100% - 16px);
}

.tree-question:hover,
.tree-node.manifest:hover,
.tree-heading:hover {
    background: rgba(255, 255, 255, .055);
}

.tree-question.active,
.tree-node.active,
.tree-question[aria-current="true"] {
    position: relative;
    background: linear-gradient(90deg, rgba(35, 183, 186, .24), rgba(40, 121, 186, .30));
    box-shadow: inset 3px 0 0 #40d0ce;
}

.tree-question.active::after,
.tree-node.active::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(84, 210, 211, .08);
    border-radius: inherit;
    pointer-events: none;
}

.tree-node-dot {
    background: #2cc6c2 !important;
    box-shadow: 0 0 0 3px rgba(44, 198, 194, .06);
}

.tree-count {
    opacity: .74;
}

/* ---------- Document header ---------- */

.editor-workspace {
    background: var(--refresh-page);
}

.document-header {
    padding-top: 23px;
    padding-bottom: 22px;
    background: #fff;
    border-bottom: 1px solid var(--refresh-border-soft);
}

.document-type {
    color: #1aadaf;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .12em;
}

.document-title {
    margin-top: 4px;
    color: var(--refresh-text);
    font-size: 25px;
    font-weight: 790;
    letter-spacing: -.02em;
}

.document-path {
    margin-top: 4px;
    color: #8092a5;
    font-size: 13px;
}

/* ---------- Tabs ---------- */

.document-tabs {
    min-height: 56px;
    padding-left: 30px;
    gap: 8px;
    background: #fff;
    border-bottom: 1px solid var(--refresh-border);
}

.document-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 14px;
    border-bottom-width: 3px;
    color: #657d96;
    font-size: 14px;
    font-weight: 720;
}

.document-tab .ui-icon {
    width: 18px;
    height: 18px;
}

.document-tab.active {
    color: var(--refresh-text);
    border-bottom-color: #25b8ba;
}

.document-tab.active .ui-icon {
    color: #159da0;
}

/* ---------- Editor canvas ---------- */

.tab-panel.active {
    animation: none;
}

#tab-editor {
    padding-top: 22px;
}

.editor-panel {
    max-width: 1040px;
}

.form-section {
    border: 1px solid var(--refresh-border-soft);
    border-radius: 15px;
    background: var(--refresh-card);
    box-shadow:
        0 1px 2px rgba(14, 43, 80, .025),
        0 8px 28px rgba(14, 43, 80, .035);
}

.question-authoring-editor .question-editor-section {
    padding: 25px 27px !important;
}

.question-authoring-editor .section-heading {
    color: var(--refresh-text);
    font-weight: 780;
}

.visual-section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px !important;
}

.visual-section-heading.compact {
    margin-bottom: 0 !important;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
}

.section-icon .ui-icon {
    width: 23px;
    height: 23px;
    stroke-width: 1.9;
}

.section-icon-general {
    background: var(--refresh-aqua-soft);
    color: #12a9aa;
}

.section-icon-stem {
    background: var(--refresh-purple-soft);
    color: var(--refresh-purple);
}

.section-icon-media {
    background: #eaf4fe;
    color: #377db9;
}

.section-icon-options {
    background: #edf7f3;
    color: #2c946c;
}

.section-icon-explanation {
    background: #fff4df;
    color: #b87c1c;
}

.section-icon-settings {
    background: #edf3f8;
    color: #54718d;
}

.section-heading-title {
    display: block;
    line-height: 1.2;
    font-size: 18px;
    font-weight: 790;
}

.section-heading-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--refresh-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

/* ---------- Forms ---------- */

.form-label {
    margin-bottom: 7px;
    color: #183455;
    font-size: 13px;
    font-weight: 720;
}

.form-control,
.form-select {
    border-color: #cfdce7;
    border-radius: 7px;
    color: #20384f;
    box-shadow: none;
}

.form-control:not(textarea),
.form-select {
    min-height: 40px;
}

.form-control:focus,
.form-select:focus {
    border-color: #4bbfc0;
    box-shadow: 0 0 0 3px rgba(35, 183, 186, .11);
}

textarea.form-control {
    line-height: 1.55;
}

.topic-chip {
    border: 0;
    border-radius: 18px;
    background: #e4f5f4;
    color: #164e72;
    font-size: 12px;
    font-weight: 720;
}

.topic-remove {
    color: #6c8799;
}

#add-topic.btn-outline-secondary {
    border-color: #9eb0bf;
    color: #52687b;
    font-weight: 680;
}

.btn-outline-primary {
    border-color: #7da8c8;
    color: #2c678f;
}

.btn-outline-primary:hover {
    border-color: #2cb8ba;
    background: #e7f7f6;
    color: #147d80;
}

/* ---------- Options / media ---------- */

.question-option-card {
    border-color: var(--refresh-border-soft) !important;
    border-radius: 12px !important;
    background: #fbfdff !important;
}

.question-option-card.is-correct {
    border-color: rgba(47, 142, 109, .35) !important;
    background: #f5fbf8 !important;
}

.question-media-card {
    border-color: var(--refresh-border-soft) !important;
    background: #fbfdff !important;
}

.question-media-empty {
    border-color: #cddbe5 !important;
    background: #f8fbfd !important;
}

/* ---------- Switches ---------- */

.form-check-input:checked {
    border-color: #22b6b8;
    background-color: #22b6b8;
}

/* ---------- Preview and source ---------- */

.preview-container,
.source-panel {
    max-width: 1040px;
}

.source-toolbar {
    border-color: var(--refresh-border-soft);
    background: #fff;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .document-tabs {
        padding-left: 18px;
    }

    .question-authoring-editor .question-editor-section {
        padding: 22px !important;
    }

    .section-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
}

@media (max-width: 760px) {
    .app-header {
        min-height: 68px;
    }

    .studio-divider,
    .studio-name {
        display: none;
    }

    .save-status {
        display: none;
    }

    .document-title {
        font-size: 21px;
    }

    .document-tabs {
        gap: 0;
        padding-left: 10px;
    }

    .document-tab {
        padding-inline: 10px;
    }

    .visual-section-heading {
        align-items: flex-start;
    }
}

/* ============================================================
   Content navigation refinement
   ============================================================ */

#authoring-app .search-wrapper { position: relative; }

#authoring-app .search-wrapper > .search-icon {
    position: absolute !important;
    z-index: 2;
    left: 5px !important;
    top: 0 !important;
    bottom: auto !important;
    width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 12px !important;
    transform: none !important;
    box-sizing: border-box !important;
    color: #d8e8f5;
    pointer-events: none;
}

#authoring-app .tree-search.form-control {
    height: 42px;
    padding: 0 12px 0 43px;
}

.tree-item-icon, .breadcrumb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.tree-item-icon {
    width: 17px;
    height: 17px;
    margin-right: 8px;
    color: #8fb9cb;
}

.tree-item-icon svg, .breadcrumb-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tree-repository .tree-item-icon { color: #b7d6df; }
.tree-section-heading .tree-item-icon { color: #77c8cb; }
.tree-question .tree-item-icon { color: #35c7c5; }
.tree-question.active .tree-item-icon { color: #6be2df; }
.tree-folder .tree-item-icon { color: #9bbfd0; }
.tree-node.manifest .tree-item-icon { color: #3fc9c7; }

.tree-heading::before, .tree-node::before {
    content: none !important;
    display: none !important;
}

.tree-folder-icon, .tree-node-dot { display: none !important; }

.document-path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 7px;
    color: #8092a5;
    font-size: 13px;
}

.document-path::before {
    content: none !important;
    display: none !important;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: #71879e;
    white-space: nowrap;
}

.breadcrumb-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: #789bb9;
}

.breadcrumb-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    color: #9aafc1;
    font-size: 17px;
    line-height: 1;
}

.breadcrumb-item:last-child { color: #637d96; }


/* ---------- Sidebar section tabs ---------- */

.sidebar-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 14px 12px 0;
}

.sidebar-mode-tab {
    min-width: 0;
    padding: 8px 5px 9px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #91abc4;
    font-size: 12px;
    font-weight: 720;
    line-height: 1.2;
    text-align: center;
    transition:
        color .15s ease,
        border-color .15s ease,
        background .15s ease;
}

.sidebar-mode-tab:not(:disabled):hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .045);
}

.sidebar-mode-tab.active {
    border-bottom-color: #40d0ce;
    color: #ffffff;
}

.sidebar-mode-tab:disabled {
    color: rgba(145, 171, 196, .38);
    cursor: not-allowed;
}

.sidebar-mode-panel[hidden] {
    display: none !important;
}

.sidebar-placeholder {
    padding: 24px 20px;
}

.sidebar-placeholder-title {
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 780;
}

.sidebar-placeholder-text {
    color: #9bb5ce;
    font-size: 13px;
    line-height: 1.55;
}

#sidebar-panel-products.active {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
}

.product-sidebar-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 12px 13px;
}

.product-search-wrapper {
    position: relative;
    min-width: 0;
    flex: 1;
}

.product-search-wrapper .product-search-icon {
    position: absolute;
    z-index: 2;
    left: 0;
    top: 0;
    width: 42px;
    height: 42px;
    padding: 12px;
    color: #d8e8f5;
    pointer-events: none;
}

.product-search-wrapper .tree-search {
    height: 42px;
    padding: 0 12px 0 43px;
}

.product-sidebar-toolbar .icon-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin: 0;
    padding: 0;
}

#sidebar-panel-products .product-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 5px 8px 20px;
}

#sidebar-panel-products .product-list-item {
    width: 100%;
    display: block;
    margin: 0 0 4px;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #d9e5f2;
    text-align: left;
}

#sidebar-panel-products .product-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

#sidebar-panel-products .product-list-item.active {
    background: var(--navy-800);
    color: #fff;
}

.product-list-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

#sidebar-panel-products .product-list-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-list-price {
    flex: 0 0 auto;
    color: var(--aqua-200);
    font-size: 12px;
    font-weight: 700;
}

#sidebar-panel-products .product-list-meta {
    display: block;
    margin-top: 3px;
    color: #7893b4;
    font-size: 11px;
}

.sidebar-load-message {
    padding: 16px 10px;
    color: #8da7c7;
    font-size: 12px;
    line-height: 1.5;
}

.sidebar-load-message.error {
    color: #f0a7a7;
}

.product-admin-editor {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--page);
}

.product-admin-editor[hidden] {
    display: none !important;
}

.product-document-header {
    flex: 0 0 auto;
    min-height: 88px;
    display: flex;
    align-items: center;
    padding: 16px 28px 14px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.product-editor-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.product-editor-panel {
    width: min(900px, calc(100% - 50px));
    margin: 25px auto 50px;
}

.product-field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

.product-active-switch {
    margin-top: 20px;
}

.product-selection-count {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
}

.product-question-set-group {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.product-question-set-repository {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-soft);
    background: #f5f8fa;
    color: var(--navy-900);
    font-size: 12px;
    font-weight: 800;
}

.product-question-set-options {
    display: grid;
}

.product-question-set-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.product-question-set-option:last-child {
    border-bottom: 0;
}

.product-question-set-option:hover {
    background: #f9fbfc;
}

.product-question-set-option .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

.product-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.product-empty-state {
    padding: 14px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.product-editor-empty {
    width: min(520px, calc(100% - 50px));
    margin: auto;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    text-align: center;
    box-shadow: 0 8px 30px rgba(6, 38, 84, 0.06);
}

.product-editor-empty-title {
    margin-bottom: 7px;
    color: var(--navy-900);
    font-size: 20px;
    font-weight: 800;
}

.product-editor-empty-text {
    color: var(--text-soft);
    font-size: 14px;
}

@media (max-width: 800px) {
    .product-field-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Sidebar scrolling + resizing
   ============================================================ */

.workspace {
    --sidebar-width: 310px;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.content-sidebar {
    position: relative;
}

.sidebar-mode-tabs {
    flex: 0 0 auto;
}

.sidebar-mode-panel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sidebar-mode-panel.active {
    display: flex;
    flex-direction: column;
}

#sidebar-panel-content .content-tree {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-resize-handle {
    position: absolute;
    z-index: 50;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    touch-action: none;
    outline: none;
}

.sidebar-resize-handle::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3px;
    width: 2px;
    background: transparent;
    transition: background 120ms ease;
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle:focus-visible::after,
.sidebar-resizing .sidebar-resize-handle::after {
    background: var(--aqua-500);
}

body.sidebar-resizing,
body.sidebar-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

@media (max-width: 900px) {
    .workspace {
        --sidebar-width: 250px;
    }
}

/* ============================================================
   User administration
   ============================================================ */

#sidebar-panel-users.active {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
}

.user-sidebar-toolbar {
    flex: 0 0 auto;
    padding: 22px 12px 13px;
}

.user-search-wrapper {
    position: relative;
}

.user-search-wrapper .user-search-icon {
    position: absolute;
    z-index: 2;
    left: 0;
    top: 0;
    width: 42px;
    height: 42px;
    padding: 12px;
    color: #d8e8f5;
    pointer-events: none;
}

.user-search-wrapper .tree-search {
    height: 42px;
    padding: 0 12px 0 43px;
}

.user-category-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 5px 8px 20px;
}

.user-category-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    padding: 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #d9e5f2;
    text-align: left;
}

.user-category-item:hover {
    background: rgba(255, 255, 255, .06);
}

.user-category-item.active {
    background: var(--navy-800);
    color: #fff;
    box-shadow: inset 3px 0 0 #40d0ce;
}

.user-category-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #71cfd0;
}

.user-category-icon svg,
.user-section-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-category-label {
    min-width: 0;
    flex: 1;
    font-size: 13px;
    font-weight: 700;
}

.user-category-count {
    min-width: 26px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #a9c2d8;
    font-size: 11px;
    font-weight: 750;
    text-align: center;
}

.user-category-item.active .user-category-count {
    background: rgba(64, 208, 206, .16);
    color: #8be7e4;
}

.user-admin-surface {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--refresh-page);
}

.user-admin-surface[hidden] {
    display: none !important;
}

.user-document-header {
    flex: 0 0 auto;
    min-height: 112px;
    display: flex;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--refresh-border-soft);
    background: #fff;
}

.user-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.user-list-panel {
    width: min(1180px, calc(100% - 50px));
    margin: 26px auto 50px;
    overflow: hidden;
    border: 1px solid var(--refresh-border-soft);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(14, 43, 80, .035);
}

.user-list-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--refresh-border-soft);
}

.user-list-summary-title {
    color: var(--refresh-text);
    font-size: 17px;
    font-weight: 790;
}

.user-list-summary-text {
    margin-top: 3px;
    color: var(--refresh-muted);
    font-size: 12px;
}

.user-table-wrap {
    overflow-x: auto;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th {
    padding: 11px 16px;
    border-bottom: 1px solid var(--refresh-border-soft);
    background: #f8fbfd;
    color: #72869b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.user-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--refresh-border-soft);
    color: #29435e;
    font-size: 13px;
    vertical-align: middle;
}

.user-table-row {
    cursor: pointer;
    outline: none;
}

.user-table-row:last-child td {
    border-bottom: 0;
}

.user-table-row:hover td,
.user-table-row:focus td {
    background: #f8fcfd;
}

.user-identity-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e5f6f5;
    color: #128f91;
    font-size: 12px;
    font-weight: 850;
}

.user-identity-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-identity-text strong {
    overflow: hidden;
    color: #153454;
    font-size: 13px;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-identity-text span,
.user-table-muted {
    color: #7c90a4;
    font-size: 12px;
}

.user-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
}

.user-status.active {
    background: #e8f8f1;
    color: #21825e;
}

.user-status.inactive {
    background: #f2f3f5;
    color: #7e8994;
}

.user-permission-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.user-badge-pill {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
}

.user-badge-pill.admin {
    background: #eeeafd;
    color: #6850c5;
}

.user-badge-pill.author {
    background: #e5f6f5;
    color: #168e90;
}

.user-badge-pill.standard {
    background: #edf3f8;
    color: #60778d;
}

.user-product-count {
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef5fb;
    color: #39729d;
    font-size: 12px;
    font-weight: 800;
}

.user-row-chevron {
    color: #8fa4b8;
    font-size: 22px;
}

.user-list-message {
    padding: 32px;
    color: var(--refresh-muted);
    font-size: 13px;
    text-align: center;
}

.user-list-message.error {
    color: #b34e4e;
}

/* User editor modal */

body.user-modal-open {
    overflow: hidden;
}

.user-modal-backdrop {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(3, 20, 42, .58);
    backdrop-filter: blur(2px);
}

.user-modal-backdrop[hidden] {
    display: none !important;
}

.user-modal {
    width: min(920px, 100%);
    max-height: min(860px, calc(100vh - 56px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(1, 18, 39, .28);
}

.user-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 21px 25px 19px;
    border-bottom: 1px solid var(--refresh-border-soft);
}

.user-modal-kicker {
    margin-bottom: 3px;
    color: #18a6a8;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .12em;
}

.user-modal-header h2 {
    margin: 0;
    color: var(--refresh-text);
    font-size: 22px;
    font-weight: 800;
}

.user-modal-email {
    margin-top: 4px;
    color: var(--refresh-muted);
    font-size: 12px;
}

.user-modal-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: #f3f7fa;
    color: #6c8196;
    font-size: 25px;
    line-height: 1;
}

.user-modal-close:hover {
    background: #e9f1f6;
    color: #244968;
}

.user-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 25px 28px;
    background: #f6f9fb;
}

.user-modal-section {
    margin-bottom: 18px;
    padding: 21px;
    border: 1px solid var(--refresh-border-soft);
    border-radius: 13px;
    background: #fff;
}

.user-modal-section:last-child {
    margin-bottom: 0;
}

.user-modal-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 19px;
}

.user-modal-section-heading > span:last-child {
    display: flex;
    flex-direction: column;
}

.user-modal-section-heading strong {
    color: #173655;
    font-size: 15px;
    font-weight: 790;
}

.user-modal-section-heading small {
    margin-top: 2px;
    color: var(--refresh-muted);
    font-size: 11px;
}

.user-section-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
}

.user-section-icon.account {
    background: #e8f7f6;
    color: #13a1a3;
}

.user-section-icon.permissions {
    background: #f0edff;
    color: #7057d9;
}

.user-section-icon.products {
    background: #eef5fb;
    color: #397db1;
}

.user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.user-form-span {
    grid-column: 1 / -1;
}

.user-account-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 9px;
    background: #f7fafc;
}

.user-account-meta span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    color: #70869b;
    font-size: 11px;
}

.user-account-meta strong {
    color: #405c75;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.user-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--refresh-border-soft);
}

.user-switch-row:last-of-type {
    border-bottom: 0;
}

.user-switch-row > span:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-switch-row strong {
    color: #29435e;
    font-size: 13px;
    font-weight: 740;
}

.user-switch-row small {
    color: #8294a5;
    font-size: 11px;
}

.user-repository-access {
    margin-top: 15px;
}

.user-subheading {
    margin-bottom: 8px;
    color: #405c75;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.user-check-list {
    overflow: hidden;
    border: 1px solid var(--refresh-border-soft);
    border-radius: 9px;
}

.user-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--refresh-border-soft);
    cursor: pointer;
}

.user-check-row:last-child {
    border-bottom: 0;
}

.user-check-row:hover {
    background: #f9fbfc;
}

.user-check-row > span {
    display: flex;
    flex-direction: column;
}

.user-check-row strong {
    color: #29435e;
    font-size: 12px;
    font-weight: 720;
}

.user-check-row small {
    color: #8497a9;
    font-size: 10px;
}

.user-entitlement-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--refresh-border-soft);
}

.user-entitlement-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-entitlement-main strong {
    color: #29435e;
    font-size: 13px;
    font-weight: 760;
}

.user-entitlement-main span {
    color: #8294a5;
    font-size: 10px;
}

.user-entitlement-expiry {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #60778d;
    font-size: 11px;
    white-space: nowrap;
}

.user-grant-product {
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid var(--refresh-border-soft);
}

.user-grant-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) minmax(140px, .8fr) auto;
    gap: 9px;
    align-items: center;
}

.user-grant-help {
    margin-top: 6px;
    color: #899aaa;
    font-size: 10px;
}

.user-empty-inline {
    padding: 14px;
    border: 1px dashed #d5e1e9;
    border-radius: 9px;
    background: #fafcfd;
    color: #8294a5;
    font-size: 12px;
    text-align: center;
}

.user-modal-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 22px;
    border-top: 1px solid var(--refresh-border-soft);
    background: #fff;
}

.user-modal-actions {
    display: flex;
    gap: 9px;
}

.user-modal-status {
    color: #2a8b69;
    font-size: 12px;
    font-weight: 650;
}

.user-modal-status.error {
    color: #b34e4e;
}

@media (max-width: 820px) {
    .user-table th:nth-child(4),
    .user-table td:nth-child(4),
    .user-table th:nth-child(5),
    .user-table td:nth-child(5) {
        display: none;
    }

    .user-form-grid,
    .user-account-meta {
        grid-template-columns: 1fr;
    }

    .user-form-span {
        grid-column: auto;
    }

    .user-grant-grid {
        grid-template-columns: 1fr;
    }

    .user-entitlement-row {
        grid-template-columns: 1fr auto;
    }

    .user-revoke-product {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* The same named account menu as the customer website, alongside Save. */
.app-header { position: relative; z-index: 100; overflow: visible; }
.studio-user-menu { position: relative; color: #f4fbff; }
.studio-user-menu[hidden] { display: none; }
.studio-user-menu summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 650; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-user-menu summary::-webkit-details-marker { display: none; }
.studio-user-menu summary::after { content: "▾"; }
.studio-user-menu-panel { position: absolute; right: 0; top: 100%; min-width: 180px; background: white; border: 1px solid #dfe6ed; border-radius: 12px; padding: 8px; color: #071f41; box-shadow: 0 12px 30px rgba(7,31,65,.15); z-index: 200; }
.studio-user-menu-panel a, .studio-user-menu-panel button { display: block; padding: 12px; width: 100%; border: 0; border-radius: 6px; background: transparent; text-align: left; text-decoration: none; color: inherit; font: inherit; cursor: pointer; }
.studio-user-menu-panel a:hover, .studio-user-menu-panel button:hover { background: #edf8f7; }
@media (max-width: 620px) { .studio-user-menu summary { max-width: 130px; } }
