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

:root {
    --primary: #ed687b;
    --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: #fff;

    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: 700;
}

.user-info small {
    color: var(--muted);

    font-size: 10px;
    font-weight: 500;

    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: 600;

    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: 700;

    letter-spacing: 1.6px;

    margin-bottom: 7px;
}

.heading-row h1 {
    font-size: 30px;

    line-height: 1.2;

    letter-spacing: -0.55px;

    font-weight: 700;
}

.heading-row p {
    color: var(--muted);

    font-size: 12px;
    font-weight: 400;

    margin-top: 8px;
}


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

.visit-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: 700;
}

.table-top > div:first-child span {
    display: block;

    color: var(--muted);

    font-size: 10px;
    font-weight: 400;

    margin-top: 4px;
}

.search-box {
    width: 260px;
    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;

    color: var(--text);

    font-size: 11px;
    font-weight: 400;
}


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

.table-scroll {
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;

    min-width: 1380px;

    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: 700;

    white-space: nowrap;
}

tbody td {
    padding: 15px 16px;

    color: #35383e;

    border-bottom: 1px solid #f0f1f3;

    font-size: 11px;
    font-weight: 400;

    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;
}


/* Column widths */

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: 165px;
}

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


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

.status {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    height: 28px;

    padding: 0 9px;

    border-radius: 7px;

    font-size: 9px;
    font-weight: 700;

    white-space: nowrap;
}

.status.completed {
    color: #218557;

    background: #effaf5;

    border: 1px solid #d1efdf;
}


/* =========================
   FEEDBACK
========================= */

.feedback-btn {
    height: 31px;

    padding: 0 10px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    border: 1px solid #eadde0;

    border-radius: 7px;

    background: #fff8f9;

    color: var(--primary);

    font-family: inherit;

    font-size: 9px;
    font-weight: 700;

    cursor: pointer;

    white-space: nowrap;

    transition: 0.2s ease;
}

.feedback-btn:hover {
    color: #fff;

    border-color: var(--primary);

    background: var(--primary);
}

.feedback-btn.has-feedback {
    color: var(--success);

    background: #effaf5;

    border-color: #d1efdf;
}


/* =========================
   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: #fff;
    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;
    font-weight: 700;
}

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


/* =========================
   FEEDBACK 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(560px, 100%);

    border-radius: 17px;

    background: #fff;

    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: 700;
}

.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);
}

.feedback-body {
    padding: 24px;

    display: flex;

    align-items: flex-start;

    gap: 14px;
}

.feedback-icon {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    color: var(--success);

    background: #effaf5;
}

.feedback-body label {
    display: block;

    color: #555962;

    font-size: 10px;
    font-weight: 700;

    margin-bottom: 7px;
}

.feedback-body p {
    color: var(--text);

    font-size: 12px;
    font-weight: 400;

    line-height: 1.7;
}

.modal-footer {
    padding: 16px 24px;

    display: flex;

    justify-content: flex-end;

    border-top: 1px solid var(--border);
}

.cancel-btn {
    height: 40px;

    padding: 0 18px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: #fff;

    color: #656870;

    font-family: inherit;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}


/* =========================
   TOAST
========================= */

.toast {
    position: fixed;

    left: 50%;
    bottom: 28px;

    transform:
        translate(-50%, 15px);

    z-index: 700;

    padding: 11px 17px;

    border-radius: 9px;

    color: #fff;

    background: #24262b;

    font-size: 11px;
    font-weight: 600;

    opacity: 0;

    visibility: hidden;

    transition: 0.25s ease;
}

.toast.show {
    opacity: 1;

    visibility: visible;

    transform: translate(-50%, 0);
}


/* =========================
   MOBILE
========================= */

@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 h1 {
        font-size: 25px;
    }

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

    .visit-card {
        margin-top: 22px;

        border-radius: 13px;
    }

    .table-top {
        padding: 14px;

        align-items: stretch;

        flex-direction: column;

        gap: 12px;
    }

    .search-box {
        width: 100%;
    }

    /*
        Table deliberately stays wide.
        Swipe left/right on mobile.
    */

    .table-scroll {
        overflow-x: auto;
    }

    table {
        min-width: 1380px;
    }

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

    .modal-overlay {
        padding: 12px;
    }

    .modal {
        border-radius: 14px;
    }

    .modal-header,
    .feedback-body {
        padding: 18px;
    }

    .modal-footer {
        padding: 14px 18px;
    }

}
