.x9-project-form {
    max-width: 900px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-sizing: border-box;
}

.x9-project-form *,
.x9-project-form *::before,
.x9-project-form *::after {
    box-sizing: border-box;
}

.x9-project-form__message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.x9-project-form__message.is-success {
    background: #ecfdf5;
    color: #047857;
}

.x9-project-form__message.is-error {
    background: #fef2f2;
    color: #b91c1c;
}

.x9-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.x9-field {
    /* margin-bottom: 18px; */
}

.x9-grid .x9-field {
    margin-bottom: 0;
}

.x9-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: #111827;
}

.x9-field label span {
    color: #dc2626;
}

.x9-field input,
.x9-field select,
.x9-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: #111827;
    font-size: 14px;
}

.x9-field textarea {
    resize: vertical;
}

.x9-field input:focus,
.x9-field select:focus,
.x9-field textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, .12);
}

.x9-help {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

.x9-user-picker {
    position: relative;
}

.x9-user-picker__list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 10;
    display: none;
    max-height: 210px;
    overflow-y: auto;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.x9-user-picker__item {
    padding: 10px 12px;
    font-size: 14px;
    color: #111827;
    cursor: pointer;
}

.x9-user-picker__item:hover,
.x9-user-picker__item:focus {
    background: #f3f4f6;
}

.x9-user-picker.is-open .x9-user-picker__list {
    display: block;
}

.x9-user-picker__item[style*="display: none"] {
    display: none !important;
}

.x9-project-form__submit {
    border: 0;
    border-radius: 8px;
    padding: 11px 18px;
    background: #ea580c;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.x9-project-form__submit:hover {
    background: #c2410c;
}

.x9-project-form__submit:disabled {
    opacity: .6;
    cursor: wait;
}

@media (max-width: 700px) {
    .x9-grid {
        grid-template-columns: 1fr;
    }

    .x9-project-form {
        padding: 18px;
    }
}

/* Elementor Popup compatibility */
.elementor-popup-modal .x9-project-form,
.dialog-widget-content .x9-project-form {
    overflow: visible;
}

.x9-user-picker__list {
    z-index: 999999;
}


/* Project table / DataTable-like UI */
.x9-project-table-wrap {
    width: 100%;
    overflow: visible;
}

.x9-project-table-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.x9-project-table-toolbar input,
.x9-project-table-toolbar select {
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
    max-width: 200px;
}

.x9-project-table-search {
    flex: 1;
    min-width: 220px;
}

.x9-project-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.x9-project-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
}

.x9-project-table th,
.x9-project-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #eef0f3;
    text-align: left;
    vertical-align: middle;
}

.x9-project-table th {
    background: #f8fafc;
    font-weight: 700;
    white-space: nowrap;
}

.x9-project-table tbody tr:hover {
    background: #fafafa;
}

.x9-project-table tr[data-pro-status="before"] .x9-project-view {
    display: none;
}

.x9-project-table tr[data-pro-status="before"] .x9-project-title-link {
    pointer-events: none;
    color: #000;
}

.x9-project-title-link {
    font-weight: 600;
    text-decoration: none;
}

.x9-project-progress-bar {
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 4px;
}

.x9-project-progress-bar span {
    display: block;
    height: 100%;
    background: #f97316;
    border-radius: inherit;
}

.x9-project-actions {
    white-space: nowrap;
}

.x9-project-action {
    display: inline-block;
    border: 0;
    background: transparent;
    padding: 4px 6px;
    margin-right: 3px;
    color: #2563eb;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
}

.x9-project-delete {
    color: #dc2626;
}

.x9-project-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    font-size: 13px;
    color: #6b7280;
}

.x9-project-table-pagination {
    display: flex;
    gap: 4px;
}

.x9-project-table-pagination button {
    min-width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.x9-project-table-pagination button.is-current {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.x9-user-picker__empty {
    padding: 10px 12px;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 700px) {
    .x9-project-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .x9-project-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Task template */
.x9-task-template-repeater{margin-top:20px;border:1px solid #ddd;padding:16px;border-radius:6px}
.x9-task-template-repeater__head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.x9-task-template-add{border:0;border-radius:4px;padding:8px 12px;cursor:pointer}
.x9-task-template-item{display:grid;grid-template-columns:36px minmax(0,1fr) 180px auto;align-items:end;gap:12px;padding:14px 0;border-top:1px solid #eee}
.x9-task-template-item:first-child{border-top:0}
.x9-task-template-item__number{font-weight:600;padding-bottom:10px}
.x9-task-template-remove{border:0;padding:9px 12px;cursor:pointer}
.x9-task-template-list__head{margin-bottom:14px;font-size:18px}
.x9-task-template-list .x9-project-table{width:100%}
@media (max-width:700px){.x9-task-template-item{grid-template-columns:30px 1fr}.x9-task-template-item .x9-field:nth-child(3),.x9-task-template-item .x9-task-template-remove{grid-column:2}}


/* Task template picker (separate from admin task-template list). */
.x9-task-template-picker__list { display:flex; flex-direction:column; gap:10px; }
.x9-task-template-picker__item { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 14px; border:1px solid #ddd; border-radius:6px; }
.x9-task-template-picker__info { display:flex; flex-direction:column; gap:4px; min-width:0; }
.x9-task-template-picker__info span { font-size:13px; opacity:.75; }
.x9-task-template-add-to-project { flex:0 0 auto; cursor:pointer; }
.x9-task-template-add-to-project:disabled { cursor:wait; opacity:.6; }
.x9-task-template-picker__empty { padding:15px; border:1px dashed #ccc; }

/* Task edit form: compact repeater */
.x9-task-form .x9-task-edit-repeater {
    margin-top: 4px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}

.x9-task-form .x9-task-edit-repeater__items {
    display: flex;
    flex-direction: column;
}

.x9-task-form .x9-task-edit-repeater__item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 145px 48px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: #fff;
    border-bottom: 1px solid #eef0f3;
}

.x9-task-form .x9-task-edit-repeater__item:last-child {
    border-bottom: 0;
}

.x9-task-form .x9-task-edit-repeater__number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

.x9-task-form .x9-task-edit-repeater__input {
    min-width: 0;
}

.x9-task-form .x9-task-edit-repeater__input input {
    margin: 0;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 7px;
}

.x9-task-form .x9-task-edit-repeater__done {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.x9-task-form .x9-task-edit-repeater__done input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.x9-task-form .x9-task-edit-repeater__remove {
    justify-self: end;
    border: 0;
    background: transparent;
    color: #dc2626;
    font-size: 13px;
    cursor: pointer;
    padding: 5px 4px;
}

.x9-task-form .x9-task-edit-repeater__remove:hover {
    text-decoration: underline;
}

.x9-task-form .x9-task-edit-repeater__add {
    display: block;
    width: 100%;
    border: 0;
    border-top: 1px solid #e5e7eb;
    padding: 10px 12px;
    background: #f8fafc;
    color: #ea580c;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.x9-task-form .x9-task-edit-repeater__add:hover {
    background: #fff7ed;
}

.x9-task-form .x9-task-meta-grid {
    margin-top: 2px;
}

.x9-task-form .x9-task-staff-picker .x9-user-picker__list {
    max-height: 220px;
}

@media (max-width: 700px) {
    .x9-task-form .x9-task-edit-repeater__item {
        grid-template-columns: 30px minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .x9-task-form .x9-task-edit-repeater__done {
        grid-column: 2;
    }

    .x9-task-form .x9-task-edit-repeater__remove {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}

/* Employee task checklist / comments */
.x9-task-employee-form {
    max-width: 760px;
    margin: 0 auto;
    font-size: 14px;
}

.x9-task-employee__message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f8fafc;
}

.x9-task-employee__message.is-error {
    background: #fef2f2;
    color: #b91c1c;
}

.x9-task-employee__title-wrap {
    padding: 0 0 14px;
    border-bottom: 1px solid #e5e7eb;
}

.x9-task-employee__label,
.x9-task-employee__section-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.x9-task-employee__title {
    margin: 3px 0 8px;
    font-size: 20px;
    line-height: 1.35;
    color: #111827;
}

.x9-task-employee__status {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.x9-task-employee__section {
    margin-top: 16px;
}

.x9-task-employee__items {
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.x9-task-employee__item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 20px auto;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 9px 12px;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
}

.x9-task-employee__item:last-child {
    border-bottom: 0;
}

.x9-task-employee__item:hover {
    background: #f8fafc;
}

.x9-task-employee__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.x9-task-employee__name {
    min-width: 0;
    color: #1f2937;
    line-height: 1.4;
}

.x9-task-employee__checkbox {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #2563eb;
}

.x9-task-employee__check-label {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
}

.x9-task-employee__checkbox:checked + .x9-task-employee__check-label {
    color: #15803d;
    font-weight: 600;
}

.x9-task-employee__empty,
.x9-task-employee__comment-empty {
    padding: 16px;
    color: #94a3b8;
    text-align: center;
}

.x9-task-employee__comments {
    margin-top: 20px;
}

.x9-task-employee__comment-list {
    margin-top: 8px;
}

.x9-task-employee__comment {
    padding: 11px 13px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.x9-task-employee__comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 12px;
}

.x9-task-employee__comment-head strong {
    color: #334155;
}

.x9-task-employee__comment-head span {
    color: #94a3b8;
}

.x9-task-employee__comment-content {
    color: #475569;
    line-height: 1.55;
}

.x9-task-employee__comment-content p:last-child {
    margin-bottom: 0;
}

.x9-task-employee__comment-form {
    margin-top: 10px;
}

.x9-task-employee__comment-form textarea {
    display: block;
    width: 100%;
    min-height: 80px;
    resize: vertical;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    outline: none;
}

.x9-task-employee__comment-form textarea:focus {
    border-color: #94a3b8;
}

.x9-task-employee__comment-submit {
    margin-top: 8px;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}

.x9-task-employee__comment-submit:disabled {
    opacity: .6;
    cursor: wait;
}

@media (max-width: 600px) {
    .x9-task-employee__item {
        grid-template-columns: 30px minmax(0, 1fr) 20px;
    }

    .x9-task-employee__check-label {
        display: none;
    }
}

/* Task comment attachments */
