/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Gill Sans MT", "Gill Sans", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f5f6f8;
    color: #172033;
    min-height: 100vh;
}


/* =========================================================
   HEADER
========================================================= */

.header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;

    min-height: 150px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.header-content h1 {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    color: #142033;
}

.header-content p {
    font-size: 15px;
    color: #718096;
}


/* =========================================================
   REFRESH BUTTON
========================================================= */

.refresh-btn {
    appearance: none;

    border: 1px solid #d7dce3;
    background: #ffffff;

    color: #172033;

    padding: 11px 18px;

    border-radius: 9px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.refresh-btn:hover {
    background: #f8fafc;
    border-color: #c7cdd6;
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* =========================================================
   MAIN CONTAINER
========================================================= */

.main-container {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;

    padding: 30px 0 60px;
}


/* =========================================================
   TOP SECTION
========================================================= */

.top-section {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 26px;
}


/* =========================================================
   STATS CARD
========================================================= */

.stats-card {
    min-width: 185px;

    background: #ffffff;

    border: 1px solid #e2e6eb;

    border-radius: 12px;

    padding: 18px 20px;

    display: flex;
    align-items: center;

    gap: 14px;
}

.stats-icon {
    width: 42px;
    height: 42px;

    border-radius: 9px;

    background: #f2f0f8;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
}

.stats-content {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.stats-label {
    font-size: 13px;
    color: #718096;
}

.stats-number {
    font-size: 22px;
    line-height: 1.1;
    color: #172033;
}


/* =========================================================
   SEARCH
========================================================= */

.search-wrapper {
    width: 355px;
    position: relative;
}

.search-input {
    width: 100%;

    height: 48px;

    border: 1px solid #d7dce3;

    background: #ffffff;

    border-radius: 10px;

    padding: 0 42px 0 43px;

    font-size: 15px;

    color: #172033;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-input::placeholder {
    color: #8a93a3;
}

.search-input:focus {
    border-color: #9aa4b2;

    box-shadow:
        0 0 0 3px rgba(100, 116, 139, 0.10);
}

.search-icon {
    position: absolute;

    left: 15px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 16px;

    pointer-events: none;

    z-index: 2;
}

.clear-search {
    position: absolute;

    right: 12px;
    top: 50%;

    transform: translateY(-50%);

    width: 25px;
    height: 25px;

    border: 0;
    border-radius: 50%;

    background: #eef0f3;

    color: #5f6877;

    font-size: 17px;
    line-height: 1;

    cursor: pointer;
}


/* =========================================================
   GUEST CARD
========================================================= */

.guest-card {
    background: #ffffff;

    border: 1px solid #e1e5ea;

    border-radius: 13px;

    overflow: hidden;
}


/* =========================================================
   GUEST CARD HEADER
========================================================= */

.guest-card-header {
    min-height: 90px;

    padding: 22px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-bottom: 1px solid #e7e9ed;
}

.guest-card-header h2 {
    font-size: 18px;
    line-height: 1.3;

    color: #172033;

    margin-bottom: 5px;
}

.guest-card-header p {
    font-size: 14px;
    color: #718096;
}

.results-count {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 8px 13px;

    border-radius: 20px;

    background: #f1f3f6;

    color: #7a8494;

    font-size: 13px;

    white-space: nowrap;
}


/* =========================================================
   TABLE
========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.guest-table {
    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;
}

.guest-table thead {
    background: #fafbfc;
}

.guest-table th {
    height: 43px;

    padding: 0 22px;

    text-align: left;

    border-bottom: 1px solid #e5e7eb;

    color: #64748b;

    font-size: 12px;

    font-weight: 600;

    letter-spacing: 0.02em;
}

.guest-table td {
    height: 70px;

    padding: 0 22px;

    border-bottom: 1px solid #edf0f3;

    font-size: 15px;

    color: #172033;

    vertical-align: middle;
}

.guest-table tbody tr:last-child td {
    border-bottom: none;
}

.guest-table tbody tr:hover {
    background: #fafbfc;
}


/* =========================================================
   TABLE COLUMNS
========================================================= */

.number-column {
    width: 65px;
}

.guest-table td:first-child {
    color: #8b95a5;
    font-size: 13px;
}

.guest-name {
    font-weight: 500;
    color: #172033;
}

.action-column {
    width: 150px;
    text-align: right !important;
}


/* =========================================================
   DOWNLOAD BUTTON
========================================================= */

.download-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    min-width: 112px;

    height: 40px;

    padding: 0 15px;

    border: none;

    border-radius: 8px;

    background: #121a2b;

    color: #ffffff;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

.download-btn:hover {
    background: #1c263a;
}

.download-btn:active {
    transform: translateY(1px);
}

.download-btn span {
    font-size: 17px;
    line-height: 1;
}


/* =========================================================
   LOADING
========================================================= */

.loading-row {
    height: 100px !important;

    text-align: center !important;

    color: #718096 !important;

    font-size: 14px !important;
}


/* =========================================================
   NO RESULTS
========================================================= */

.no-results {
    padding: 60px 20px;

    text-align: center;

    border-top: 1px solid #edf0f3;
}

.no-results-icon {
    font-size: 28px;

    margin-bottom: 10px;
}

.no-results h3 {
    font-size: 17px;

    color: #172033;

    margin-bottom: 5px;
}

.no-results p {
    font-size: 14px;

    color: #718096;
}


/* =========================================================
   MODAL
========================================================= */

.modal {
    position: fixed;

    inset: 0;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 25px;

    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;

    inset: 0;

    background: rgba(15, 23, 42, 0.60);
}

.modal-box {
    position: relative;

    z-index: 2;

    width: min(650px, 100%);

    max-height: 92vh;

    overflow: auto;

    background: #ffffff;

    border-radius: 14px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.20);
}


/* =========================================================
   MODAL HEADER
========================================================= */

.modal-header {
    padding: 20px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #e7e9ed;
}

.modal-header h2 {
    font-size: 18px;

    color: #172033;

    margin-bottom: 4px;
}

.modal-header p {
    font-size: 14px;

    color: #718096;
}

.modal-close {
    width: 35px;
    height: 35px;

    border: 0;

    border-radius: 7px;

    background: #f1f3f5;

    color: #4b5563;

    font-size: 22px;

    cursor: pointer;
}


/* =========================================================
   MODAL BODY
========================================================= */

.modal-body {
    padding: 25px;

    background: #f5f6f8;
}

.invitation-preview {
    display: flex;

    align-items: center;
    justify-content: center;
}

.invitation-preview img {
    display: block;

    max-width: 100%;
    max-height: 65vh;

    width: auto;
    height: auto;

    object-fit: contain;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   MODAL FOOTER
========================================================= */

.modal-footer {
    padding: 18px 22px;

    display: flex;

    justify-content: flex-end;

    align-items: center;

    gap: 10px;

    border-top: 1px solid #e7e9ed;
}

.cancel-btn {
    height: 40px;

    padding: 0 17px;

    border: 1px solid #d7dce3;

    background: #ffffff;

    color: #374151;

    border-radius: 8px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;
}

.cancel-btn:hover {
    background: #f8fafc;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 800px) {

    .header-inner {
        width: min(100% - 30px, 1240px);

        min-height: auto;

        padding: 22px 0;

        align-items: flex-start;

        flex-direction: column;
    }

    .refresh-btn {
        align-self: flex-start;
    }

    .main-container {
        width: calc(100% - 30px);

        padding-top: 22px;
    }

    .top-section {
        flex-direction: column;

        align-items: stretch;
    }

    .search-wrapper {
        width: 100%;
    }

    .stats-card {
        width: 100%;
    }

    .guest-card-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .action-column {
        width: 130px;
    }

}


@media (max-width: 520px) {

    .header-content h1 {
        font-size: 25px;
    }

    .guest-table th,
    .guest-table td {
        padding-left: 14px;
        padding-right: 14px;
    }

    .download-btn {
        min-width: auto;

        padding: 0 12px;
    }

    .download-btn span {
        display: none;
    }

    .action-column {
        width: 120px;
    }

    .modal {
        padding: 12px;
    }

    .modal-body {
        padding: 15px;
    }

}