.im-my-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
}

.im-hub {
    max-width: 1180px;
    margin: 0 auto;
}

.im-hub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.im-hub-title h1 {
    margin: 0 0 6px;
    font-size: 2rem;
    line-height: 1.15;
}

.im-hub-title p {
    margin: 0;
    color: #475569;
}

.im-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-color: #d5e0e8;
    background: #fff;
    color: #26384a;
    font-weight: 700;
    padding-right: 14px;
    padding-left: 12px;
}

.im-profile-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 999px;
    position: relative;
    flex: 0 0 auto;
}

.im-profile-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 18px;
    height: 8px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
    transform: translateX(-50%);
}

.im-hub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #d7e2dc;
    margin-bottom: 22px;
}

.im-hub-tab {
    display: block;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    color: #334155;
    font-weight: 800;
    text-decoration: none;
}

.im-hub-tab.active {
    background: #eef6ff;
    border-color: #bad5ff;
    color: #005ce6;
}

.im-hub-content {
    min-width: 0;
}

.im-manage-filters,
.im-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

.im-manage-filters .form-control,
.im-manage-filters .custom-select,
.im-bulk-toolbar .custom-select {
    min-width: 190px;
}

.im-my-sidebar {
    border-right: 1px solid #d7e2dc;
    padding: 24px 12px 24px 0;
}

.im-my-sidebar > a {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
}

.im-my-sidebar > a.active {
    background: #eef2f7;
    color: #005ce6;
}

.im-help {
    margin-top: 28px;
    padding: 16px;
    border: 1px solid #d7e2dc;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.9rem;
}

.im-help p {
    margin: 12px 0 0;
}

.im-my-panel {
    border: 1px solid #d7e2dc;
    border-radius: 8px;
    padding: 24px;
    background: #fff;
}

.im-my-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.im-my-title h1 {
    margin: 0 0 6px;
    font-size: 2rem;
    line-height: 1.15;
}

.im-my-title p {
    margin: 0;
    color: #475569;
}

.im-count {
    padding: 14px 18px;
    border: 1px solid #d7e2dc;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: 800;
    white-space: nowrap;
}

.im-filterbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 260px) auto auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 20px;
}

.im-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.im-field input,
.im-field select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d7e2dc;
    border-radius: 8px;
    padding: 8px 12px;
}

.im-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.im-tab {
    display: flex;
    min-height: 82px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid #d8e4ec;
    border-radius: 10px;
    background: #f8fbff;
    color: #1d4ed8;
    text-align: center;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .04);
}

.im-tab-current {
    background: #f4fbf7;
    border-color: #d8e4ec;
    color: #166534;
}

.im-tab-upcoming {
    background: #f5f9ff;
    border-color: #d8e4ec;
    color: #1d4ed8;
}

.im-tab-pending {
    background: #fffaf0;
    border-color: #d8e4ec;
    color: #92400e;
}

.im-tab-finished {
    background: #f8fafc;
    border-color: #d8e0e8;
    color: #334155;
}

.im-tab.active {
    border-color: #b7c9d6;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
}

.im-tab:hover {
    text-decoration: none;
    border-color: #b7c9d6;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.im-tab-count {
    display: block;
    font-size: 1.85rem;
    line-height: 1;
}

.im-tab-label {
    display: block;
    color: #475569;
    font-size: .86rem;
    line-height: 1.2;
}

.im-training-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 19px 22px;
    border: 1px solid #d7e2dc;
    border-radius: 10px;
    margin-bottom: 18px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
}

.im-card-main {
    min-width: 0;
    flex: 1 1 auto;
}

.im-training-card h3 {
    margin: 8px 0 8px;
    font-size: 1.18rem;
    line-height: 1.25;
}

.im-subtitle,
.im-dates {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #526174;
    font-size: .94rem;
    line-height: 1.35;
}

.im-dates::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1.8px solid currentColor;
    border-radius: 3px;
    box-shadow: inset 0 3px 0 rgba(82, 97, 116, .18);
    opacity: .78;
}

.im-access-note {
    margin: 0 0 8px;
    color: #334155;
    font-weight: 700;
}

.im-status {
    display: inline-block;
    padding: 4px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #eef2f7;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
}

.state-current {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #166534;
}

.state-upcoming {
    background: #eff8ff;
    border-color: #b2ddff;
    color: #1d4ed8;
}

.state-pending {
    background: #fffaeb;
    border-color: #fedf89;
    color: #92400e;
}

.state-finished {
    background: #f8fafc;
    border-color: #d8e0e8;
    color: #334155;
}

.im-status.status-waitlisted,
.im-status.state-waitlisted {
    background: #eff8ff;
    border-color: #b2ddff;
    color: #175cd3;
}

.im-status.status-rejected,
.im-status.state-rejected {
    background: #fff1f0;
    border-color: #f4c7c3;
    color: #9f2a22;
}

.im-status.status-cancelled,
.im-status.state-cancelled {
    background: #f8fafc;
    border-color: #d8e0e8;
    color: #475569;
}

.im-training-card details {
    margin-top: 10px;
}

.im-training-card summary {
    cursor: pointer;
    color: #005ce6;
    font-weight: 800;
}

.im-detailbox {
    margin-top: 8px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.im-card-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-width: 168px;
    max-width: 220px;
    gap: 7px;
}

.im-card-actions .btn {
    margin: 0;
    white-space: nowrap;
}

.im-primary-action {
    font-weight: 800;
}

.im-secondary-action {
    color: #075f9b;
    font-weight: 700;
    text-align: center;
}

.im-secondary-action::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 14px;
    margin-right: 6px;
    border: 1.6px solid currentColor;
    border-radius: 2px;
    vertical-align: -2px;
}

.im-editions-table td:last-child {
    min-width: 360px;
}

.im-edition-code {
    margin-bottom: 6px;
    font-weight: 700;
}

.im-edition-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.im-edition-actions .btn {
    margin: 0;
    white-space: nowrap;
}

.im-management-shell {
    margin-bottom: 28px;
    border-bottom: 1px solid #d7e2dc;
}

.im-management-heading h1 {
    margin: 0 0 4px;
    font-size: 1.9rem;
}

.im-management-heading p,
.im-page-intro,
.im-section-title p {
    color: #526174;
}

.im-management-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 18px;
}

.im-management-link {
    padding: 10px 14px;
    border-bottom: 3px solid transparent;
    color: #26384a;
    font-weight: 700;
    text-decoration: none;
}

.im-management-link.active {
    border-color: #0875c1;
    color: #005fa3;
}

.im-workspace-section {
    margin: 30px 0;
}

.im-operational-summary {
    margin: 22px 0 28px;
    padding: 18px;
    border: 1px solid #d6e0e7;
    border-left: 4px solid #0875c1;
    border-radius: 8px;
    background: #f8fafc;
}

.im-summary-heading {
    margin-bottom: 14px;
}

.im-summary-heading h2 {
    margin: 0 0 3px;
    font-size: 1.25rem;
}

.im-summary-heading p {
    margin: 0;
    color: #526174;
}

.inscriptionmanager-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(105px, 1fr));
    gap: 8px;
}

.im-kpi {
    display: flex;
    min-height: 72px;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #d6e0e7;
    border-top: 3px solid #7890a3;
    border-radius: 6px;
    background: #fff;
}

.im-kpi-label {
    color: #526174;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
}

.im-kpi-value {
    color: #152536;
    font-size: 1.45rem;
    line-height: 1;
}

.im-kpi-activeforms { border-top-color: #0875c1; }
.im-kpi-pending { border-top-color: #d59a00; }
.im-kpi-waitlisted { border-top-color: #8b5bb4; }
.im-kpi-enrolled { border-top-color: #278354; }
.im-kpi-rejected { border-top-color: #b84747; }
.im-kpi-cancelled { border-top-color: #687683; }

.im-courses-workspace,
.im-requests-workspace {
    padding: 24px 0;
    border-top: 1px solid #d6e0e7;
}

.im-courses-workspace {
    background: #fff;
}

.im-requests-workspace {
    padding-right: 22px;
    padding-left: 22px;
    border: 1px solid #cbdce7;
    border-radius: 8px;
    background: #f6f9fb;
}

.im-user-notices {
    margin-bottom: 22px;
}

.im-user-notices h2 {
    font-size: 1.25rem;
}

.im-notice-actions {
    margin-top: 8px;
}

.im-document-details {
    margin-top: 10px;
}

.im-user-document {
    margin-top: 6px;
}

.im-communication-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.im-comms-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.im-comms-kpi {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #d5e0e8;
    border-radius: 6px;
    background: #f7f9fb;
}

.im-comms-kpi.status-failed,
.im-comms-kpi.status-observed,
.im-comms-kpi.status-replacement { background: #fff3cd; }
.im-comms-kpi.status-sent,
.im-comms-kpi.status-approved { background: #e4f5e9; }

.im-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 16px;
}

.im-section-title h2,
.im-section-title p {
    margin: 0 0 4px;
}

.im-edition-search,
.im-request-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.im-edition-search {
    display: grid;
    grid-template-columns: minmax(260px, 360px) auto;
    align-items: center;
    gap: 8px;
}

.im-edition-search .form-control {
    min-width: 0;
    min-height: 42px;
}

.im-edition-search .btn {
    min-height: 42px;
    margin: 0;
}

.im-editions-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.im-edition-card {
    border: 1px solid #cfdbe3;
    border-left: 4px solid #7c9caf;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 7px rgba(25, 55, 75, .05);
}

.im-edition-card[open] {
    border-left-color: #0875c1;
    box-shadow: 0 5px 16px rgba(25, 55, 75, .09);
}

.im-edition-summary {
    position: relative;
    display: block;
    padding-right: 150px;
    cursor: pointer;
    list-style: none;
}

.im-edition-summary::-webkit-details-marker {
    display: none;
}

.im-edition-summary:hover {
    background: #f4f8fb;
}

.im-edition-expand {
    position: absolute;
    right: 18px;
    top: 50%;
    color: #006bb3;
    font-weight: 700;
    transform: translateY(-50%);
}

.im-edition-expand::before {
    content: "+";
    display: inline-grid;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    place-items: center;
    border: 1px solid #9fc4da;
    border-radius: 50%;
    background: #eef7fc;
    line-height: 1;
}

.im-tools-close {
    display: none;
}

.im-edition-card[open] .im-edition-expand::before {
    content: "-";
}

.im-edition-card[open] .im-tools-open {
    display: none;
}

.im-edition-card[open] .im-tools-close {
    display: inline;
}

.im-edition-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
}

.im-edition-card h3 {
    margin: 0 0 5px;
    font-size: 1rem;
    line-height: 1.3;
}

.im-edition-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #526174;
    font-size: .86rem;
}

.im-lifecycle,
.im-request-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: #edf3f7;
    font-weight: 700;
}

.im-request-status.status-pending {
    background: #fff2c7;
    color: #745300;
}

.im-request-status.status-waitlisted {
    background: #efe3f8;
    color: #63388a;
}

.im-request-status.status-observed {
    background: #fff3cd;
    color: #755600;
}

.im-request-status.status-approved,
.im-request-status.status-enrolled {
    background: #dff3e7;
    color: #17633c;
}

.im-request-status.status-rejected {
    background: #f9dddd;
    color: #8e2929;
}

.im-request-status.status-cancelled {
    background: #e9edf0;
    color: #45535f;
}

.im-lifecycle.state-missing {
    background: #fff3cd;
    color: #714f00;
}

.im-lifecycle.state-hidden {
    background: #edf0f3;
    color: #526174;
}

.im-edition-action-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-top: 1px solid #e5ebf0;
    background: #f8fafb;
}

.im-action-group {
    display: block;
    margin: 0;
    padding: 14px 16px 16px;
    border-right: 1px solid #e0e7ec;
}

.im-action-group:last-child {
    border-right: 0;
}

.im-action-group-label {
    display: block;
    margin: 0 0 9px;
    color: #3e5364;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.im-edition-card .im-edition-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.im-tool-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #c9d8e3;
    border-radius: 5px;
    background: #fff;
    color: #075f9b;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.im-tool-link:hover {
    border-color: #7ca9c6;
    background: #eef6fa;
    color: #003f6b;
    text-decoration: none;
}

.im-tool-link.is-primary {
    border-color: #0875c1;
    background: #0875c1;
    color: #fff;
}

.im-request-filters {
    padding: 16px;
    border: 1px solid #d5e0e8;
    border-radius: 8px;
    background: #fff;
}

.im-filter-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.im-filter-search {
    flex: 1 1 260px;
}

.im-filter-field .form-control,
.im-filter-field .custom-select {
    min-width: 190px;
}

.im-filter-actions,
.im-row-actions {
    display: flex;
    gap: 6px;
}

.im-results-summary {
    margin: 12px 0;
    color: #526174;
    font-weight: 700;
}

.im-bulk-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
    border: 1px solid #bfd3e0;
    border-radius: 8px;
    background: #eaf4f9;
}

.im-requests-table {
    border: 1px solid #d6e0e7;
    background: #fff;
}

.im-requests-table thead th {
    border-bottom: 2px solid #a8c6d7;
    background: #edf5f2;
    color: #203342;
    font-size: .82rem;
}

.im-requests-table tbody tr:hover {
    background: #f6fafc;
}

.im-row-actions .btn {
    min-height: 30px;
    padding: 4px 9px;
    border-radius: 5px;
    box-shadow: none;
    font-size: .82rem;
    white-space: nowrap;
}

.im-row-actions .btn-light {
    border: 1px solid #c8d6df;
    background: #fff;
    color: #075f9b;
}

.im-selected-count,
.im-participant-name {
    font-weight: 800;
}

.im-participant-detail {
    color: #526174;
    font-size: .86rem;
}

.im-transfer-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 28px;
}

.im-info-panel {
    padding: 16px;
    border: 1px solid #bcd8e8;
    border-radius: 8px;
    background: #f2f8fc;
}

.im-info-warning {
    border-color: #e7d59a;
    background: #fff9e8;
}

.im-info-panel h3,
.im-info-panel p {
    margin: 0 0 6px;
}

.im-template-help {
    max-width: 850px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .im-hub-header {
        flex-direction: column;
    }

    .im-manage-filters .form-control,
    .im-manage-filters .custom-select,
    .im-bulk-toolbar .custom-select {
        width: 100%;
    }

    .im-my-layout {
        grid-template-columns: 1fr;
    }

    .im-my-sidebar {
        border-right: 0;
        border-bottom: 1px solid #d7e2dc;
        padding: 0 0 16px;
    }

    .im-filterbar {
        grid-template-columns: 1fr;
    }

    .im-tabs {
        grid-template-columns: 1fr 1fr;
    }

    .im-training-card,
    .im-my-header {
        align-items: stretch;
        flex-direction: column;
    }

    .im-card-actions {
        min-width: 0;
        width: 100%;
    }

    .im-editions-table td:last-child {
        min-width: 240px;
    }

    .im-section-heading,
    .im-edition-header {
        align-items: stretch;
        flex-direction: column;
    }

    .im-edition-search {
        width: 100%;
        grid-template-columns: 1fr auto;
    }

    .im-edition-action-groups {
        grid-template-columns: 1fr;
    }

    .im-action-group {
        border-right: 0;
        border-bottom: 1px solid #e0e7ec;
    }

    .im-action-group:last-child {
        border-bottom: 0;
    }

    .im-editions-grid,
    .im-transfer-summary {
        grid-template-columns: 1fr;
    }

    .im-edition-summary {
        padding-right: 0;
    }

    .im-edition-expand {
        position: static;
        display: block;
        padding: 0 16px 14px;
        transform: none;
    }

    .im-edition-status {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .im-comms-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .inscriptionmanager-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .im-courses-workspace,
    .im-requests-workspace {
        padding: 16px 0;
    }

    .im-requests-workspace {
        padding-right: 14px;
        padding-left: 14px;
    }
}

/* Final course workspace layout: compact headers and task-oriented tool rows. */
.im-courses-workspace .im-section-heading {
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8ed;
}

.im-courses-workspace .im-edition-search {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

.im-courses-workspace .im-edition-search .form-control {
    width: 320px;
    min-width: 220px;
}

.im-courses-workspace .im-edition-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "header header"
        ". expand";
    gap: 0 16px;
    padding: 0;
}

.im-courses-workspace .im-edition-header {
    grid-area: header;
    align-items: flex-start;
    padding: 14px 16px 8px;
}

.im-courses-workspace .im-edition-identity {
    max-width: 68%;
}

.im-courses-workspace .im-edition-status {
    max-width: 32%;
}

.im-courses-workspace .im-edition-expand {
    position: static;
    grid-area: expand;
    display: inline-flex;
    align-items: center;
    justify-self: end;
    padding: 0 16px 12px;
    transform: none;
    white-space: nowrap;
}

.im-courses-workspace .im-edition-action-groups {
    display: block;
    padding: 8px 16px 12px;
    background: #f8fafb;
}

.im-courses-workspace .im-action-group {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid #e2e8ed;
}

.im-courses-workspace .im-action-group:last-child {
    border-bottom: 0;
}

.im-courses-workspace .im-action-group-label {
    margin: 6px 0 0;
    color: #40586a;
}

.im-courses-workspace .im-tool-link {
    background: #fff;
}

.im-courses-workspace .im-tool-link.is-primary {
    background: #0875c1;
}

@media (max-width: 900px) {
    .im-courses-workspace .im-section-heading,
    .im-courses-workspace .im-edition-search {
        align-items: stretch;
        flex-direction: column;
    }

    .im-courses-workspace .im-edition-search .form-control,
    .im-courses-workspace .im-edition-search .btn {
        width: 100%;
    }

    .im-courses-workspace .im-edition-header {
        align-items: stretch;
    }

    .im-courses-workspace .im-edition-identity,
    .im-courses-workspace .im-edition-status {
        max-width: none;
    }

    .im-courses-workspace .im-action-group {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .im-courses-workspace .im-action-group-label {
        margin-top: 0;
    }
}
