* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ed687b;
    --primary-dark: #d9576c;
    --secondary: #f6a05d;
    --text: #202124;
    --muted: #777b84;
    --border: #e8e9ed;
    --background: #f7f8fa;
    --white: #ffffff;
    --success: #28a36a;
    --danger: #df5264;
}

body {
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: "Manrope", sans-serif;
}

body.modal-open {
    overflow: hidden;
}

/* =========================
   HEADER
========================= */

.topbar {
    height: 78px;
    padding: 0 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
}

.brand img {
    width: 190px;
    max-height: 54px;
    object-fit: contain;
    display: block;
    background-color: #2f1423;
    padding: 5px;
    border-radius: 10px;
}

.user-button {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 9px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: 0.25s ease;
}

.user-button:hover,
.user-button.active {
    background: #f6f6f7;
}

.avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    font-size: 13px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
}

.user-info strong {
    font-size: 13px;
    font-weight: 800;
}

.user-info small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
}

.user-button > i {
    color: #8b8d94;
    font-size: 10px;
}

/* =========================
   PAGE
========================= */

.page-container {
    width: min(1440px, calc(100% - 56px));
    margin: auto;
    padding: 36px 0 70px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 20px;
    transition: 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
}

.heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.eyebrow {
    display: block;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
    margin-bottom: 7px;
}

.heading-row h1 {
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.8px;
    font-weight: 800;
}

.heading-row p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 8px;
}

.add-work-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 8px 20px rgba(237, 104, 123, 0.2);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
}

.add-work-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 25px rgba(237, 104, 123, 0.27);
}

/* =========================
   TABLE CARD
========================= */

.work-card {
    margin-top: 30px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(30, 32, 40, 0.06);
    overflow: hidden;
}

.table-top {
    min-height: 76px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.table-top h2 {
    font-size: 14px;
    font-weight: 800;
}

.table-top > div:first-child span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 4px;
}

.search-box {
    width: 240px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fafafa;
}

.search-box i {
    color: #9a9da5;
    font-size: 12px;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    color: var(--text);
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Keep the desktop table wide.
   On mobile this forces horizontal scrolling instead of
   breaking the table into cards. */
table {
    width: 100%;
    min-width: 1250px;
    border-collapse: collapse;
    table-layout: fixed;
}

thead th {
    padding: 15px 16px;
    text-align: left;
    color: #555962;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

tbody td {
    padding: 15px 16px;
    color: #35383e;
    border-bottom: 1px solid #f0f1f3;
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
    line-height: 1.55;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #fffafa;
}

tbody tr:last-child td {
    border-bottom: 0;
}

thead th:nth-child(1),
tbody td:nth-child(1) {
    width: 125px;
}

thead th:nth-child(2),
tbody td:nth-child(2) {
    width: 180px;
}

thead th:nth-child(3),
tbody td:nth-child(3) {
    width: 150px;
}

thead th:nth-child(4),
tbody td:nth-child(4) {
    width: 160px;
}

thead th:nth-child(5),
tbody td:nth-child(5) {
    width: 410px;
    min-width: 410px;
}

thead th:nth-child(6),
tbody td:nth-child(6) {
    width: 150px;
}

thead th:nth-child(7),
tbody td:nth-child(7) {
    width: 85px;
}

/* =========================
   STATUS
========================= */

.status-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.status-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1.5px solid #d8dae0;
    border-radius: 5px;
    background: white;
    transition: 0.2s ease;
}

.status-check input:checked + .checkmark {
    border-color: var(--success);
    background: var(--success);
}

.status-check input:checked + .checkmark::after {
    content: "\f00c";
    color: white;
    font-family: "Font Awesome 6 Free";
    font-size: 9px;
    font-weight: 900;
}

.status-text {
    color: #888c94;
    font-size: 10px;
    font-weight: 700;
}

.status-check input:checked ~ .status-text {
    color: var(--success);
}

tbody tr.completed td {
    opacity: 0.68;
}

tbody tr.completed td:nth-child(2) {
    text-decoration: line-through;
}

/* =========================
   DELETE
========================= */

.delete-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: #fff1f3;
    color: var(--danger);
    cursor: pointer;
    transition: 0.2s ease;
}

.delete-btn:hover {
    color: white;
    background: var(--danger);
}

/* =========================
   EMPTY
========================= */

.empty-state {
    display: none;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    color: var(--muted);
}

.empty-state.show {
    display: flex;
}

.empty-state i {
    font-size: 28px;
    margin-bottom: 5px;
}

.empty-state strong {
    color: var(--text);
    font-size: 13px;
}

.empty-state span {
    font-size: 10px;
}

/* =========================
   MODAL
========================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 21, 25, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: min(600px, 100%);
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    border-radius: 17px;
    background: white;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.18);
    transform: translateY(15px) scale(0.98);
    transition: 0.25s ease;
}

.modal-overlay.show .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 19px;
    font-weight: 800;
}

.close-modal {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #f5f5f6;
    color: #777b84;
    cursor: pointer;
}

.close-modal:hover {
    background: #ffecee;
    color: var(--primary);
}

#workForm {
    padding: 22px 24px 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 11px;
    font-weight: 800;
    color: #454850;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid #dedfe4;
    border-radius: 9px;
    outline: 0;
    background: #fff;
    padding: 11px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 11px;
    transition: 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 95px;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(237, 104, 123, 0.09);
}

.modal-footer {
    margin-top: 22px;
    padding-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border);
}

.cancel-btn,
.save-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.cancel-btn {
    border: 1px solid var(--border);
    background: white;
    color: #656870;
}

.save-btn {
    border: 0;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {

    .topbar {
        height: 68px;
        padding: 0 16px;
    }

    .brand img {
        width: 145px;
        max-height: 45px;
    }

    .user-info,
    .user-button > i {
        display: none;
    }

    .user-button {
        padding: 0;
    }

    .avatar {
        width: 40px;
        height: 40px;
    }

    .page-container {
        width: calc(100% - 24px);
        padding: 25px 0 45px;
    }

    .heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .heading-row h1 {
        font-size: 25px;
    }

    .heading-row p {
        line-height: 1.5;
    }

    .add-work-btn {
        width: 100%;
    }

    .work-card {
        margin-top: 22px;
        border-radius: 13px;
    }

    .table-top {
        padding: 14px;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .search-box {
        width: 100%;
    }

    /*
      IMPORTANT:
      The table intentionally remains wide.
      User can swipe horizontally on mobile.
    */
    .table-scroll {
        overflow-x: auto;
    }

    table {
        min-width: 1250px;
    }

    thead th,
    tbody td {
        padding-left: 13px;
        padding-right: 13px;
    }

    .modal-overlay {
        padding: 12px;
    }

    .modal {
        max-height: calc(100vh - 24px);
        border-radius: 14px;
    }

    .modal-header {
        padding: 18px;
    }

    #workForm {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-group.full-width {
        grid-column: auto;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .cancel-btn,
    .save-btn {
        width: 100%;
    }
}
