/* Structural adapters for existing PHP views; visual values follow the selected reference. */
.jm-admin-theme,
.jm-login {
    --jm-primary: var(--admin-primary);
    --jm-bg: var(--admin-bg);
    --jm-surface: var(--admin-surface);
    --jm-border: var(--admin-border);
    --jm-text: var(--admin-text);
    --jm-muted: var(--admin-muted);
    --jm-navy: var(--admin-sidebar);
}
:is(.jm-admin-theme, .jm-login) .brand-mark {
    clip-path: none;
    font-size: 18px;
    border-radius: 5px;
    flex-shrink: 0;
}
.jm-admin-theme .sidebar {
    padding: 0;
}
.jm-admin-theme .sidebar nav {
    flex: 1;
    min-height: 0;
}
.jm-admin-theme .sidebar :is(a, summary, button):focus-visible {
    outline: 2px solid #8fb7ff;
    outline-offset: -2px;
}
.jm-admin-theme .sidebar-bottom {
    flex-shrink: 0;
}
.jm-admin-theme .sidebar-bottom :is(a, button) {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 3px;
    font-size: 14px;
    color: inherit;
}
.jm-admin-theme .sidebar-bottom .workspace-note {
    display: flex;
    font-size: 9px;
}
.jm-admin-theme .sidebar .nav-item > .icon:not(.nav-chevron),
.jm-admin-theme .sidebar summary > .icon:not(.nav-chevron) {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}
.jm-admin-theme .subnav a {
    display: block;
}
.jm-admin-theme .search-form .field {
    flex: 1 1 140px;
    min-width: 140px;
    margin: 0;
}
.jm-admin-theme .search-form .field:first-child {
    flex: 2 1 240px;
}
.jm-admin-theme .shell.collapsed .sidebar-bottom a span,
.jm-admin-theme .shell.collapsed .sidebar-bottom button span {
    display: none;
}
.jm-admin-theme .jm-topbar {
    padding: 0 30px;
}
.jm-admin-theme .jm-topbar form {
    margin: 0;
}
.jm-admin-theme .profile-name {
    color: var(--admin-text);
}
.jm-admin-theme .profile-avatar {
    background: linear-gradient(135deg, #635bff, #b044cf);
    color: white;
}
.jm-admin-theme .profile-layer :is(b, dd) {
    overflow-wrap: anywhere;
}
.jm-admin-theme .profile-layer-heading > div {
    min-width: 0;
}
.jm-admin-theme .jm-content {
    width: 100%;
    min-width: 0;
}
.jm-admin-theme .jm-content .card {
    padding: 23px;
    margin-bottom: 20px;
    box-shadow: none;
}
.jm-admin-theme .card-heading :is(h2, h3) {
    font-size: 16px;
    margin: 0;
}
.jm-admin-theme .jm-content > .card > :is(h2, h3) {
    margin-bottom: 20px;
}
.jm-admin-theme :is(.form-grid, .grid, .feature-grid, .info-grid) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.jm-admin-theme .feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.jm-admin-theme .feature-card,
.jm-admin-theme .welcome-banner {
    padding: 23px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    box-shadow: none;
}
.jm-admin-theme .welcome-banner {
    margin-bottom: 20px;
}
.jm-admin-theme .welcome-banner p {
    margin: 12px 0 20px;
    color: var(--admin-muted);
}
.jm-admin-theme .welcome-banner h2 {
    font-size: 24px;
}
.jm-admin-theme .feature-card p {
    margin: 12px 0;
    color: var(--admin-muted);
}
.jm-admin-theme .field {
    margin-bottom: 18px;
}
.jm-admin-theme .form-grid .field {
    margin-bottom: 0;
}
.jm-admin-theme .form-actions,
.jm-admin-theme .filters,
.jm-admin-theme .actions {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}
.jm-admin-theme .filters {
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    background: var(--admin-surface);
}
.jm-admin-theme .filters :is(input, select) {
    flex: 1 1 140px;
    width: auto;
}
.jm-admin-theme .filters label {
    flex: 1 1 140px;
    min-width: 0;
}
.jm-admin-theme :is(.table-wrap, .table-scroll) {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    margin: 0;
}
.jm-admin-theme table {
    min-width: 650px;
    table-layout: auto;
}
.jm-admin-theme table.jm-table-wide {
    min-width: 1100px;
}
.jm-admin-theme .jm-table-dense {
    min-width: 0;
    max-width: 100%;
}
.jm-admin-theme .jm-table-dense table {
    min-width: 1100px;
}
.jm-admin-theme .jm-table-wide table {
    min-width: 1400px;
}
.jm-admin-theme .skin-dialog {
    width: min(1200px, calc(100vw - 32px));
    border-radius: 12px;
}
.jm-admin-theme .skin-new-dialog,
.jm-admin-theme .skin-rename-dialog {
    width: min(450px, calc(100vw - 32px));
}
.jm-admin-theme table :is(th, td):first-child {
    text-align: left;
}
.jm-admin-theme table :is(th, td):has(input[type=checkbox]) {
    text-align: center;
}
.jm-admin-theme td {
    padding: 12px 10px;
    overflow: visible;
    text-overflow: clip;
}
.jm-admin-theme .jm-table-dense td {
    height: 36px;
    padding: 8px 10px;
}
.jm-admin-theme td :is(a, .btn) {
    max-width: none;
}
.jm-admin-theme .pagination {
    padding: 19px 0 0;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.jm-admin-theme .pagination .btn {
    min-height: 28px;
    padding: 5px 9px;
    font-size: 11px;
}
.jm-admin-theme .badge {
    font-size: 11px;
}
.jm-admin-theme :is(.note, .read-only-notice) {
    color: var(--admin-muted);
    font-size: 12px;
    line-height: 1.7;
    padding: 12px 0;
}
.jm-admin-theme .read-only-notice {
    padding: 12px 16px;
    background: #fff7e6;
    color: #b77909;
    border: 1px solid #f3dfb4;
    border-radius: 6px;
    margin-bottom: 20px;
}
.jm-admin-theme .prose,
.jm-admin-theme .guide-document,
.jm-admin-theme :is(.note, .alert, .card-heading, .page-heading) {
    overflow-wrap: anywhere;
}
.jm-admin-theme .alert {
    margin-bottom: 20px;
}
.jm-admin-theme .alert[role=alert] {
    background: #fff0f1;
    color: var(--admin-danger);
}
.jm-admin-theme .danger-text {
    color: var(--admin-danger);
}
.jm-admin-theme .skin-workbench {
    min-width: 0;
    overflow: hidden;
}
.jm-admin-theme #jm-confirm-dialog form {
    display: block;
}
.jm-admin-theme .jm-sidebar-overlay {
    position: fixed;
    inset: 64px 0 0 226px;
    z-index: 25;
    background: #12223844;
    border-radius: 0;
}
.jm-admin-theme .jm-sidebar-close {
    position: absolute;
    right: 8px;
    top: 4px;
    color: white;
}
.jm-admin-theme [hidden],
.jm-login [hidden] {
    display: none !important;
}
.jm-login .login-card {
    width: auto;
    max-width: none;
}
.jm-login .login-error {
    margin-bottom: 20px;
}
.jm-login .site-link {
    display: inline-flex;
    margin-top: 20px;
}
@media (max-width: 1100px) {
    .jm-admin-theme .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .jm-admin-theme .search-form .field:first-child {
        flex: 1 1 100%;
    }
    .jm-admin-theme:not(.jm-layout-ready) .shell {
        display: block;
    }
    .jm-admin-theme:not(.jm-layout-ready) .sidebar {
        position: static;
        width: 100%;
    }
    .jm-admin-theme:not(.jm-layout-ready) #jm-layout-toggle {
        display: none;
    }
    .jm-admin-theme .jm-topbar {
        padding: 0 15px;
    }
    .jm-admin-theme .jm-content .card {
        padding: 18px;
    }
    .jm-admin-theme :is(.form-grid, .grid, .feature-grid, .info-grid, .editor-layout) {
        grid-template-columns: minmax(0, 1fr);
    }
    .jm-admin-theme .filters > * {
        min-width: 0;
        max-width: 100%;
    }
    .jm-admin-theme .shell:not(.collapsed) .workspace::after {
        display: none;
    }
}
