.mhcc-wrap {
    --mhcc-bg: #d9e1e8;
    --mhcc-panel: #e8edf2;
    --mhcc-panel-2: #f5f7f9;
    --mhcc-line: #a8b0b7;
    --mhcc-head: #c7d0d8;
    --mhcc-text: #233142;
    --mhcc-muted: #667482;
    --mhcc-blue: #9fc9e9;
    --mhcc-orange: #ffc58d;
    --mhcc-violet: #dbc4ef;
    --mhcc-green: #bdf5c4;
    --mhcc-red: #ffd0d0;
    color: var(--mhcc-text);
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.25;
}

.mhcc-wrap * {
    box-sizing: border-box;
}

.mhcc-frontend {
    background: var(--mhcc-bg);
    border: 1px solid var(--mhcc-line);
    padding: 0;
    min-height: 70vh;
    overflow-x: hidden;
}

.mhcc-frontend-nav {
    display: flex;
    gap: 3px;
    padding: 7px 8px 0;
    background: #ccd6df;
    border-bottom: 1px solid #9ca9b4;
}

.mhcc-frontend-nav a {
    color: #183247;
    text-decoration: none;
    background: #e7edf3;
    border: 1px solid #a2aeb9;
    border-bottom: none;
    padding: 7px 13px;
    border-radius: 3px 3px 0 0;
}

.mhcc-frontend-nav a.active {
    background: #fff;
    font-weight: 700;
}

.mhcc-access-header,
.mhcc-header {
    display: grid;
    grid-template-columns: 170px 1fr 340px;
    align-items: start;
    gap: 18px;
    min-height: 110px;
    padding: 14px 18px 12px;
    background: var(--mhcc-bg);
    border-bottom: 1px solid #c4ccd3;
}

.mhcc-header {
    grid-template-columns: 140px 1fr;
}

.mhcc-access-title {
    text-align: center;
}

.mhcc-access-title h1,
.mhcc-header h1 {
    margin: 0;
    color: #64686d;
    font-family: "Calibri Light", Calibri, "Segoe UI", Arial, sans-serif;
    font-size: clamp(30px, 3vw, 48px);
    font-weight: 300;
    letter-spacing: 1px;
}

.mhcc-subtitle {
    margin: 6px 0 0;
    color: var(--mhcc-muted);
}

.mhcc-logo-circle {
    width: 86px;
    height: 86px;
    border: 3px solid #31586a;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #31586a;
    background: #eef5f8;
    font-weight: 800;
    box-shadow: inset 0 0 0 5px rgba(49,88,106,0.10);
}

.mhcc-logo-large {
    width: 112px;
    height: 112px;
    margin-left: 22px;
    font-size: 24px;
}

.mhcc-settings-box {
    justify-self: end;
    width: 320px;
    min-height: 72px;
    background: #d6dee6;
    border: 1px solid #8794a0;
    box-shadow: -2px 2px 0 rgba(0,0,0,0.12);
    padding: 8px 12px;
}

.mhcc-settings-box strong {
    display: block;
    margin-bottom: 10px;
}

.mhcc-settings-box div {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 10px;
    margin: 4px 0;
    align-items: center;
}

.mhcc-settings-box span {
    color: #66727e;
    text-align: right;
}

.mhcc-settings-box b,
.mhcc-initials-lock {
    display: inline-block;
    min-width: 58px;
    background: #fff;
    border: 1px solid #aab2ba;
    padding: 3px 6px;
    color: #1b2c3a;
    font-weight: 600;
}

.mhcc-access-toprow {
    display: grid;
    grid-template-columns: minmax(420px, 560px) 1fr;
    gap: 22px;
    padding: 10px 18px;
    background: var(--mhcc-bg);
}

.mhcc-kpi-box,
.mhcc-manned-box,
.mhcc-card {
    background: rgba(255,255,255,0.68);
    border: 1px solid var(--mhcc-line);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.13);
}

.mhcc-card {
    margin: 12px 18px;
    padding: 12px;
}

.mhcc-card h2,
.mhcc-manned-box h2 {
    margin: 0 0 10px;
    color: #4d5964;
    font-size: 17px;
    font-weight: 700;
}

.mhcc-manned-box,
.mhcc-kpi-box {
    padding: 10px;
}

.mhcc-grid {
    display: grid;
    gap: 14px;
    margin: 14px 0;
}

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

.mhcc-kpi-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px 4px;
    font-size: 14px;
}

.mhcc-kpi-table th,
.mhcc-kpi-table td {
    white-space: nowrap;
}

.mhcc-kpi-table th {
    text-align: center;
    color: #5d6670;
    font-size: clamp(11px, 0.72vw, 13px);
}

.mhcc-kpi-table td:first-child {
    text-align: right;
    color: #5d6670;
    font-weight: 700;
}

.mhcc-kpi-table strong {
    display: block;
    background: #fff;
    border: 1px solid #9fa8b1;
    min-width: 46px;
    padding: 3px 5px;
    text-align: right;
}

.mhcc-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mhcc-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    background: #edf3f7;
    border: 1px solid #a6b1ba;
    border-radius: 3px;
}

.mhcc-access-toolbar,
.mhcc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.mhcc-logbook-title {
    font-size: 18px;
    font-weight: 700;
    color: #4a5661;
}

.mhcc-wp-radio-form fieldset {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    min-width: 135px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #a9b0b8;
    background: #fff;
}

.mhcc-wp-radio-form label {
    display: block;
    white-space: nowrap;
}

.mhcc-filter-form,
.mhcc-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.mhcc-form label {
    display: block;
    font-weight: 600;
}

.mhcc-table-wrap {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #8c949d;
    background: #fff;
}

.mhcc-table,
.mhcc-table.widefat {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    font-size: clamp(11px, 0.72vw, 13px);
}

.mhcc-cro-logbook {
    min-width: 0;
}

.mhcc-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--mhcc-head);
    border: 1px solid #b6bec6;
    color: #263746;
    font-weight: 500;
    padding: 4px 6px;
    height: 24px;
    white-space: nowrap;
}

.mhcc-table td {
    border: 1px solid #e3e6e9;
    padding: 4px 6px;
    height: 30px;
    vertical-align: top;
    background: #fff;
    overflow-wrap: anywhere;
}

.mhcc-table tbody tr:nth-child(odd):not(.mhcc-new-entry-row) td {
    background: #f4f4f4;
}

.mhcc-table tbody tr:hover:not(.mhcc-new-entry-row) td {
    background: #d9ecfb;
}

.mhcc-table .mhcc-col-date {
    width: 112px;
}

.mhcc-table .mhcc-col-notes {
    width: 34%;
}

.mhcc-logbook-table th:nth-child(1) { width: 7%; }
.mhcc-logbook-table th:nth-child(2) { width: 9%; }
.mhcc-logbook-table th:nth-child(3) { width: 4%; }
.mhcc-logbook-table th:nth-child(4),
.mhcc-logbook-table th:nth-child(5) { width: 3.2%; }
.mhcc-logbook-table th:nth-child(6),
.mhcc-logbook-table th:nth-child(7) { width: 6.5%; }
.mhcc-logbook-table th:nth-child(8) { width: 4.8%; }
.mhcc-logbook-table th:nth-child(9) { width: 29%; }
.mhcc-logbook-table th:nth-child(10) { width: 7%; }
.mhcc-logbook-table th:nth-child(11) { width: 4.3%; }
.mhcc-logbook-table th:nth-child(12) { width: 5.5%; }
.mhcc-logbook-table th:nth-child(13) { width: 4.3%; }
.mhcc-logbook-table th:nth-child(14) { width: 5.7%; }

.mhcc-cro-logbook th:nth-child(1) { width: 6.5%; }
.mhcc-cro-logbook th:nth-child(2) { width: 5.5%; }
.mhcc-cro-logbook th:nth-child(3) { width: 4.8%; }
.mhcc-cro-logbook th:nth-child(4) { width: 3.8%; }
.mhcc-cro-logbook th:nth-child(5) { width: 7%; }
.mhcc-cro-logbook th:nth-child(6),
.mhcc-cro-logbook th:nth-child(7),
.mhcc-cro-logbook th:nth-child(8),
.mhcc-cro-logbook th:nth-child(10),
.mhcc-cro-logbook th:nth-child(11),
.mhcc-cro-logbook th:nth-child(12) { width: 6.5%; }
.mhcc-cro-logbook th:nth-child(9) { width: 7%; }
.mhcc-cro-logbook th:nth-child(13) { width: 14%; }
.mhcc-cro-logbook th:nth-child(14) { width: 4.5%; }
.mhcc-cro-logbook th:nth-child(15) { width: 3.5%; }

.mhcc-new-entry-row td {
    background: #eef6fc !important;
    border-top: 2px solid #88b6dc;
    border-bottom: 2px solid #88b6dc;
}

.mhcc-excel-table input,
.mhcc-excel-table select,
.mhcc-excel-table textarea,
.mhcc-form input,
.mhcc-form select,
.mhcc-form textarea,
.mhcc-filter-form select,
.mhcc-filter-form input {
    width: 100%;
    max-width: 100%;
    min-height: 26px;
    border: 1px solid #a4adb6;
    background: #fff;
    color: #1d2b38;
    padding: 3px 5px;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-size: clamp(11px, 0.72vw, 13px);
}

.mhcc-excel-table textarea {
    resize: vertical;
    min-height: 28px;
}

.mhcc-excel-table input[type="checkbox"] {
    width: auto;
    min-height: 0;
}

.mhcc-center {
    text-align: center;
}

.mhcc-notes-cell {
    white-space: pre-wrap;
    line-height: 1.25;
}

.mhcc-request-cell {
    cursor: default;
    font-weight: 600;
}

.mhcc-request-draft {
    background: var(--mhcc-red) !important;
}

.mhcc-request-green {
    background: var(--mhcc-green) !important;
}

.mhcc-request-sent {
    background: #e5e9ef !important;
}

.mhcc-request-done {
    background: #ebf5eb !important;
}

.mhcc-row-restricted td,
.mhcc-row-restricted .mhcc-request-cell {
    background: var(--mhcc-violet) !important;
}

.mhcc-row-team-reminder td {
    background: var(--mhcc-orange) !important;
}

.mhcc-row-emergency td {
    box-shadow: inset 3px 0 0 #b41111;
}

.mhcc-row-manual td {
    box-shadow: inset 3px 0 0 #73818d;
}

.mhcc-inline-edit {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.mhcc-inline-edit select {
    width: 70px;
    min-height: 22px;
    font-size: 12px;
}

.mhcc-mini-help,
.mhcc-help {
    display: block;
    color: #687583;
    font-size: 12px;
    font-weight: 400;
    margin-top: 3px;
}

.mhcc-muted-cell {
    color: #7b8792;
    font-size: 12px;
    background: #f1f3f5 !important;
}

.mhcc-cro-action-open {
    cursor: pointer;
}

.mhcc-cro-time-cell {
    cursor: pointer;
    background: #fffdf1 !important;
}

.mhcc-cro-time-cell:hover,
.mhcc-request-cell:hover {
    outline: 2px solid #4b8fc0;
    outline-offset: -2px;
}

.button,
.mhcc-wrap .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border: 1px solid #75a7cf;
    border-radius: 4px;
    background: linear-gradient(#dff1ff, #aad5f7);
    color: #1f4561;
    padding: 4px 10px;
    text-decoration: none;
    cursor: pointer;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.button-primary,
.mhcc-wrap .button-primary {
    background: linear-gradient(#cfeaff, #86c7f4);
    border-color: #5596c7;
    color: #173b56;
    font-weight: 700;
}

.button-small,
.mhcc-wrap .button-small {
    min-height: 24px;
    padding: 2px 7px;
    font-size: 12px;
}

.mhcc-add-row-button {
    width: 100%;
}

.mhcc-notice {
    margin: 10px 18px;
    padding: 10px 12px;
    background: #eef6ff;
    border-left: 4px solid #4d91c2;
}

.mhcc-success {
    background: #edfaef;
    border-left-color: #2e9a45;
}

.mhcc-error {
    background: #fff1f1;
    border-left-color: #bb2f2f;
}

.mhcc-warning {
    background: #fff8e7;
    border-left-color: #c8951f;
}

.mhcc-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.mhcc-settings-grid form {
    display: grid;
    gap: 8px;
}

.mhcc-settings-grid label {
    display: grid;
    gap: 4px;
    font-weight: 600;
}

.mhcc-emergency-layout {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 420px);
    gap: 18px;
}

.mhcc-checklist-box {
    background: #ececec;
    border: 1px solid #999;
    padding: 12px;
}


.mhcc-table thead th,
.mhcc-table td {
    white-space: normal;
    word-break: break-word;
}

.mhcc-auto-time-cell {
    color: #4c5a66;
    font-size: clamp(10px, 0.64vw, 12px);
    line-height: 1.15;
}

.mhcc-auto-time-cell small,
.mhcc-auto-save-cell {
    display: block;
    color: #7b8792;
    font-size: 10px;
    text-align: center;
}

.mhcc-new-entry-row.mhcc-saving td {
    opacity: 0.74;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.25), rgba(255,255,255,0.25) 4px, rgba(0,0,0,0.03) 4px, rgba(0,0,0,0.03) 8px);
}

.mhcc-new-entry-row.mhcc-saved-flash td {
    background: #dff8e4 !important;
}

.mhcc-vessel-resolved {
    background: #eef9ef !important;
}

.mhcc-table .button-small,
.mhcc-table .button {
    max-width: 100%;
    padding-left: 5px;
    padding-right: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1400px) {
    .mhcc-card { margin-left: 8px; margin-right: 8px; padding: 8px; }
    .mhcc-access-header, .mhcc-header { padding-left: 10px; padding-right: 10px; }
    .mhcc-table thead th, .mhcc-table td { padding-left: 3px; padding-right: 3px; }
    .mhcc-excel-table input,
    .mhcc-excel-table select,
    .mhcc-excel-table textarea { padding-left: 3px; padding-right: 3px; font-size: 11px; }
    .mhcc-mini-help { display: none; }
}

@media (max-width: 1050px) {
    .mhcc-table-wrap { overflow-x: auto; }
    .mhcc-table, .mhcc-table.widefat { min-width: 980px; }
}

@media (max-width: 1100px) {
    .mhcc-access-header,
    .mhcc-header,
    .mhcc-access-toprow,
    .mhcc-emergency-layout {
        grid-template-columns: 1fr;
    }
    .mhcc-settings-box {
        justify-self: stretch;
        width: auto;
    }
    .mhcc-logo-large {
        margin-left: 0;
    }
}
