.hidden {
    display: none;
}

th.actions {
    width: 0;
}

.form-group {
    margin-bottom: 0.5rem !important;
}

.navbar .navbar-header {
    display: flex;
    justify-content: space-between;
    width: 100% !important;
}

.navbar .navbar-header .navbar-brand img {
    max-height: 40px;
}

.topbar .top-navbar .navbar-header .navbar-brand .logo-icon {
    margin: 0;
}

.topbar .top-navbar .navbar-header .navbar-brand .logo-text {
    margin-left: 5px;
}

.topbar .navbar-nav .profile-pic {
    object-fit: cover;
}

.input-group-prepend .input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-append .input-group-text {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.mt-label {
    margin-top: 27px;
}

.row.entry-form-repeater {
    border-top: solid rgba(30, 136, 229, .2) 1px;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.area-description {
    font-size: small;
    color: rgba(30, 136, 229, .6);
}

.rounded-square {
    border-radius: 30%;
}

.dropdown-menu.dropdown-menu-actions.show {
    margin-left: -100px !important;
}

table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable td:last-child, table.table-bordered.dataTable td:last-child {
    border-right-width: 0 !important;
}

.dropzone .dz-preview .dz-details {
    padding: 1em 0.5em;
}

.dropzone .dz-message {
    margin: 1.5em 0 calc(1.5em + 5px);
}

.dropzone-container {
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-align: center;
}

.dropzone {
    border: none;
}

.tox-tinymce {
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
}

.EasyMDEContainer {
    width: 100%;
}

.EasyMDEContainer .CodeMirror {
    border-color: #e9ecef;
    border-radius: 0 0 4px 4px;
    min-height: 280px;
}

.editor-toolbar {
    border-color: #e9ecef;
    background: #f8f9fa;
}

.tagify {
    width: 100% !important;
    border: 1px solid #e9ecef !important;
    border-radius: 4px;
    --tag-bg: #2e8de6 !important;
    --tag-hover: #2e8de6 !important;
    --tag-text-color: white !important;
    --tag-remove-bg: none !important;
    --tag-pad: 0 0.2em !important;
}

.tagify__input {
    line-height: 21px !important;
    padding: 3px !important;
}

.tagify__tag {
    background-color: #2e8de6 !important;
    border: 1px solid #0c7bd9 !important;
    border-radius: 4px;
}

.sidebar-item .first-level {
    padding: 5px 0 0 5px !important;
}

.sidebar-subitem.active {
    margin-top: 0.25em !important;
    background-color: aliceblue;
    border-radius: 4px;
}

/* Keep the fixed sidebar inside the viewport, including mobile browser chrome. */
#main-wrapper[data-layout="vertical"][data-sidebar-position="fixed"] .left-sidebar {
    height: 100vh;
    height: 100dvh;
}

/* This menu has no sidebar footer; use all space below the header for native scrolling. */
#main-wrapper[data-layout="vertical"] .left-sidebar .scroll-sidebar {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

/* Keep admin sections compact and every destination visible. */
#main-wrapper .sidebar-nav #sidebarnav.admin-nav .admin-nav-heading {
    padding: 16px 8px 6px;
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.04em;
    opacity: 1;
    white-space: normal;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .admin-nav-heading:first-child {
    padding-top: 0;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-item {
    margin-bottom: 2px;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-link {
    padding: 7px 8px;
    gap: 8px;
    line-height: 20px;
    opacity: 0.85;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-link i {
    flex-shrink: 0;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-link .hide-menu {
    white-space: normal;
    overflow-wrap: anywhere;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-link.active {
    background-color: #1565c0;
    color: #fff;
    font-weight: 500;
    opacity: 1;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-link:not(.active):hover,
#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-link:not(.active):focus-visible {
    background-color: rgba(127, 127, 127, 0.12);
    opacity: 1;
}

#main-wrapper .sidebar-nav #sidebarnav.admin-nav .sidebar-link:focus-visible {
    outline: 2px solid #1e88e5;
    outline-offset: 2px;
}

/*
 * Bootstrap 5.0 background helpers do not choose a foreground color.
 * Keep badges readable even when a view also adds text-* utility classes.
 */
.badge.bg-primary,
.badge.bg-secondary,
.badge.bg-info,
.badge.bg-dark,
.badge.bg-dark-primary,
.badge.bg-dark-danger {
    color: #fff !important;
}

.badge.bg-white,
.badge.bg-light,
.badge.bg-success,
.badge.bg-warning,
.badge.bg-danger,
.badge.bg-light-primary,
.badge.bg-light-secondary,
.badge.bg-light-success,
.badge.bg-light-info,
.badge.bg-light-warning,
.badge.bg-light-danger,
.badge.bg-dark-success,
.badge.bg-dark-info,
.badge.bg-dark-warning {
    color: #000 !important;
}

/*
 * The dark theme replaces light/white helpers and status colors with dark,
 * semi-transparent backgrounds. Override the light-theme foreground mapping
 * after that transformation instead of relying on the original class name.
 */
body[data-theme="dark"] .badge.bg-white,
body[data-theme="dark"] .badge.bg-light,
body[data-theme="dark"] .badge.bg-primary,
body[data-theme="dark"] .badge.bg-secondary,
body[data-theme="dark"] .badge.bg-success,
body[data-theme="dark"] .badge.bg-info,
body[data-theme="dark"] .badge.bg-warning,
body[data-theme="dark"] .badge.bg-danger,
body[data-theme="dark"] .badge.bg-dark,
body[data-theme="dark"] .badge.bg-light-primary,
body[data-theme="dark"] .badge.bg-light-secondary,
body[data-theme="dark"] .badge.bg-light-success,
body[data-theme="dark"] .badge.bg-light-info,
body[data-theme="dark"] .badge.bg-light-warning,
body[data-theme="dark"] .badge.bg-light-danger {
    color: #fff !important;
}

#main-wrapper .left-sidebar[data-sidebarbg="skin6"] #sidebarnav.admin-nav .admin-nav-heading {
    color: #607d8b;
}

/* Compact admin review screens */
.preset-model-row { display:grid; grid-template-columns:minmax(180px,1fr) minmax(180px,1.5fr) auto; gap:12px; align-items:baseline; border-bottom:1px solid #eef0f3; padding:6px 0; }
.text-prewrap { white-space:pre-wrap; overflow-wrap:anywhere; }
[data-preset-row][hidden], [hidden] { display:none !important; }
[data-preset-row] .card-body { padding:12px 18px; }
[data-preset-row] summary, details > summary { cursor:pointer; }
[id^="version-"] { scroll-margin-top:90px; }
[id^="version-"]:target { outline:3px solid #1565c0; }
.visual-ref-card { scroll-margin-top:90px; }
@media (max-width:767px) { .preset-model-row { grid-template-columns:1fr; gap:2px; } }

.preset-summary { color:#344054; }

/* Preset actions: keep Popper's end alignment despite the theme's right:auto override. */
[data-preset-row] .dropdown-menu[data-popper-placement="bottom-end"],
[data-preset-row] .dropdown-menu[data-popper-placement="top-end"] {
    right: 0 !important;
}

[data-preset-row] [data-bs-toggle="dropdown"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    color: #344054;
    background-color: #f8fafc;
    border-color: #b8c4d2;
}

[data-preset-row] [data-bs-toggle="dropdown"]:hover,
[data-preset-row] [data-bs-toggle="dropdown"][aria-expanded="true"] {
    color: #1558a6;
    background-color: #e8f1fc;
    border-color: #1565c0;
}

[data-preset-row] .dropdown-menu {
    width: min(18rem, calc(100vw - 6rem));
    min-width: 0;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px #23364d26;
}

[data-preset-row] .dropdown-item {
    padding: 10px 12px;
    color: #243247;
    font-weight: 500;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    border-radius: 4px;
}

[data-preset-row] .dropdown-item:hover,
[data-preset-row] .dropdown-item:focus {
    color: #1558a6;
    background-color: #e8f1fc;
}

[data-preset-row] [data-bs-toggle="dropdown"]:focus-visible,
[data-preset-row] .dropdown-item:focus-visible {
    outline: 2px solid #1565c0;
    outline-offset: -2px;
}

body[data-theme="dark"] [data-preset-row] [data-bs-toggle="dropdown"],
body[data-theme="dark"] [data-preset-row] .dropdown-menu {
    color: #e4ecf6;
    background-color: #202b3b;
    border-color: #63748b !important;
}

body[data-theme="dark"] [data-preset-row] .dropdown-item {
    color: #e4ecf6;
}

body[data-theme="dark"] [data-preset-row] [data-bs-toggle="dropdown"]:hover,
body[data-theme="dark"] [data-preset-row] [data-bs-toggle="dropdown"][aria-expanded="true"],
body[data-theme="dark"] [data-preset-row] .dropdown-item:hover,
body[data-theme="dark"] [data-preset-row] .dropdown-item:focus {
    color: #fff;
    background-color: #334b6b;
}

body[data-theme="dark"] [data-preset-row] [data-bs-toggle="dropdown"]:focus-visible,
body[data-theme="dark"] [data-preset-row] .dropdown-item:focus-visible {
    outline-color: #8bbdff;
}

.feedback-issue > summary { list-style:none; position:relative; padding-left:36px !important; }
.feedback-issue > summary::-webkit-details-marker { display:none; }
.feedback-issue > summary::before { content:"▸"; position:absolute; left:16px; top:16px; }
.feedback-issue[open] > summary::before { content:"▾"; }
#queue-results table { min-width:720px; }
#queue-results .queue-actions { min-width:165px; max-width:200px; position:sticky; right:0; background:#fff; z-index:1; }
#queue-results th:last-child { position:sticky; right:0; background:#fff; z-index:2; }
#queue-results .queue-progress { max-width:260px; overflow-wrap:anywhere; }
#queue-results .queue-updated { max-width:140px; }
#queue-results td { padding:12px 10px; }

/* Feedback and processing history: summary first, details on demand. */
.feedback-dashboard { max-width:1320px; margin:0 auto; color:#344054; }
.feedback-panel { border:1px solid #dfe6ed; border-radius:12px; box-shadow:0 3px 14px #23364d08; }
.feedback-filters { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding:20px 24px; border-bottom:1px solid #e8edf2; }
.feedback-filters .form-label { display:block; margin-bottom:6px; color:#475467; font-weight:500; }
.feedback-filter-wide { flex:1 1 190px; }
.feedback-filter-language { flex:0 1 170px; min-width:140px; }
.feedback-filters .select2-container { min-width:0; }
.feedback-filters .select2-container .select2-selection--single { height:36px; border:1px solid #d0d9e3; border-radius:4px; }
.feedback-filters .select2-container .select2-selection__rendered { line-height:34px; padding-left:10px; padding-right:30px; font-size:13px; }
.feedback-filters .select2-container .select2-selection__arrow { height:34px; }
.feedback-filters .form-control, .feedback-filters .form-select { min-height:36px; border-color:#d0d9e3; }
.feedback-filters .btn { min-height:36px; }
.feedback-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:20px 24px; gap:24px; }
.feedback-metrics > div { display:flex; align-items:center; gap:12px; }
.feedback-metrics > div + div { border-left:1px solid #e8edf2; padding-left:24px; }
.feedback-metrics strong { font-size:24px; color:#1d2939; line-height:1.3; }
.feedback-metric-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:10px; background:#f0f4f8; color:#64748b; font-size:21px; flex-shrink:0; }
.feedback-positive { color:#157347; background:#edf8f1; }
.feedback-negative { color:#b42318; background:#fff1ef; }
.feedback-tabs { display:flex; gap:24px; padding:0 24px; border-bottom:1px solid #e4e9f0; }
.feedback-tabs a { padding:14px 0; color:#667085; border-bottom:3px solid transparent; font-weight:500; }
.feedback-tabs a[aria-current="page"] { color:#1565c0; border-color:#1565c0; }
.feedback-results { padding:20px 24px; }
.feedback-results .table { margin-bottom:0; }
.feedback-results th { background:#f7f9fc; color:#475467; font-size:12px; font-weight:600; border-bottom:1px solid #e4e9f0; }
.feedback-results td { padding:14px 10px; }
.feedback-results .feedback-issue { box-shadow:none; border:1px solid #e4e9f0; border-radius:8px; }
.feedback-issue > summary:hover { background:#f7f9fc; }
.admin-empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:44px 16px; min-height:220px; }
.admin-empty-icon { display:grid; place-items:center; width:56px; height:56px; border-radius:50%; background:#f0f4f8; color:#718198; font-size:28px; margin-bottom:18px; }
.admin-empty-state h5 { font-size:16px; font-weight:500; color:#475467; margin:0; }
.processing-history { border-radius:12px; }
.versions-filter { max-width:850px; }
.versions-overview { display:flex; flex-wrap:wrap; gap:8px 24px; color:#667085; font-size:13px; }
.versions-overview strong { color:#344054; margin-left:6px; }
.versions-help { color:#667085; max-width:1000px; }
.processing-version { border:1px solid #dce4ed; border-radius:8px; background:#fff; }
.version-archived { background:#f8fafc; }
.version-header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; padding:14px 16px 10px; }
.version-header > div:first-child { flex:1 1 320px; min-width:0; }
.version-meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; color:#667085; font-size:12px; margin-top:6px; }
.version-meta strong { color:#344054; font-weight:500; }
.version-header-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.version-details > summary { padding:8px 16px 12px; color:#1565c0; font-size:13px; width:fit-content; }
.version-details[open] > summary { font-weight:500; }
.version-actions { position:relative; }
.version-actions > summary { list-style:none; }
.version-actions > summary::-webkit-details-marker { display:none; }
.version-actions-menu { position:absolute; top:calc(100% + 5px); right:0; z-index:20; width:280px; max-width:80vw; padding:8px; background:#fff; border:1px solid #dce4ed; border-radius:8px; box-shadow:0 8px 24px #23364d24; }
.version-actions-menu > a, .version-actions-menu form, .version-actions-menu form .btn { display:block !important; width:100%; text-align:left; }
.version-actions-menu .btn { border:0; border-radius:4px; padding:8px 10px; }
.version-actions-menu .btn:hover { background:#f0f4f8; color:#1565c0; }
.version-actions-menu form:last-child { border-top:1px solid #e4e9f0; margin-top:6px; padding-top:6px; }
.version-error { max-width:100%; font-size:12px; }
.version-error summary { max-width:100%; }
.feedback-dashboard a:focus-visible, .processing-history summary:focus-visible { outline:2px solid #1565c0; outline-offset:3px; }
@media (max-width:767px) {
    .feedback-filters, .feedback-results { padding:16px; }
    .feedback-metrics { padding:16px; gap:12px; }
    .feedback-metrics > div { gap:6px; }
    .feedback-metrics > div + div { padding-left:12px; }
    .feedback-metric-icon { display:none; }
    .feedback-metrics strong { font-size:22px; }
    .feedback-tabs { padding:0 16px; gap:16px; font-size:13px; }
    .version-header-actions { width:100%; }
    .version-actions-menu { position:fixed; top:auto; bottom:16px; left:16px; right:16px; width:auto; max-width:none; }
}
body[data-theme="dark"] .feedback-dashboard { color:#d8e2ef; }
body[data-theme="dark"] .feedback-panel, body[data-theme="dark"] .processing-version, body[data-theme="dark"] .version-actions-menu { background:#202b3b; border-color:#3c4a5e; }
body[data-theme="dark"] .feedback-filters .form-label, body[data-theme="dark"] .feedback-metrics strong, body[data-theme="dark"] .admin-empty-state h5, body[data-theme="dark"] .version-meta strong, body[data-theme="dark"] .versions-overview strong { color:#e4ecf6; }
body[data-theme="dark"] .feedback-tabs a, body[data-theme="dark"] .version-meta, body[data-theme="dark"] .versions-overview, body[data-theme="dark"] .versions-help { color:#b1bfd0; }
body[data-theme="dark"] .feedback-tabs a[aria-current="page"], body[data-theme="dark"] .version-details > summary { color:#8bbdff; }
body[data-theme="dark"] .feedback-results th, body[data-theme="dark"] .feedback-issue > summary:hover, body[data-theme="dark"] .version-actions-menu .btn:hover { background:#2a384b; color:#e4ecf6; }
