@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --sjm-blue: #274c77;
    --sjm-blue-strong: #17365d;
    --sjm-dark: #0f172a;
    --sjm-muted: #5f6b7c;
    --sjm-bg: #e7edf5;
    --sjm-card: #f8fbff;
    --sjm-border: #c9d4e3;
    --sjm-green: #1f8f5f;
    --sjm-red: #c2410c;
    --sjm-amber: #b7791f;
    --sjm-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
}

.sjm360-admin * ,
.sjm360-engineer-app * {
    box-sizing: border-box;
}

.sjm360-admin h1,
.sjm360-admin h2,
.sjm360-admin h3,
.sjm360-engineer-app h1,
.sjm360-engineer-app h2,
.sjm360-engineer-app h3 {
    letter-spacing: -0.02em;
}

.sjm360-admin-grid {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sjm360-form-card,
.sjm360-calendar-card,
.sjm360-entry-list-card {
    min-width: 0;
}

.sjm360-card {
    background: var(--sjm-card);
    border: 1px solid var(--sjm-border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--sjm-shadow);
    margin-top: 18px;
    overflow: hidden;
}

.sjm360-form {
    display: grid;
    gap: 14px;
}

.sjm360-form label,
.sjm360-app-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
    color: var(--sjm-dark);
}

.sjm360-form input,
.sjm360-form select,
.sjm360-form textarea,
.sjm360-app-form input,
.sjm360-app-form select,
.sjm360-app-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--sjm-border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.sjm360-form small,
.sjm360-app-form small {
    color: var(--sjm-muted);
    font-weight: 400;
}

.sjm360-two-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.sjm360-two-cols > label {
    min-width: 0;
}

.sjm360-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sjm360-week-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.sjm360-week-head h2,
.sjm360-week-head p {
    margin: 0;
}

.sjm360-week-head p {
    color: var(--sjm-muted);
    margin-top: 4px;
}

.sjm360-week-board-wrap,
.sjm360-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.sjm360-week-board {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 920px;
}

.sjm360-week-board th,
.sjm360-week-board td {
    border: 1px solid var(--sjm-border);
    border-left: 0;
    border-top: 0;
    vertical-align: top;
    padding: 10px;
    background: #fff;
}

.sjm360-week-board thead th {
    background: #122b49;
    color: #fff;
    text-align: left;
    position: sticky;
    top: 32px;
    z-index: 2;
}

.sjm360-week-board thead th:first-child,
.sjm360-week-board tbody th {
    border-left: 1px solid var(--sjm-border);
}

.sjm360-week-board thead th span,
.sjm360-week-board thead th small,
.sjm360-person-cell small {
    display: block;
}

.sjm360-week-board thead th small {
    color: #cbd5e1;
    font-weight: 400;
    margin-top: 2px;
}


.sjm360-month-board-wrap {
    width: 100%;
    overflow-x: auto;
}

.sjm360-month-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    min-width: 1050px;
    border-top: 1px solid var(--sjm-border);
    border-left: 1px solid var(--sjm-border);
}

.sjm360-month-heading {
    background: #122b49;
    color: #fff;
    font-weight: 800;
    padding: 12px;
    border-right: 1px solid rgba(255,255,255,0.25);
}

.sjm360-month-day {
    min-height: 150px;
    padding: 10px;
    border-right: 1px solid var(--sjm-border);
    border-bottom: 1px solid var(--sjm-border);
    background: #fff;
}

.sjm360-month-day-muted {
    background: #f2f6fb;
}

.sjm360-month-day-muted .sjm360-month-date {
    color: #94a3b8;
}

.sjm360-month-date {
    font-weight: 900;
    color: var(--sjm-blue);
    margin-bottom: 8px;
}

.sjm360-person-cell {
    min-width: 155px;
    background: #f8fafc !important;
}

.sjm360-person-cell small {
    color: var(--sjm-muted);
    margin-top: 4px;
}

.sjm360-empty {
    display: none;
}

.sjm360-mini-event {
    display: grid;
    gap: 3px;
    padding: 9px;
    border-radius: 10px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--sjm-dark);
    background: #f1f6fc;
    border-left: 4px solid var(--sjm-blue);
}

.sjm360-mini-event strong {
    color: var(--sjm-dark);
    font-size: 12px;
    line-height: 1.25;
}

.sjm360-mini-event span,
.sjm360-mini-event em {
    color: var(--sjm-muted);
    font-size: 11px;
    font-style: normal;
}

.sjm360-mini-event-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.sjm360-update-badge,
.sjm360-update-table-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 7px;
    background: #f97316;
    color: #ffffff !important;
    border-radius: 999px;
    font-size: 10px !important;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sjm360-mini-badges {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.sjm360-multiday-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 7px;
    background: #1d4ed8;
    color: #ffffff !important;
    border-radius: 999px;
    font-size: 10px !important;
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sjm360-is-multiday {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.sjm360-multiday-continues {
    background: #f3f7fc;
}

.sjm360-multiday-ends {
    background: #edf8f0;
}

.sjm360-status-completed .sjm360-multiday-badge {
    background: #166534;
}

.sjm360-has-engineer-update {
    background: #fff7ed;
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.22);
}

.sjm360-list-has-update td {
    background: #fff7ed !important;
}

.sjm360-update-table-badge {
    margin-bottom: 4px;
}

.sjm360-type-annual_leave {
    background: #ecfdf3 !important;
    border-left-color: var(--sjm-green) !important;
}

.sjm360-type-sick_leave {
    background: #fff1f2 !important;
    border-left-color: var(--sjm-red) !important;
}

.sjm360-type-office {
    background: #f1f5f9 !important;
    border-left-color: #64748b !important;
}

.sjm360-type-unallocated {
    background: #fff7ed !important;
    border-left-color: var(--sjm-amber) !important;
}

.sjm360-status-requested {
    outline: none;
}

.sjm360-row-actions {
    min-width: 150px;
    white-space: nowrap;
}

.sjm360-inline-form {
    display: inline-block;
    margin: 0 4px 4px 0;
}

.sjm360-danger {
    color: #b91c1c !important;
    border-color: #fecaca !important;
    background: #fff5f5 !important;
}

.sjm360-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    background: #e5e7eb;
    color: #374151;
    font-weight: 700;
    font-size: 12px;
}

.sjm360-pill-green {
    background: #dcfce7;
    color: #166534;
}

.sjm360-link-copy {
    width: 100%;
    min-width: 340px;
    border-radius: 8px;
    border: 1px solid var(--sjm-border);
    padding: 8px 10px;
}

body.sjm360-standalone-page {
    margin: 0;
    background: var(--sjm-bg);
}

.sjm360-engineer-app {
    max-width: 940px;
    margin: 0 auto;
    padding: 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--sjm-dark);
}

.sjm360-app-header {
    background: linear-gradient(135deg, #0f172a, var(--sjm-blue-strong) 48%, var(--sjm-blue));
    color: #fff;
    border-radius: 24px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--sjm-shadow);
}

.sjm360-app-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.sjm360-app-header span {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    color: #bfdbfe;
    margin-bottom: 8px;
}

.sjm360-app-header h1 {
    margin: 0;
    font-size: clamp(28px, 6vw, 44px);
    color: #fff;
}

.sjm360-app-header p {
    margin: 8px 0 0;
    color: #dbeafe;
}

.sjm360-install-help-button,
.sjm360-app-primary {
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    background: #fff;
    color: var(--sjm-blue);
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.sjm360-install-help {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    padding: 16px;
    margin: 16px 0;
}

.sjm360-app-notice {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-weight: 700;
}

.sjm360-app-error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.sjm360-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.sjm360-summary-grid div {
    background: #fff;
    border: 1px solid var(--sjm-border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--sjm-shadow);
}

.sjm360-summary-grid strong,
.sjm360-summary-grid span {
    display: block;
}

.sjm360-summary-grid strong {
    font-size: 30px;
    color: var(--sjm-blue);
}

.sjm360-summary-grid span {
    color: var(--sjm-muted);
    margin-top: 4px;
    font-weight: 700;
}

.sjm360-app-card,
.sjm360-login-card {
    background: #fff;
    border: 1px solid var(--sjm-border);
    border-radius: 22px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: var(--sjm-shadow);
}

.sjm360-app-card h2,
.sjm360-login-card h1 {
    margin-top: 0;
}

.sjm360-day-heading {
    margin: 22px 0 10px;
    color: var(--sjm-blue);
    font-size: 16px;
}

.sjm360-app-event {
    border-left: 6px solid var(--sjm-blue);
    background: #f3f7fc;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.sjm360-app-event-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.sjm360-app-event-top strong {
    font-size: 18px;
}

.sjm360-app-event-top span {
    background: rgba(31, 77, 143, 0.1);
    color: var(--sjm-blue);
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
}

.sjm360-app-event p {
    margin: 8px 0 0;
    color: #374151;
}

.sjm360-app-time {
    color: var(--sjm-muted) !important;
    font-weight: 700;
}

.sjm360-app-form {
    display: grid;
    gap: 14px;
}

.sjm360-app-primary {
    background: var(--sjm-blue);
    color: #fff;
    width: fit-content;
}

.sjm360-readonly-note p {
    margin: 0;
    color: var(--sjm-muted);
    font-weight: 700;
}

@media (max-width: 960px) {
    .sjm360-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .sjm360-engineer-app {
        padding: 12px;
    }

    .sjm360-app-header,
    .sjm360-app-event-top {
        flex-direction: column;
    }

    .sjm360-summary-grid,
    .sjm360-two-cols {
        grid-template-columns: 1fr;
    }

    .sjm360-app-header {
        border-radius: 18px;
    }

    .sjm360-install-help-button,
    .sjm360-app-primary {
        width: 100%;
    }
}

.sjm360-colour-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sjm360-colour-row input[type="color"] {
    width: 54px;
    height: 42px;
    padding: 4px;
    cursor: pointer;
}

.sjm360-engineer-update-box,
.sjm360-existing-update {
    background: #f2f6fb;
    border: 1px solid var(--sjm-border);
    border-radius: 12px;
    padding: 12px;
}

.sjm360-engineer-update-box p,
.sjm360-existing-update p {
    margin: 6px 0 0;
}

.sjm360-engineer-update-box small {
    display: block;
    margin-top: 6px;
    color: var(--sjm-muted);
}

.sjm360-engineer-update-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--sjm-border);
    display: grid;
    gap: 10px;
}

.sjm360-engineer-update-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.sjm360-engineer-update-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--sjm-border);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

.sjm360-engineer-update-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.sjm360-app-secondary {
    border: 1px solid var(--sjm-border);
    border-radius: 999px;
    padding: 12px 16px;
    background: #fff;
    color: var(--sjm-blue);
    font-weight: 800;
    cursor: pointer;
}

.sjm360-complete-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 10px 14px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
}

.sjm360-status-completed {
    background: #f0fdf4 !important;
}

@media (max-width: 680px) {
    .sjm360-engineer-update-actions,
    .sjm360-app-secondary {
        width: 100%;
    }
}

/* Frontend staff portal */
.sjm360-admin-portal,
.sjm360-admin-portal * {
    box-sizing: border-box;
}

.sjm360-admin-portal {
    max-width: 1480px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--sjm-dark);
}

/* Full-width frontend staff portal. This breaks the calendar out of narrow theme content wrappers
   so the office calendar has proper working room on desktop screens. */
.sjm360-admin-portal-full {
    width: calc(100vw - 32px);
    max-width: none;
    margin-left: calc(50% - 50vw + 16px);
    margin-right: calc(50% - 50vw + 16px);
    padding: 20px clamp(16px, 2vw, 38px);
}

body.sjm360-admin-portal-page .sjm360-admin-portal-full {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.sjm360-admin-portal-full .sjm360-admin-grid {
    grid-template-columns: minmax(290px, 380px) minmax(0, 1fr);
}

.sjm360-admin-portal-full .sjm360-calendar-card,
.sjm360-admin-portal-full .sjm360-entry-list-card {
    min-width: 0;
}

.sjm360-admin-portal-page {
    background: var(--sjm-bg);
}

.sjm360-admin-portal .wrap {
    margin: 0;
}

.sjm360-admin-portal .wrap > h1 {
    margin: 22px 0 0;
    color: var(--sjm-dark);
}

.sjm360-portal-header {
    background: linear-gradient(135deg, #0f172a, var(--sjm-blue-strong) 48%, var(--sjm-blue));
    color: #fff;
    border-radius: 24px;
    padding: 26px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    box-shadow: var(--sjm-shadow);
}

.sjm360-portal-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.sjm360-portal-logo {
    width: 220px;
    max-width: 34vw;
    height: auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    flex: 0 0 auto;
}

.sjm360-portal-logo-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
}

.sjm360-portal-copy {
    min-width: 0;
}

.sjm360-portal-header span {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    color: #bfdbfe;
    margin-bottom: 8px;
    font-weight: 800;
}

.sjm360-portal-header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.05;
}

.sjm360-portal-header p {
    margin: 10px 0 0;
    color: #dbeafe;
    font-size: 18px;
}

.sjm360-portal-logout,
.sjm360-admin-portal .button,
.sjm360-admin-portal input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid var(--sjm-border);
    border-radius: 999px;
    padding: 8px 14px;
    background: #fff;
    color: var(--sjm-blue);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    line-height: 1.2;
}

.sjm360-admin-portal .button-primary,
.sjm360-admin-portal input[type="submit"] {
    background: var(--sjm-blue);
    border-color: var(--sjm-blue);
    color: #fff;
}

.sjm360-admin-portal .notice {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #86efac;
    background: #dcfce7;
    color: #166534;
    font-weight: 800;
}

.sjm360-admin-portal .notice p {
    margin: 0;
}

.sjm360-admin-portal .widefat {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.sjm360-admin-portal .widefat th,
.sjm360-admin-portal .widefat td {
    border-bottom: 1px solid var(--sjm-border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.sjm360-admin-portal .widefat thead th {
    background: #f2f6fb;
    color: var(--sjm-dark);
    font-weight: 900;
}

.sjm360-login-wrap {
    max-width: 560px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sjm360-login-card form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.sjm360-login-card label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.sjm360-login-card input[type="text"],
.sjm360-login-card input[type="password"] {
    width: 100%;
    border: 1px solid var(--sjm-border);
    border-radius: 12px;
    padding: 12px;
    font: inherit;
}

.sjm360-login-card .login-remember label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}



body.sjm360-standalone-page,
.sjm360-admin-portal-page {
    background:
        radial-gradient(circle at top left, rgba(39, 76, 119, 0.12), transparent 28%),
        linear-gradient(180deg, #dfe7f1 0%, #e9eff6 55%, #edf2f7 100%);
}

.sjm360-admin-portal-full .sjm360-form-card,
.sjm360-admin-portal-full .sjm360-calendar-card,
.sjm360-admin-portal-full .sjm360-entry-list-card,
.sjm360-engineer-app .sjm360-summary-grid div,
.sjm360-engineer-app .sjm360-app-card,
.sjm360-engineer-app .sjm360-login-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,251,255,0.98) 100%);
    border-color: #c8d4e3;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.sjm360-admin-portal .widefat thead th {
    background: #eef3f9;
}

.sjm360-week-board th,
.sjm360-month-heading {
    background: #112742;
}

.sjm360-portal-header,
.sjm360-app-header {
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
}

.sjm360-portal-header p,
.sjm360-app-header p {
    color: #d6e1f1;
}

.sjm360-portal-header span,
.sjm360-app-header span {
    color: #a9bfdc;
}

.sjm360-portal-logout,
.sjm360-install-help-button,
.sjm360-admin-portal .button,
.sjm360-admin-portal input[type="submit"] {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.sjm360-mini-event {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.sjm360-app-event {
    background: #f3f7fc;
}

@media (max-width: 780px) {
    .sjm360-admin-portal {
        padding: 12px;
    }

    .sjm360-admin-portal-full {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 12px;
    }

    .sjm360-portal-header {
        flex-direction: column;
        border-radius: 18px;
    }

    .sjm360-portal-brand {
        align-items: flex-start;
    }

    .sjm360-portal-logo {
        width: 170px;
        max-width: 62vw;
        min-height: 48px;
    }

    .sjm360-app-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .sjm360-portal-logout,
    .sjm360-admin-portal .button,
    .sjm360-admin-portal input[type="submit"] {
        width: 100%;
    }
}


/* Light / dark mode toggle */
.sjm360-theme-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sjm360-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.sjm360-theme-toggle-track {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255,255,255,0.28);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.sjm360-theme-toggle-knob {
    position: absolute;
    width: 18px;
    height: 18px;
    top: 2px;
    left: 2px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.22);
    transition: transform 0.2s ease;
}

.sjm360-theme-toggle-text {
    font-size: 12px;
    white-space: nowrap;
}

.sjm360-theme-dark .sjm360-theme-toggle-track {
    background: #38bdf8;
}

.sjm360-theme-dark .sjm360-theme-toggle-knob {
    transform: translateX(20px);
}

.sjm360-theme-dark .sjm360-theme-toggle-text {
    color: #e0f2fe;
}

/* Dark mode theme */
body.sjm360-theme-dark,
body.sjm360-theme-dark.sjm360-standalone-page,
body.sjm360-theme-dark.sjm360-admin-portal-page {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 30%),
        linear-gradient(180deg, #08111f 0%, #0f172a 55%, #111827 100%);
    color: #e5eef9;
}

body.sjm360-theme-dark .sjm360-admin-portal,
body.sjm360-theme-dark .sjm360-engineer-app {
    color: #e5eef9;
}

body.sjm360-theme-dark .sjm360-card,
body.sjm360-theme-dark .sjm360-form-card,
body.sjm360-theme-dark .sjm360-calendar-card,
body.sjm360-theme-dark .sjm360-entry-list-card,
body.sjm360-theme-dark .sjm360-summary-grid div,
body.sjm360-theme-dark .sjm360-app-card,
body.sjm360-theme-dark .sjm360-login-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.98) 100%);
    border-color: rgba(148, 163, 184, 0.26);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.26);
}

body.sjm360-theme-dark .sjm360-form label,
body.sjm360-theme-dark .sjm360-app-form label,
body.sjm360-theme-dark .sjm360-admin-portal .wrap > h1,
body.sjm360-theme-dark .sjm360-mini-event strong,
body.sjm360-theme-dark .sjm360-app-event-top strong,
body.sjm360-theme-dark .sjm360-app-card h2,
body.sjm360-theme-dark .sjm360-login-card h1,
body.sjm360-theme-dark .sjm360-day-heading {
    color: #f8fafc;
}

body.sjm360-theme-dark .sjm360-form input,
body.sjm360-theme-dark .sjm360-form select,
body.sjm360-theme-dark .sjm360-form textarea,
body.sjm360-theme-dark .sjm360-app-form input,
body.sjm360-theme-dark .sjm360-app-form select,
body.sjm360-theme-dark .sjm360-app-form textarea,
body.sjm360-theme-dark .sjm360-engineer-update-form textarea,
body.sjm360-theme-dark .sjm360-login-card input[type="text"],
body.sjm360-theme-dark .sjm360-login-card input[type="password"] {
    background: #0b1220;
    border-color: rgba(148, 163, 184, 0.28);
    color: #e5eef9;
}

body.sjm360-theme-dark .sjm360-form input::placeholder,
body.sjm360-theme-dark .sjm360-form textarea::placeholder {
    color: #94a3b8;
}

body.sjm360-theme-dark .sjm360-form small,
body.sjm360-theme-dark .sjm360-app-form small,
body.sjm360-theme-dark .sjm360-week-head p,
body.sjm360-theme-dark .sjm360-person-cell small,
body.sjm360-theme-dark .sjm360-mini-event span,
body.sjm360-theme-dark .sjm360-mini-event em,
body.sjm360-theme-dark .sjm360-summary-grid span,
body.sjm360-theme-dark .sjm360-app-time,
body.sjm360-theme-dark .sjm360-readonly-note p {
    color: #a8b5c7 !important;
}

body.sjm360-theme-dark .sjm360-week-board th,
body.sjm360-theme-dark .sjm360-week-board td,
body.sjm360-theme-dark .sjm360-month-day,
body.sjm360-theme-dark .sjm360-admin-portal .widefat {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.22);
    color: #e5eef9;
}

body.sjm360-theme-dark .sjm360-week-board thead th,
body.sjm360-theme-dark .sjm360-month-heading,
body.sjm360-theme-dark .sjm360-week-board th {
    background: #08111f;
    color: #f8fafc;
}

body.sjm360-theme-dark .sjm360-person-cell,
body.sjm360-theme-dark .sjm360-month-day-muted,
body.sjm360-theme-dark .sjm360-admin-portal .widefat thead th {
    background: #111c2f !important;
    color: #e5eef9;
}

body.sjm360-theme-dark .sjm360-mini-event,
body.sjm360-theme-dark .sjm360-app-event,
body.sjm360-theme-dark .sjm360-engineer-update-box,
body.sjm360-theme-dark .sjm360-existing-update {
    background: #111c2f;
    color: #e5eef9;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}

body.sjm360-theme-dark .sjm360-type-annual_leave {
    background: rgba(22, 101, 52, 0.22) !important;
}

body.sjm360-theme-dark .sjm360-type-sick_leave {
    background: rgba(153, 27, 27, 0.22) !important;
}

body.sjm360-theme-dark .sjm360-type-office {
    background: rgba(100, 116, 139, 0.18) !important;
}

body.sjm360-theme-dark .sjm360-type-unallocated {
    background: rgba(180, 83, 9, 0.20) !important;
}

body.sjm360-theme-dark .sjm360-has-engineer-update,
body.sjm360-theme-dark .sjm360-list-has-update td {
    background: rgba(154, 52, 18, 0.22) !important;
}

body.sjm360-theme-dark .sjm360-status-completed {
    background: rgba(22, 101, 52, 0.22) !important;
}

body.sjm360-theme-dark .sjm360-admin-portal .widefat th,
body.sjm360-theme-dark .sjm360-admin-portal .widefat td {
    border-color: rgba(148, 163, 184, 0.18);
}

body.sjm360-theme-dark .sjm360-portal-logout,
body.sjm360-theme-dark .sjm360-install-help-button,
body.sjm360-theme-dark .sjm360-admin-portal .button,
body.sjm360-theme-dark .sjm360-admin-portal input[type="submit"],
body.sjm360-theme-dark .sjm360-app-secondary {
    background: #e5eef9;
    color: #102a4c;
    border-color: rgba(255,255,255,0.2);
}

body.sjm360-theme-dark .sjm360-admin-portal .button-primary,
body.sjm360-theme-dark .sjm360-admin-portal input[type="submit"],
body.sjm360-theme-dark .sjm360-app-primary {
    background: #38bdf8;
    border-color: #38bdf8;
    color: #08111f;
}

@media (max-width: 780px) {
    .sjm360-theme-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .sjm360-theme-toggle {
        width: auto;
    }
}


/* Engineer week/upcoming view tabs */
.sjm360-engineer-view-card {
    padding: 16px 18px;
}

.sjm360-engineer-view-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sjm360-engineer-view-head span {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 11px;
    font-weight: 900;
    color: var(--sjm-muted);
    margin-bottom: 3px;
}

.sjm360-engineer-view-head strong {
    display: block;
    font-size: 20px;
    color: var(--sjm-dark);
}

.sjm360-engineer-view-head p {
    margin: 3px 0 0;
    color: var(--sjm-muted);
    font-weight: 700;
}

.sjm360-engineer-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.sjm360-engineer-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid var(--sjm-border);
    background: #ffffff;
    color: var(--sjm-blue);
    text-decoration: none;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
}

.sjm360-engineer-tab:hover,
.sjm360-engineer-tab:focus,
.sjm360-engineer-tab-active {
    background: var(--sjm-blue);
    border-color: var(--sjm-blue);
    color: #ffffff;
    text-decoration: none;
}

body.sjm360-theme-dark .sjm360-engineer-view-head span,
body.sjm360-theme-dark .sjm360-engineer-view-head p {
    color: #a8b5c7;
}

body.sjm360-theme-dark .sjm360-engineer-view-head strong {
    color: #f8fafc;
}

body.sjm360-theme-dark .sjm360-engineer-tab {
    background: #0b1220;
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.28);
}

body.sjm360-theme-dark .sjm360-engineer-tab:hover,
body.sjm360-theme-dark .sjm360-engineer-tab:focus,
body.sjm360-theme-dark .sjm360-engineer-tab-active {
    background: #38bdf8;
    border-color: #38bdf8;
    color: #08111f;
}

@media (max-width: 680px) {
    .sjm360-engineer-view-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .sjm360-engineer-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .sjm360-engineer-tab {
        width: 100%;
    }
}


/* v2.6 typography and header polish */
.sjm360-admin,
.sjm360-admin-portal,
.sjm360-engineer-app,
.sjm360-admin input,
.sjm360-admin select,
.sjm360-admin textarea,
.sjm360-admin button,
.sjm360-admin-portal input,
.sjm360-admin-portal select,
.sjm360-admin-portal textarea,
.sjm360-admin-portal button,
.sjm360-engineer-app input,
.sjm360-engineer-app select,
.sjm360-engineer-app textarea,
.sjm360-engineer-app button {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Reduce the heavy button weight so the dashboard feels more refined. */
.sjm360-portal-logout,
.sjm360-install-help-button,
.sjm360-app-primary,
.sjm360-app-secondary,
.sjm360-theme-toggle,
.sjm360-engineer-tab,
.sjm360-admin-portal .button,
.sjm360-admin-portal input[type="submit"],
.sjm360-admin .button,
.sjm360-admin input[type="submit"],
.sjm360-danger,
.sjm360-delete,
.sjm360-row-actions .button {
    font-weight: 600 !important;
}

/* Keep key labels readable without looking over-heavy. */
.sjm360-form label,
.sjm360-app-form label,
.sjm360-login-card label,
.sjm360-engineer-update-form label,
.sjm360-week-board thead th,
.sjm360-month-heading,
.sjm360-admin-portal .widefat thead th {
    font-weight: 700;
}

/* Centre the dark/light switch contents properly. */
.sjm360-theme-toggle {
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 34px;
    padding: 6px 11px;
}

.sjm360-theme-toggle-track,
.sjm360-theme-toggle-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sjm360-theme-toggle-track {
    flex: 0 0 auto;
}

/* Add a subtle divider between the logo and portal title. */
.sjm360-portal-logo {
    position: relative;
    padding-right: 22px;
    margin-right: 4px;
}

.sjm360-portal-logo::after {
    content: "";
    position: absolute;
    right: 0;
    top: 10%;
    width: 1px;
    height: 80%;
    background: rgba(255, 255, 255, 0.28);
}

/* Apply the same divider treatment in the engineer app header. */
.sjm360-app-brand .sjm360-portal-logo::after {
    background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 780px) {
    .sjm360-portal-logo {
        padding-right: 0;
        margin-right: 0;
    }

    .sjm360-portal-logo::after {
        display: none;
    }
}


/* v2.7 engineer header name spacing */
.sjm360-app-header .sjm360-app-brand {
    flex: 1 1 auto;
    min-width: 0;
}

.sjm360-app-header .sjm360-theme-actions-engineer {
    flex: 0 0 auto;
}

.sjm360-app-header h1 {
    font-size: clamp(24px, 4.2vw, 36px);
    line-height: 1.08;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Give the engineer title a little more room than the staff portal header. */
.sjm360-app-header .sjm360-portal-logo {
    width: 180px;
    max-width: 26vw;
}

@media (max-width: 680px) {
    .sjm360-app-header h1 {
        font-size: clamp(24px, 8vw, 34px);
        white-space: nowrap;
    }

    .sjm360-app-header .sjm360-portal-logo {
        width: 160px;
        max-width: 58vw;
    }
}


/* v2.8 frontend team manager */
.sjm360-frontend-team-manager {
    margin-top: 20px;
}

.sjm360-frontend-team-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.sjm360-frontend-team-head span {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 11px;
    font-weight: 800;
    color: var(--sjm-blue);
    margin-bottom: 6px;
}

.sjm360-frontend-team-head h2 {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.15;
}

.sjm360-frontend-team-head p {
    margin: 0;
    color: var(--sjm-muted);
    font-weight: 500;
}

.sjm360-frontend-team-grid {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.sjm360-frontend-team-form,
.sjm360-frontend-team-table {
    min-width: 0;
    background: rgba(255,255,255,0.58);
    border: 1px solid var(--sjm-border);
    border-radius: 16px;
    padding: 16px;
}

.sjm360-frontend-team-form h3,
.sjm360-frontend-team-table h3 {
    margin-top: 0;
}

.sjm360-frontend-team-manager .sjm360-link-copy {
    min-width: 260px;
    font-size: 12px;
}

body.sjm360-theme-dark .sjm360-frontend-team-head span {
    color: #7dd3fc;
}

body.sjm360-theme-dark .sjm360-frontend-team-form,
body.sjm360-theme-dark .sjm360-frontend-team-table {
    background: rgba(15, 23, 42, 0.62);
    border-color: rgba(148, 163, 184, 0.26);
}

@media (max-width: 960px) {
    .sjm360-frontend-team-grid {
        grid-template-columns: 1fr;
    }
}


/* v2.9 team edit controls */
.sjm360-editing-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eaf2ff;
    border: 1px solid var(--sjm-border);
    color: var(--sjm-dark);
    font-weight: 500;
}

.sjm360-editing-note a {
    color: var(--sjm-blue);
    font-weight: 700;
}

.sjm360-edit-person-button {
    margin: 0 4px 4px 0;
}

body.sjm360-theme-dark .sjm360-editing-note {
    background: #111c2f;
    color: #e5eef9;
    border-color: rgba(148, 163, 184, 0.26);
}

body.sjm360-theme-dark .sjm360-editing-note a {
    color: #7dd3fc;
}


/* v3.0 branded frontend login */
.sjm360-branded-login-card {
    width: min(520px, calc(100vw - 28px));
    text-align: left;
}

.sjm360-branded-login-card .sjm360-portal-logo {
    width: 230px;
    max-width: 72%;
    min-height: 0;
    margin: 0 0 22px;
    padding: 0;
}

.sjm360-branded-login-card .sjm360-portal-logo::after {
    display: none;
}

.sjm360-login-kicker {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--sjm-blue);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 8px;
}

.sjm360-portal-login-form {
    margin-top: 20px;
}

.sjm360-remember-row {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    gap: 10px !important;
    font-weight: 600 !important;
}

.sjm360-remember-row input {
    width: auto !important;
}

.sjm360-login-submit {
    width: 100%;
}

.sjm360-login-error,
.sjm360-login-success {
    border-radius: 14px;
    padding: 12px 14px;
    margin-top: 16px;
    font-weight: 700;
}

.sjm360-login-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.sjm360-login-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

body.sjm360-theme-dark .sjm360-login-kicker {
    color: #7dd3fc;
}

body.sjm360-theme-dark .sjm360-login-error {
    background: rgba(153, 27, 27, 0.22);
    color: #fecaca;
    border-color: rgba(252, 165, 165, 0.28);
}

body.sjm360-theme-dark .sjm360-login-success {
    background: rgba(22, 101, 52, 0.22);
    color: #bbf7d0;
    border-color: rgba(134, 239, 172, 0.28);
}


/* v3.1 sticky calendar/form and edit delete */
.sjm360-admin-grid {
    align-items: start;
}

/* Keeps the Add/Edit Entry panel visible while scrolling through the engineer rows. */
.sjm360-form-card {
    position: sticky;
    top: 16px;
    z-index: 20;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

/* Allow sticky day/date headings to work inside the calendar card. */
.sjm360-calendar-card {
    overflow: visible;
}

.sjm360-week-board-wrap,
.sjm360-month-board-wrap {
    overflow-x: auto;
    overflow-y: visible;
}

/* Keeps the day/date header row visible while scrolling down the weekly engineer board. */
.sjm360-week-board thead th {
    position: sticky;
    top: 0;
    z-index: 30;
}

/* Keeps month day headings visible during long month scrolling too. */
.sjm360-month-heading {
    position: sticky;
    top: 0;
    z-index: 30;
}

.sjm360-hidden-delete-form {
    display: none;
}

.sjm360-form-card .sjm360-danger {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

body.sjm360-theme-dark .sjm360-form-card .sjm360-danger {
    background: rgba(153, 27, 27, 0.30) !important;
    border-color: rgba(252, 165, 165, 0.28) !important;
    color: #fecaca !important;
}

@media (max-width: 960px) {
    .sjm360-form-card {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}


/* v3.2 stronger sticky date strip */
.sjm360-week-board-wrap {
    position: relative;
}

/* This separate date strip is more reliable than relying on sticky table headers across browsers/themes. */
.sjm360-sticky-date-strip {
    position: sticky;
    top: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: 155px repeat(7, minmax(100px, 1fr));
    min-width: 920px;
    background: #112742;
    color: #ffffff;
    border: 1px solid var(--sjm-border);
    border-bottom: 0;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.sjm360-sticky-date-cell {
    min-height: 52px;
    padding: 10px;
    border-right: 1px solid rgba(255,255,255,0.18);
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-weight: 700;
}

.sjm360-sticky-date-cell span,
.sjm360-sticky-date-cell small {
    display: block;
}

.sjm360-sticky-date-cell small {
    color: #cbd5e1;
    font-weight: 500;
    margin-top: 2px;
}

.sjm360-sticky-date-team {
    color: #e5eef9;
}

/* Keep the original table header available for screen readers but remove the duplicate visual row. */
.sjm360-week-board thead {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sjm360-week-board {
    table-layout: fixed;
}

.sjm360-week-board tbody th.sjm360-person-cell {
    width: 155px;
}

body.sjm360-theme-dark .sjm360-sticky-date-strip {
    background: #08111f;
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
}

body.sjm360-theme-dark .sjm360-sticky-date-cell {
    border-right-color: rgba(255,255,255,0.12);
}

@media (max-width: 960px) {
    .sjm360-sticky-date-strip {
        top: 0;
    }
}


/* v3.3 fixed floating date bar */
.sjm360-floating-date-strip {
    position: fixed !important;
    top: 0;
    left: 0;
    z-index: 99999;
    overflow: hidden;
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.sjm360-floating-date-strip-inner {
    display: grid;
    grid-template-columns: 155px repeat(7, minmax(100px, 1fr));
    min-width: 920px;
    background: #112742;
    color: #ffffff;
    border: 1px solid var(--sjm-border);
    border-top: 0;
}

.sjm360-floating-date-strip .sjm360-sticky-date-cell {
    background: transparent;
}

body.sjm360-theme-dark .sjm360-floating-date-strip-inner {
    background: #08111f;
    border-color: rgba(148, 163, 184, 0.22);
}

@media (max-width: 960px) {
    .sjm360-floating-date-strip {
        display: none !important;
    }
}


/* v3.4 floating date bar font fix */
.sjm360-floating-date-strip,
.sjm360-floating-date-strip * {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    box-sizing: border-box;
}

.sjm360-floating-date-strip .sjm360-sticky-date-cell {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sjm360-floating-date-strip .sjm360-sticky-date-cell span {
    font-size: 14px;
    line-height: 1.2;
}

.sjm360-floating-date-strip .sjm360-sticky-date-cell small {
    font-size: 11px;
    line-height: 1.2;
}


/* v3.5 confirmed job colours */
.sjm360-confirmed-toggle {
    padding: 12px;
    border: 1px solid var(--sjm-border);
    border-radius: 12px;
    background: #f8fbff;
}

.sjm360-confirmed-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.sjm360-confirmed-toggle-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
}

.sjm360-confirmed-toggle small {
    display: block;
    margin-top: 6px;
}

/* Calendar card colour states:
   requested/unconfirmed = yellow, confirmed = blue, completed = green. */
.sjm360-mini-event.sjm360-type-job.sjm360-status-confirmed {
    background: #eaf2ff !important;
}

.sjm360-mini-event.sjm360-type-job.sjm360-status-requested {
    background: #fff7cc !important;
}

.sjm360-mini-event.sjm360-type-job.sjm360-status-completed,
.sjm360-app-event.sjm360-type-job.sjm360-status-completed {
    background: #f0fdf4 !important;
}

.sjm360-app-event.sjm360-type-job.sjm360-status-confirmed {
    background: #f3f7fc !important;
}

.sjm360-app-event.sjm360-type-job.sjm360-status-requested {
    background: #fff9db !important;
}

/* Keep message state visible without overriding confirmed/completed too harshly. */
.sjm360-mini-event.sjm360-has-engineer-update.sjm360-status-confirmed {
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.24), 0 4px 10px rgba(15, 23, 42, 0.04);
}

body.sjm360-theme-dark .sjm360-confirmed-toggle {
    background: #111c2f;
    border-color: rgba(148, 163, 184, 0.26);
}

body.sjm360-theme-dark .sjm360-mini-event.sjm360-type-job.sjm360-status-confirmed {
    background: rgba(37, 99, 235, 0.22) !important;
}

body.sjm360-theme-dark .sjm360-mini-event.sjm360-type-job.sjm360-status-requested {
    background: rgba(202, 138, 4, 0.26) !important;
}

body.sjm360-theme-dark .sjm360-mini-event.sjm360-type-job.sjm360-status-completed,
body.sjm360-theme-dark .sjm360-app-event.sjm360-type-job.sjm360-status-completed {
    background: rgba(22, 101, 52, 0.28) !important;
}

body.sjm360-theme-dark .sjm360-app-event.sjm360-type-job.sjm360-status-confirmed {
    background: rgba(37, 99, 235, 0.18) !important;
}

body.sjm360-theme-dark .sjm360-app-event.sjm360-type-job.sjm360-status-requested {
    background: rgba(202, 138, 4, 0.22) !important;
}


/* v3.6 multi-engineer and project manager fields */
.sjm360-engineer-multi-select {
    min-height: 148px;
}

.sjm360-engineer-multi-select option {
    padding: 6px 8px;
}

body.sjm360-theme-dark .sjm360-engineer-multi-select option {
    background: #0b1220;
    color: #e5eef9;
}


/* v3.7 compact add/edit entry panel */
.sjm360-admin-portal-full .sjm360-form-card,
.sjm360-admin .sjm360-form-card {
    padding: 14px 15px;
}

.sjm360-form-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.15;
}

.sjm360-form-card .sjm360-form {
    gap: 8px;
}

.sjm360-form-card .sjm360-form label {
    gap: 3px;
    font-size: 12px;
    line-height: 1.22;
}

.sjm360-form-card .sjm360-form input,
.sjm360-form-card .sjm360-form select,
.sjm360-form-card .sjm360-form textarea {
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.25;
}

.sjm360-form-card .sjm360-form small {
    font-size: 10.5px;
    line-height: 1.25;
}

.sjm360-form-card .sjm360-two-cols {
    gap: 8px;
}

.sjm360-form-card textarea[name="notes"] {
    min-height: 58px;
    max-height: 90px;
    resize: vertical;
}

.sjm360-form-card .sjm360-engineer-multi-select {
    min-height: 104px;
}

.sjm360-form-card .sjm360-engineer-multi-select option {
    padding: 4px 7px;
}

.sjm360-form-card .sjm360-confirmed-toggle {
    padding: 8px 9px;
    border-radius: 10px;
}

.sjm360-form-card .sjm360-confirmed-toggle-row {
    gap: 8px;
}

.sjm360-form-card .sjm360-confirmed-toggle-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    min-width: 15px;
}

.sjm360-form-card .sjm360-confirmed-toggle small {
    margin-top: 3px;
}

.sjm360-form-card .sjm360-colour-row {
    gap: 8px;
}

.sjm360-form-card .sjm360-colour-row input[type="color"] {
    width: 42px;
    height: 32px;
    padding: 3px;
}

.sjm360-form-card .sjm360-engineer-update-box,
.sjm360-form-card .sjm360-existing-update {
    padding: 9px;
    border-radius: 10px;
    font-size: 12px;
}

.sjm360-form-card .sjm360-actions {
    gap: 6px;
    margin-top: 2px;
}

.sjm360-form-card .sjm360-actions .button,
.sjm360-form-card .sjm360-actions button {
    min-height: 31px;
    padding: 6px 10px;
    font-size: 12px;
}

.sjm360-form-card {
    scrollbar-width: thin;
}

/* Give the sticky form a little more usable height on normal desktop screens. */
@media (min-width: 961px) {
    .sjm360-form-card {
        top: 8px;
        max-height: calc(100vh - 16px);
    }
}


/* v3.8 rogue dropdown arrow fix */
.sjm360-form-card select.sjm360-engineer-multi-select,
.sjm360-admin-portal select.sjm360-engineer-multi-select,
.sjm360-admin select.sjm360-engineer-multi-select {
    appearance: listbox !important;
    -webkit-appearance: listbox !important;
    -moz-appearance: listbox !important;
    background-image: none !important;
    background-position: initial !important;
    background-repeat: initial !important;
    padding-right: 9px !important;
}

/* Some themes add custom select arrows using pseudo elements or wrapper backgrounds.
   This keeps the engineer multi-select behaving visually like a proper list box. */
.sjm360-form-card .sjm360-engineer-multi-select {
    cursor: default;
}


/* v4.1 clearance / escort notes */
.sjm360-clearance-note {
    display: block;
    margin: 5px auto 0;
    width: fit-content;
    max-width: 140px;
    padding: 3px 6px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.14);
    color: var(--sjm-blue);
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
}

body.sjm360-theme-dark .sjm360-clearance-note {
    background: rgba(56, 189, 248, 0.16);
    color: #bae6fd;
}


/* v4.3 staff grouping and conflict notices */
.sjm360-team-group-row th {
    position: relative;
    padding: 9px 12px !important;
    background: #e8eef7 !important;
    color: #17365d !important;
    font-size: 12px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    border-left: 1px solid var(--sjm-border) !important;
    border-right: 1px solid var(--sjm-border) !important;
}

body.sjm360-theme-dark .sjm360-team-group-row th {
    background: #111c2f !important;
    color: #bae6fd !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

.sjm360-admin-portal .notice-error {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

body.sjm360-theme-dark .sjm360-admin-portal .notice-error {
    background: rgba(153, 27, 27, 0.22);
    color: #fecaca;
    border-color: rgba(252, 165, 165, 0.28);
}


/* v4.4 Phase 1 staff profiles and documents */
.sjm360-portal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    margin: -10px 0 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.sjm360-portal-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #17365d;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.sjm360-portal-nav a:hover {
    background: #dbeafe;
    color: #0f2a44;
}

.sjm360-staff-profile-module {
    margin-top: 24px;
}

.sjm360-section-heading {
    margin-bottom: 18px;
}

.sjm360-section-heading > span {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sjm360-section-heading h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.sjm360-section-heading p {
    max-width: 880px;
    margin: 0;
    color: var(--sjm-muted);
}

.sjm360-profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 12px;
    margin: 18px 0 20px;
}

.sjm360-profile-stats > div {
    padding: 16px;
    border: 1px solid var(--sjm-border);
    border-radius: 16px;
    background: #f8fafc;
}

.sjm360-profile-stats strong {
    display: block;
    font-size: 28px;
    line-height: 1;
    color: #17365d;
}

.sjm360-profile-stats span {
    display: block;
    margin-top: 6px;
    color: var(--sjm-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sjm360-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 14px;
}

.sjm360-profile-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--sjm-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.sjm360-profile-card-top {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sjm360-profile-card h3 {
    margin: 0;
    font-size: 16px;
}

.sjm360-profile-card p {
    margin: 3px 0 0;
    color: var(--sjm-muted);
    font-size: 12px;
}

.sjm360-profile-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #17365d, #2563eb);
    color: #fff;
    font-weight: 900;
}

.sjm360-profile-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.sjm360-profile-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.sjm360-profile-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--sjm-muted);
    font-size: 12px;
    font-weight: 700;
}

.sjm360-profile-manager {
    min-height: 18px;
}

.sjm360-profile-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 10px 0 18px;
    padding: 14px;
    border: 1px solid var(--sjm-border);
    border-radius: 16px;
    background: #f8fafc;
}

.sjm360-profile-detail-header h3 {
    margin: 0 0 4px;
    font-size: 20px;
}

.sjm360-profile-detail-header p {
    margin: 0;
    color: var(--sjm-muted);
}

.sjm360-profile-section {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--sjm-border);
    border-radius: 18px;
    background: #ffffff;
}

.sjm360-profile-section h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #17365d;
}

.sjm360-profile-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(210px, 1fr));
    gap: 12px;
}

.sjm360-profile-form .button-primary {
    margin-top: 16px;
}

.sjm360-document-upload-form {
    margin-bottom: 18px;
}

.sjm360-document-table-wrap {
    margin-top: 16px;
}

.sjm360-doc-expiring {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 800;
}

.sjm360-doc-expired {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.sjm360-muted {
    color: var(--sjm-muted);
}

body.sjm360-theme-dark .sjm360-portal-nav,
body.sjm360-theme-dark .sjm360-profile-card,
body.sjm360-theme-dark .sjm360-profile-section,
body.sjm360-theme-dark .sjm360-profile-detail-header,
body.sjm360-theme-dark .sjm360-profile-stats > div {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.22);
}

body.sjm360-theme-dark .sjm360-portal-nav a {
    background: rgba(30, 41, 59, 0.88);
    color: #e0f2fe;
}

body.sjm360-theme-dark .sjm360-section-heading h2,
body.sjm360-theme-dark .sjm360-profile-section h4,
body.sjm360-theme-dark .sjm360-profile-stats strong {
    color: #e0f2fe;
}

body.sjm360-theme-dark .sjm360-profile-progress {
    background: rgba(148, 163, 184, 0.25);
}

@media (max-width: 900px) {
    .sjm360-profile-stats,
    .sjm360-profile-fields {
        grid-template-columns: 1fr;
    }

    .sjm360-profile-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v4.5 sticky week header column alignment */
:root {
    --sjm-team-column-width: 252px;
}

.sjm360-sticky-date-strip,
.sjm360-floating-date-strip-inner {
    grid-template-columns: var(--sjm-team-column-width) repeat(7, minmax(100px, 1fr)) !important;
}

.sjm360-week-board thead th:first-child,
.sjm360-week-board tbody th.sjm360-person-cell {
    width: var(--sjm-team-column-width);
    min-width: var(--sjm-team-column-width);
    max-width: var(--sjm-team-column-width);
    box-sizing: border-box;
}

.sjm360-sticky-date-team {
    width: var(--sjm-team-column-width);
    min-width: var(--sjm-team-column-width);
    max-width: var(--sjm-team-column-width);
    box-sizing: border-box;
}


/* v4.6 data export */
.sjm360-data-export-module {
    margin-top: 24px;
}

.sjm360-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.sjm360-export-card {
    border: 1px solid var(--sjm-border);
    border-radius: 16px;
    background: rgba(255,255,255,0.78);
    padding: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.sjm360-export-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--sjm-blue);
}

.sjm360-export-card p {
    margin: 0 0 14px;
    color: var(--sjm-muted);
    font-size: 13px;
    line-height: 1.45;
}

.sjm360-export-note {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
    font-size: 13px;
}

body.sjm360-theme-dark .sjm360-export-card {
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(148, 163, 184, 0.22);
}

body.sjm360-theme-dark .sjm360-export-card h3 {
    color: #bae6fd;
}

body.sjm360-theme-dark .sjm360-export-note {
    background: rgba(124, 45, 18, 0.28);
    border-color: rgba(251, 146, 60, 0.32);
    color: #fed7aa;
}
