.cmuny-wrap,
.cmuny-admin {
    color: #17202a;
}

.cmuny-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 0;
}

.cmuny-toolbar,
.cmuny-admin-filters,
.cmuny-card,
.cmuny-entry-form {
    box-sizing: border-box;
}

.cmuny-toolbar,
.cmuny-admin-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #f7f9fb;
}

.cmuny-toolbar label,
.cmuny-admin-filters label,
.cmuny-card label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.cmuny-toolbar span,
.cmuny-admin-filters span,
.cmuny-card label > span {
    font-size: 13px;
}

.cmuny-wrap input,
.cmuny-wrap select,
.cmuny-wrap textarea,
.cmuny-card input,
.cmuny-card select,
.cmuny-card textarea,
.cmuny-admin-filters input,
.cmuny-admin-filters select {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    border: 1px solid #bcc7d3;
    border-radius: 6px;
    background: #fff;
    color: #17202a;
}

.cmuny-wrap textarea,
.cmuny-card textarea {
    min-height: 52px;
    resize: vertical;
}

.cmuny-button,
.cmuny-wrap .cmuny-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #27496d;
    border-radius: 6px;
    background: #fff;
    color: #17324d;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.cmuny-button-primary,
.cmuny-wrap .cmuny-button-primary {
    border-color: #1f6f54;
    background: #1f6f54;
    color: #fff;
}

.cmuny-button-small,
.cmuny-wrap .cmuny-button-small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}

.cmuny-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0;
}

.cmuny-heading h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
}

.cmuny-heading span {
    color: #5b6572;
    font-weight: 700;
}

.cmuny-notice {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #9dc6a7;
    background: #edf8f0;
    color: #22552f;
}

.cmuny-notice-error {
    border-color: #d89999;
    background: #fff1f1;
    color: #7a2020;
}

.cmuny-login-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cmuny-register-wrap {
    max-width: 680px;
    padding-top: 0;
}

.cmuny-register-card {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 22px;
}

.cmuny-register-card h2 {
    margin: 0 0 14px;
    text-align: left;
}

.cmuny-register-form {
    display: grid;
    gap: 12px;
}

.cmuny-register-form label {
    margin: 0;
}

.cmuny-register-form .cmuny-actions {
    justify-content: flex-start;
    gap: 10px;
    margin-top: 4px;
}

.cmuny-bulk-hours {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #f7f9fb;
}

.cmuny-bulk-hours label {
    display: grid;
    gap: 6px;
    min-width: 180px;
    font-weight: 700;
}

.cmuny-bulk-hours span {
    font-size: 13px;
}

.cmuny-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.cmuny-section-heading h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
}

.cmuny-section-heading span {
    color: #5b6572;
    font-size: 13px;
    font-weight: 800;
}

.cmuny-overview-section-heading {
    margin-top: 18px;
}

.cmuny-performance-panel {
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fbfcfd;
}

.cmuny-performance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
}

.cmuny-performance-grid label {
    display: grid;
    gap: 6px;
    margin: 0;
    font-weight: 700;
}

.cmuny-performance-grid span {
    font-size: 13px;
}

.cmuny-performance-note {
    grid-column: span 2;
}

.cmuny-bulk-calculated-hours[readonly],
.cmuny-work-hours-input[readonly] {
    background: #eef3f7;
    color: #374151;
    cursor: default;
}

.cmuny-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fff;
}

.cmuny-table {
    width: 100%;
    border-collapse: collapse;
}

.cmuny-table th,
.cmuny-table td {
    padding: 10px;
    border-bottom: 1px solid #e4e8ee;
    text-align: left;
    vertical-align: top;
}

.cmuny-table th {
    background: #edf1f5;
    color: #263645;
    font-size: 13px;
    white-space: nowrap;
}

.cmuny-table td strong {
    display: block;
}

.cmuny-table td small {
    color: #6b7480;
}

.cmuny-entry-table input[type="time"] {
    min-width: 112px;
}

.cmuny-entry-table input[type="number"] {
    min-width: 78px;
}

.cmuny-entry-table .cmuny-work-hours-input {
    min-width: 86px;
    font-weight: 700;
}

.cmuny-entry-table textarea {
    min-width: 170px;
}

.cmuny-entry-row-locked {
    background: #f8fafb;
}

.cmuny-entry-row-locked input:disabled,
.cmuny-entry-row-locked select:disabled {
    background: #eef2f5;
    color: #6b7480;
}

.cmuny-row-invalid {
    outline: 2px solid #b42318;
    outline-offset: -2px;
}

.cmuny-row-invalid select,
.cmuny-row-invalid textarea {
    border-color: #b42318;
}

.cmuny-locked-label {
    color: #8a4b11;
    font-weight: 800;
}

.cmuny-free-days {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-width: 170px;
}

.cmuny-free-days .cmuny-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.cmuny-minutes {
    white-space: nowrap;
    font-weight: 700;
}

.cmuny-overview-wrap {
    overflow-x: auto;
}

.cmuny-overview-table {
    min-width: 1180px;
}

.cmuny-work-area-table {
    min-width: 1320px;
}

.cmuny-overview-table th,
.cmuny-overview-table td {
    text-align: center;
    vertical-align: middle;
}

.cmuny-overview-table th:first-child,
.cmuny-overview-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 190px;
    text-align: left;
    background: #fff;
    box-shadow: 1px 0 0 #e4e8ee;
}

.cmuny-overview-table th:first-child {
    z-index: 3;
    background: #edf1f5;
}

.cmuny-overview-section-row th,
.cmuny-overview-section-row th:first-child {
    position: static;
    z-index: 1;
    background: #dfe6ee;
    color: #17324d;
    box-shadow: none;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0;
}

.cmuny-overview-table th small,
.cmuny-overview-table td small,
.cmuny-overview-employee small {
    display: block;
}

.cmuny-overview-total {
    min-width: 110px;
    font-weight: 800;
    color: #17324d;
}

.cmuny-overview-table tfoot th,
.cmuny-overview-table tfoot td {
    background: #eef7f2;
    border-top: 2px solid #1f6f54;
    font-weight: 800;
}

.cmuny-overview-summary th:first-child {
    color: #143f32;
}

.cmuny-day-filled {
    min-width: 82px;
    background: #f6fbf8;
}

.cmuny-day-filled strong {
    display: block;
    color: #1f6f54;
}

.cmuny-overview-table th.cmuny-week-light,
.cmuny-overview-table td.cmuny-week-light {
    background: #fff;
}

.cmuny-overview-table th.cmuny-week-light,
.cmuny-overview-table th.cmuny-week-grey {
    text-align: center;
}

.cmuny-overview-table th.cmuny-week-grey,
.cmuny-overview-table td.cmuny-week-grey {
    background: #eef1f4;
}

.cmuny-overview-table td.cmuny-day-filled.cmuny-week-light {
    background: #f8fcfa;
}

.cmuny-overview-table td.cmuny-day-filled.cmuny-week-grey {
    background: #e8eef1;
}

.cmuny-overview-table tfoot td.cmuny-week-light {
    background: #eef7f2;
}

.cmuny-overview-table tfoot td.cmuny-week-grey {
    background: #dfeae5;
}

.cmuny-overview-table th.cmuny-week-start,
.cmuny-overview-table td.cmuny-week-start {
    border-left: 3px solid #566575;
}

.cmuny-overview-table th.cmuny-week-end,
.cmuny-overview-table td.cmuny-week-end {
    border-right: 3px solid #566575;
}

.cmuny-combined-overview-table thead th:not(.cmuny-week-light):not(.cmuny-week-grey),
.cmuny-combined-overview-table tbody tr:not(.cmuny-overview-section-row) > th,
.cmuny-combined-overview-table tbody tr:not(.cmuny-overview-section-row) > td:not(.cmuny-week-light):not(.cmuny-week-grey),
.cmuny-combined-overview-table tfoot th,
.cmuny-combined-overview-table tfoot td:not(.cmuny-week-light):not(.cmuny-week-grey) {
    background: #fff;
}

.cmuny-combined-overview-table tfoot th:first-child,
.cmuny-combined-overview-table tfoot td:first-child {
    background: #fff;
    text-align: left;
}

.cmuny-combined-overview-table tfoot td.cmuny-week-light {
    background: #fff;
}

.cmuny-combined-overview-table tfoot td.cmuny-week-grey {
    background: #eef1f4;
}

.cmuny-work-area-table th:not(:first-child),
.cmuny-work-area-table td:not(:first-child) {
    min-width: 112px;
}

.cmuny-work-area-name {
    white-space: normal;
    line-height: 1.25;
}

.cmuny-day-empty {
    color: #9aa3ad;
}

.cmuny-actions {
    margin: 14px 0 0;
    display: flex;
    justify-content: flex-end;
}

.cmuny-admin-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.cmuny-card {
    padding: 16px;
    border: 1px solid #d0d7df;
    border-radius: 8px;
    background: #fff;
    max-width: 100%;
}

.cmuny-card h2 {
    margin-top: 0;
}

.cmuny-card label {
    margin-bottom: 12px;
}

.cmuny-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    font-weight: 600;
}

.cmuny-field > span {
    font-size: 13px;
}

.cmuny-check {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
}

.cmuny-check input {
    width: auto;
    min-height: 0;
}

.cmuny-check-dropdown {
    position: relative;
    width: 100%;
    font-weight: 600;
}

.cmuny-check-dropdown summary {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 34px 7px 10px;
    border: 1px solid #bcc7d3;
    border-radius: 6px;
    background: #fff;
    color: #17202a;
    cursor: pointer;
    list-style: none;
}

.cmuny-check-dropdown summary::-webkit-details-marker {
    display: none;
}

.cmuny-check-dropdown summary::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 15px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #5b6572;
    border-bottom: 2px solid #5b6572;
    transform: rotate(45deg);
}

.cmuny-check-dropdown[open] summary::after {
    top: 18px;
    transform: rotate(225deg);
}

.cmuny-check-options {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 300px;
    overflow: auto;
    padding: 8px;
    border: 1px solid #bcc7d3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(23, 32, 42, 0.16);
}

.cmuny-check-option {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.cmuny-check-option:hover {
    background: #eef3f6;
}

.cmuny-check-option input[type="checkbox"] {
    width: auto;
    min-width: 16px;
    min-height: 16px;
    margin: 2px 0 0;
}

.cmuny-check-option-all {
    border-bottom: 1px solid #e4e8ee;
    color: #17324d;
    font-weight: 800;
}

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

.cmuny-row-actions form {
    margin: 0;
}

.cmuny-role-options {
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #f7f9fb;
}

.cmuny-role-options .cmuny-check {
    margin: 0;
}

.cmuny-role-badges {
    display: inline-block;
    max-width: 360px;
}

.cmuny-card-wide {
    min-width: 0;
    overflow-x: auto;
}

.cmuny-employee-new {
    margin: 0 0 14px;
}

.cmuny-employee-fields {
    display: grid;
    grid-template-columns: minmax(130px, 180px) minmax(170px, 1fr) minmax(250px, 1.5fr) minmax(170px, 210px) auto;
    gap: 12px;
    align-items: end;
}

.cmuny-muted {
    color: #697586;
    font-size: 13px;
}

.cmuny-flag-badges,
.cmuny-flag-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cmuny-flag-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid #d7dde5;
    border-radius: 999px;
    background: #f7f9fb;
    color: #17324d;
    font-size: 12px;
    font-weight: 700;
}

.cmuny-flag-option-list {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.cmuny-flag-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf0f3;
}

.cmuny-flag-option-row label {
    margin-bottom: 0;
}

.cmuny-flag-delete {
    min-height: 38px;
}

.cmuny-employee-flags-field .cmuny-check-dropdown {
    min-width: 170px;
}

.cmuny-employee-table .cmuny-check-options,
.cmuny-employee-flags-field .cmuny-check-options {
    position: static;
    margin-top: 4px;
    box-shadow: none;
}

.cmuny-work-area-editor {
    display: grid;
    gap: 8px;
    font-weight: 400;
}

.cmuny-work-area-editor-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cmuny-work-area-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #edf1f5;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

.cmuny-work-area-rows {
    display: grid;
    gap: 8px;
}

.cmuny-work-area-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 82px auto;
    gap: 8px;
    align-items: end;
}

.cmuny-work-area-row label {
    margin: 0;
}

.cmuny-work-area-row select,
.cmuny-work-area-row input[type="number"] {
    min-width: 0;
}

.cmuny-export-form {
    max-width: 460px;
}

.cmuny-admin-table td,
.cmuny-admin-table th {
    vertical-align: top;
}

.cmuny-admin .widefat {
    min-width: 720px;
}

.cmuny-admin > .widefat {
    display: block;
    width: 100%;
    overflow-x: auto;
}

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

@media (max-width: 760px) {
    .cmuny-wrap {
        padding: 12px 0;
    }

    .cmuny-register-wrap {
        padding: 0;
    }

    .cmuny-register-card {
        padding: 16px;
    }

    .cmuny-register-card h2 {
        font-size: 22px;
    }

    .cmuny-register-form .cmuny-actions {
        display: grid;
    }

    .cmuny-register-form .cmuny-actions .cmuny-button {
        width: 100%;
    }

    .cmuny-toolbar,
    .cmuny-admin-filters {
        display: grid;
        align-items: stretch;
    }

    .cmuny-heading {
        display: grid;
        gap: 4px;
    }

    .cmuny-heading h2 {
        font-size: 20px;
    }

    .cmuny-section-heading {
        display: grid;
        gap: 4px;
    }

    .cmuny-performance-grid {
        grid-template-columns: 1fr;
    }

    .cmuny-performance-note {
        grid-column: auto;
    }

    .cmuny-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .cmuny-overview-wrap,
    .cmuny-work-area-wrap {
        overflow-x: auto;
        border: 1px solid #d7dde5;
        background: #fff;
        -webkit-overflow-scrolling: touch;
    }

    .cmuny-entry-table,
    .cmuny-entry-table thead,
    .cmuny-entry-table tbody,
    .cmuny-entry-table th,
    .cmuny-entry-table td,
    .cmuny-entry-table tr,
    .cmuny-employee-table,
    .cmuny-employee-table thead,
    .cmuny-employee-table tbody,
    .cmuny-employee-table th,
    .cmuny-employee-table td,
    .cmuny-employee-table tr {
        display: block;
    }

    .cmuny-entry-table thead,
    .cmuny-employee-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .cmuny-entry-table tr,
    .cmuny-employee-table tr {
        margin: 0 0 12px;
        padding: 12px;
        border: 1px solid #d7dde5;
        border-radius: 8px;
        background: #fff;
    }

    .cmuny-entry-table td,
    .cmuny-employee-table td {
        display: grid;
        grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #edf0f3;
    }

    .cmuny-entry-table td:last-child,
    .cmuny-employee-table td:last-child {
        border-bottom: 0;
    }

    .cmuny-entry-table td::before,
    .cmuny-employee-table td::before {
        content: attr(data-label);
        color: #5b6572;
        font-size: 13px;
        font-weight: 700;
    }

    .cmuny-entry-table input,
    .cmuny-entry-table select,
    .cmuny-entry-table textarea,
    .cmuny-employee-table input,
    .cmuny-employee-table select,
    .cmuny-employee-table textarea {
        min-width: 0;
    }

    .cmuny-free-days {
        min-width: 0;
    }

    .cmuny-employee-fields {
        grid-template-columns: 1fr;
    }

    .cmuny-check-options {
        position: static;
        margin-top: 4px;
        box-shadow: none;
    }

    .cmuny-flag-option-row {
        grid-template-columns: 1fr;
    }

    .cmuny-work-area-row {
        grid-template-columns: minmax(0, 1fr) 76px;
    }

    .cmuny-work-area-row .cmuny-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .cmuny-actions {
        justify-content: stretch;
    }

    .cmuny-actions .cmuny-button {
        width: 100%;
    }

    .cmuny-bulk-hours {
        display: grid;
        padding: 12px;
    }

    .cmuny-bulk-hours label,
    .cmuny-bulk-hours .cmuny-button {
        width: 100%;
    }

    .cmuny-admin .widefat {
        min-width: 680px;
    }

    .cmuny-admin .cmuny-card {
        padding: 12px;
    }

    .cmuny-admin input,
    .cmuny-admin select,
    .cmuny-admin textarea,
    .cmuny-admin .button,
    .cmuny-admin .button-primary {
        max-width: 100%;
    }
}
