﻿/* =========================================================
   MASTER JOBDESK
   ========================================================= */

.mj-page {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    overflow-x: hidden;
    background: #f6f8fc;
    color: #172033;
    font-family: Inter, Arial, sans-serif;
}

    .mj-page,
    .mj-page * {
        box-sizing: border-box;
    }

/* HEADER */

.mj-header {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

    .mj-header h1 {
        margin: 0 0 5px;
        color: #14213a;
        font-size: 27px;
        font-weight: 750;
    }

    .mj-header p {
        margin: 0;
        color: #718096;
        font-size: 14px;
        line-height: 1.6;
    }

/* BUTTON */

.mj-btn-primary,
.mj-btn-secondary {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

.mj-btn-primary {
    border: 1px solid #1769e0;
    background: #1769e0;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(23, 105, 224, 0.16);
}

    .mj-btn-primary:hover {
        border-color: #105cc8;
        background: #105cc8;
        color: #ffffff;
        transform: translateY(-1px);
    }

    .mj-btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.mj-btn-secondary {
    border: 1px solid #d8e0eb;
    background: #ffffff;
    color: #455268;
}

    .mj-btn-secondary:hover {
        border-color: #b9c7da;
        background: #f8fafc;
    }

/* ALERT */

.mj-alert {
    min-height: 46px;
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 13px;
}

    .mj-alert > span {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mj-alert button {
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: inherit;
        font-size: 21px;
        cursor: pointer;
    }

    .mj-alert.error {
        border: 1px solid #fecaca;
        background: #fff1f2;
        color: #b42318;
    }

    .mj-alert.success {
        border: 1px solid #bbf7d0;
        background: #f0fdf4;
        color: #15803d;
    }

/* SUMMARY */

.mj-summary-grid {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
}

.mj-summary-card {
    min-height: 88px;
    padding: 15px;
    border: 1px solid #e1e7f0;
    border-radius: 11px;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 13px;
    box-shadow: 0 2px 6px rgba(31, 45, 68, 0.025);
}

    .mj-summary-card span {
        margin-bottom: 4px;
        display: block;
        color: #748197;
        font-size: 11px;
        font-weight: 600;
    }

    .mj-summary-card strong {
        display: block;
        color: #17243b;
        font-size: 25px;
        font-weight: 760;
    }

.mj-summary-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

    .mj-summary-icon.blue {
        background: #eaf2ff;
        color: #1769e0;
    }

    .mj-summary-icon.green {
        background: #eaf8ef;
        color: #168c46;
    }

    .mj-summary-icon.gray {
        background: #eef1f5;
        color: #697589;
    }

    .mj-summary-icon.orange {
        background: #fff3df;
        color: #df7508;
    }

/* PANEL */

.mj-panel {
    width: 100%;
    padding: 18px;
    border: 1px solid #e0e7f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 48, 73, 0.035);
}

/* FILTER */

.mj-filter-grid {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #e4eaf2;
    border-radius: 9px;
    background: #fafbfd;
    display: grid;
    grid-template-columns: minmax(230px, 1.5fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(140px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
}

.mj-form-group {
    min-width: 0;
}

    .mj-form-group label {
        margin-bottom: 6px;
        display: block;
        color: #354258;
        font-size: 11px;
        font-weight: 750;
    }

        .mj-form-group label b {
            color: #d92d20;
        }

    .mj-form-group input,
    .mj-form-group select,
    .mj-form-group textarea {
        width: 100%;
        min-height: 40px;
        padding: 8px 11px;
        border: 1px solid #d5dde8;
        border-radius: 7px;
        outline: none;
        background: #ffffff;
        color: #263348;
        font-family: inherit;
        font-size: 13px;
        transition: 0.18s ease;
    }

    .mj-form-group textarea {
        min-height: 96px;
        resize: vertical;
    }

        .mj-form-group input:focus,
        .mj-form-group select:focus,
        .mj-form-group textarea:focus {
            border-color: #4d92ef;
            box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.1);
        }

.mj-search {
    position: relative;
}

    .mj-search i {
        position: absolute;
        top: 50%;
        left: 12px;
        color: #95a0b1;
        font-size: 12px;
        transform: translateY(-50%);
    }

    .mj-search input {
        padding-left: 35px;
    }

.mj-reset-button {
    min-width: 75px;
}

/* TABLE */

.mj-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e0e7f0;
    border-radius: 9px;
    background: #ffffff;
}

.mj-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
}

    .mj-table th {
        padding: 11px 12px;
        border-bottom: 1px solid #dfe6ef;
        background: #f6f8fb;
        color: #566276;
        font-size: 10px;
        font-weight: 780;
        letter-spacing: 0.02em;
        text-align: left;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .mj-table td {
        padding: 12px;
        border-bottom: 1px solid #edf0f5;
        color: #3c495d;
        font-size: 12px;
        line-height: 1.45;
        vertical-align: middle;
    }

    .mj-table tbody tr:hover {
        background: #fafcff;
    }

    .mj-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .mj-table .text-center {
        text-align: center;
    }

.mj-main-cell {
    min-width: 250px;
}

    .mj-main-cell strong {
        margin-bottom: 3px;
        display: block;
        color: #1c293d;
        font-size: 13px;
    }

    .mj-main-cell span {
        max-width: 360px;
        display: block;
        overflow: hidden;
        color: #7b8799;
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.mj-division {
    padding: 5px 8px;
    border-radius: 6px;
    background: #eef4ff;
    color: #2667ba;
    font-size: 10px;
    font-weight: 700;
}

/* BADGES */

.mj-frequency,
.mj-required {
    width: fit-content;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}

    .mj-frequency.daily {
        border-color: #bfdbfe;
        background: #eff6ff;
        color: #1d67c8;
    }

    .mj-frequency.weekly {
        border-color: #ddd6fe;
        background: #f5f3ff;
        color: #6d43bf;
    }

    .mj-frequency.monthly {
        border-color: #fed7aa;
        background: #fff7ed;
        color: #c25b0a;
    }

    .mj-frequency.yearly {
        border-color: #bbf7d0;
        background: #f0fdf4;
        color: #168043;
    }

    .mj-frequency.conditional {
        border-color: #e2e8f0;
        background: #f8fafc;
        color: #64748b;
    }

    .mj-required.yes {
        border-color: #bbf7d0;
        background: #f0fdf4;
        color: #168043;
    }

    .mj-required.no {
        border-color: #e2e8f0;
        background: #f8fafc;
        color: #64748b;
    }

/* STATUS */

.mj-status-button {
    min-height: 29px;
    padding: 3px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}

    .mj-status-button span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
    }

    .mj-status-button.active {
        border: 1px solid #bbf7d0;
        background: #f0fdf4;
        color: #15803d;
    }

        .mj-status-button.active span {
            background: #22c55e;
        }

    .mj-status-button.inactive {
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        color: #64748b;
    }

        .mj-status-button.inactive span {
            background: #94a3b8;
        }

/* ACTION */

.mj-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

    .mj-action-group button {
        width: 32px;
        height: 32px;
        padding: 0;
        border: 1px solid #dce3ec;
        border-radius: 7px;
        background: #ffffff;
        color: #667287;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: 0.16s ease;
    }

        .mj-action-group button:hover {
            border-color: #a8c7f3;
            background: #edf5ff;
            color: #1769e0;
        }

        .mj-action-group button.delete:hover {
            border-color: #fecaca;
            background: #fff1f2;
            color: #d92d20;
        }

/* EMPTY */

.mj-empty {
    min-height: 230px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8b96a7;
    text-align: center;
}

    .mj-empty i {
        margin-bottom: 12px;
        color: #b4bdca;
        font-size: 34px;
    }

    .mj-empty strong {
        margin-bottom: 5px;
        color: #526074;
        font-size: 15px;
    }

    .mj-empty span {
        max-width: 420px;
        font-size: 12px;
    }

/* LOADING */

.mj-loading {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #6d788b;
    font-size: 13px;
}

/* PAGINATION */

.mj-pagination {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

    .mj-pagination > span {
        color: #7d899b;
        font-size: 11px;
    }

    .mj-pagination > div {
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .mj-pagination button {
        min-width: 33px;
        height: 33px;
        padding: 0 8px;
        border: 1px solid #dce3ec;
        border-radius: 7px;
        background: #ffffff;
        color: #5f6c80;
        font-size: 11px;
        cursor: pointer;
    }

        .mj-pagination button:hover:not(:disabled) {
            border-color: #aac8f2;
            background: #edf5ff;
            color: #1769e0;
        }

        .mj-pagination button.active {
            border-color: #1769e0;
            background: #1769e0;
            color: #ffffff;
        }

        .mj-pagination button:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

/* MODAL */

.mj-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    padding: 20px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mj-modal {
    width: 690px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 26px 80px rgba(15, 23, 42, 0.28);
    animation: mjModalOpen 0.18s ease-out;
}

@keyframes mjModalOpen {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mj-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #e5eaf1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

    .mj-modal-header h2 {
        margin: 0 0 4px;
        color: #17243a;
        font-size: 18px;
        font-weight: 750;
    }

    .mj-modal-header p {
        margin: 0;
        color: #7d899b;
        font-size: 12px;
    }

.mj-modal-close {
    width: 33px;
    height: 33px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #758195;
    font-size: 24px;
    cursor: pointer;
}

    .mj-modal-close:hover {
        background: #f2f4f7;
    }

.mj-modal-body {
    padding: 20px;
}

    .mj-modal-body > .mj-form-group {
        margin-bottom: 14px;
    }

.mj-form-grid {
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

    .mj-form-grid.three {
        grid-template-columns: repeat(3, 1fr);
    }

.mj-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e5eaf1;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

/* SWITCH */

.mj-switch-row {
    margin-top: 4px;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fafbfd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

    .mj-switch-row strong,
    .mj-switch-row span {
        display: block;
    }

    .mj-switch-row strong {
        margin-bottom: 3px;
        color: #354258;
        font-size: 12px;
    }

    .mj-switch-row > div > span {
        color: #7d899b;
        font-size: 10px;
    }

.mj-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex: 0 0 44px;
}

    .mj-switch input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

    .mj-switch > span {
        position: absolute;
        inset: 0;
        border-radius: 999px;
        background: #cbd5e1;
        cursor: pointer;
        transition: 0.2s ease;
    }

        .mj-switch > span::after {
            position: absolute;
            top: 3px;
            left: 3px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #ffffff;
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
            content: "";
            transition: 0.2s ease;
        }

    .mj-switch input:checked + span {
        background: #1769e0;
    }

        .mj-switch input:checked + span::after {
            transform: translateX(20px);
        }

.validation-message {
    margin-top: 5px;
    display: block;
    color: #d92d20;
    font-size: 11px;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
    .mj-summary-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .mj-filter-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .mj-page {
        padding: 13px;
    }

    .mj-header {
        flex-direction: column;
        align-items: stretch;
    }

        .mj-header h1 {
            font-size: 22px;
        }

        .mj-header > button {
            width: 100%;
        }

    .mj-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .mj-summary-card {
        min-height: 78px;
        padding: 12px;
    }

    .mj-summary-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .mj-summary-card strong {
        font-size: 21px;
    }

    .mj-panel {
        padding: 12px;
    }

    .mj-filter-grid {
        grid-template-columns: 1fr;
    }

    .mj-reset-button {
        width: 100%;
    }

    .mj-pagination {
        align-items: flex-start;
        flex-direction: column;
    }

    .mj-modal-backdrop {
        padding: 10px;
        align-items: flex-start;
    }

    .mj-modal {
        width: 100%;
        max-height: calc(100vh - 20px);
        margin: auto 0;
    }

    .mj-form-grid,
    .mj-form-grid.three {
        grid-template-columns: 1fr;
    }

    .mj-modal-footer {
        flex-direction: column-reverse;
    }

        .mj-modal-footer button {
            width: 100%;
        }
}

@media (max-width: 430px) {
    .mj-page {
        padding: 10px;
    }

    .mj-summary-grid {
        grid-template-columns: 1fr;
    }

    .mj-switch-row {
        align-items: flex-start;
    }
}
