/* =========================================================
   
   CLIENTS INDEX PAGE
   Page-specific stylesheet

========================================================= */


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

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}

.page-heading > div {
    min-width: 0;
}

.page-heading h2 {
    margin: 0 0 5px;

    color: #1d3557;

    font-size: 21px;
    line-height: 1.3;

    font-weight: 800;

    letter-spacing: -.25px;
}

.page-heading p {
    margin: 0;

    color: #8b98aa;

    font-size: 11px;
    line-height: 1.5;
}


/* =========================================================
   SUMMARY
========================================================= */

.summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 20px;
}

.summary-card {
    position: relative;

    min-width: 0;

    padding: 18px;

    background: #ffffff;

    border: 1px solid #e3eaf3;

    border-radius: 15px;

    overflow: hidden;

    box-shadow:
        0 7px 24px rgba(31, 52, 80, .035);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.summary-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: linear-gradient(
        90deg,
        #1769e0,
        #6ba6f5,
        transparent
    );

    opacity: .75;
}

.summary-card:hover {
    transform: translateY(-2px);

    border-color: #d6e2f0;

    box-shadow:
        0 12px 30px rgba(31, 52, 80, .075);
}

.summary-label {
    color: #8997aa;

    font-size: 10px;
    line-height: 1.4;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .55px;
}

.summary-value {
    margin-top: 7px;

    color: #273b59;

    font-size: 25px;
    line-height: 1.15;

    font-weight: 900;

    letter-spacing: -.4px;
}

.summary-blue .summary-value {
    color: #1769e0;
}

.summary-green .summary-value {
    color: #287646;
}

.summary-orange .summary-value {
    color: #b7791f;
}

.summary-red .summary-value {
    color: #be123c;
}


/* =========================================================
   FILTER CARD
========================================================= */

.filter-card {
    padding: 17px;

    margin-bottom: 20px;

    background: #ffffff;

    border: 1px solid #e3eaf3;

    border-radius: 15px;

    box-shadow:
        0 6px 22px rgba(31, 52, 80, .03);
}

.filter-title {
    margin-bottom: 12px;

    color: #273b59;

    font-size: 13px;
    line-height: 1.3;

    font-weight: 800;
}

.filter-form {
    display: grid;

    grid-template-columns:
        minmax(220px, 2fr)
        minmax(150px, 1fr)
        auto
        auto;

    gap: 10px;

    align-items: end;
}


/* =========================================================
   FILTER FIELDS
========================================================= */

.field {
    min-width: 0;
}

.field label {
    display: block;

    margin-bottom: 6px;

    color: #8b98aa;

    font-size: 9px;
    line-height: 1.3;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .45px;
}

.field input,
.field select {
    width: 100%;

    height: 40px;
    min-height: 40px;

    padding: 0 11px;

    box-sizing: border-box;

    border: 1px solid #dfe6ef;

    border-radius: 8px;

    background: #ffffff;

    color: #344966;

    outline: none;

    font-family: inherit;

    font-size: 11px;

    line-height: 1.2;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background-color .18s ease;
}

.field input::placeholder {
    color: #a0acba;
}

.field input:focus,
.field select:focus {
    background: #ffffff;

    border-color: #1769e0;

    box-shadow:
        0 0 0 3px rgba(23, 105, 224, .08);
}


/* =========================================================
   SEARCH BUTTON
========================================================= */

.search-btn {
    height: 40px;
    min-height: 40px;

    padding: 0 17px;

    border: 0;

    border-radius: 8px;

    background: #1769e0;

    color: #ffffff;

    font-family: inherit;

    font-size: 10px;

    line-height: 1;

    font-weight: 800;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}

.search-btn:hover {
    background: #0f5bc7;

    transform: translateY(-1px);

    box-shadow:
        0 5px 12px rgba(23, 105, 224, .16);
}

.search-btn:active {
    transform: translateY(0);
}


/* =========================================================
   RESET BUTTON
========================================================= */

.reset-btn {
    height: 40px;
    min-height: 40px;

    display: inline-flex;

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

    box-sizing: border-box;

    padding: 0 14px;

    border: 1px solid #dfe6ef;

    border-radius: 8px;

    background: #ffffff;

    color: #64748b;

    font-family: inherit;

    font-size: 10px;

    line-height: 1;

    font-weight: 800;

    text-decoration: none;

    white-space: nowrap;

    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease;
}

.reset-btn:hover {
    background: #f8fafc;

    border-color: #d5e0ec;

    color: #1769e0;
}


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

.table-card {
    width: 100%;

    background: #ffffff;

    border: 1px solid #e3eaf3;

    border-radius: 15px;

    overflow: hidden;

    box-shadow:
        0 7px 25px rgba(31, 52, 80, .035);
}

.table-header {
    min-height: 58px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 0 19px;

    border-bottom: 1px solid #edf1f6;
}

.table-header h3 {
    margin: 0;

    color: #273b59;

    font-size: 14px;

    line-height: 1.3;

    font-weight: 800;
}

.result-count {
    color: #8997aa;

    font-size: 10px;

    line-height: 1.3;

    white-space: nowrap;
}


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

.table-wrap {
    width: 100%;

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

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;

    scrollbar-color:
        #cbd5e1
        transparent;
}

.table-wrap::-webkit-scrollbar {
    height: 7px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #f8fafc;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 20px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


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

.table-wrap table {
    width: 100%;

    min-width: 1000px;

    border-collapse: collapse;

    border-spacing: 0;

    table-layout: auto;
}


/* TABLE HEADER */

.table-wrap th {
    padding: 12px 14px;

    background: #f8fafc;

    color: #718198;

    font-family: inherit;

    font-size: 9px;

    line-height: 1.3;

    font-weight: 800;

    text-align: left;

    text-transform: uppercase;

    letter-spacing: .5px;

    white-space: nowrap;

    border-bottom: 1px solid #e9eef4;
}


/* TABLE BODY */

.table-wrap td {
    padding: 13px 14px;

    color: #40536a;

    font-family: inherit;

    font-size: 12px;

    line-height: 1.45;

    vertical-align: middle;

    white-space: nowrap;

    border-bottom: 1px solid #edf1f5;
}

.table-wrap tbody tr {
    transition:
        background-color .15s ease;
}

.table-wrap tbody tr:hover {
    background: #fbfdff;
}

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


/* =========================================================
   CLIENT
========================================================= */

.client {
    display: flex;

    align-items: center;

    gap: 9px;

    min-width: 220px;
}

.client-avatar {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;

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

    border-radius: 9px;

    background: #eaf2ff;

    color: #1769e0;

    font-size: 12px;

    line-height: 1;

    font-weight: 900;
}

.client-name {
    display: block;

    max-width: 240px;

    overflow: hidden;

    text-overflow: ellipsis;

    color: #344966;

    font-size: 13px !important;

    line-height: 1.35;

    font-weight: 800;
}

.client-email {
    display: block;

    max-width: 240px;

    margin-top: 3px;

    overflow: hidden;

    text-overflow: ellipsis;

    color: #8b98aa;

    font-size: 10px !important;

    line-height: 1.35;
}


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

.client-mobile {
    display: inline-block;

    color: #536982;

    font-size: 12px !important;

    line-height: 1.4;

    font-weight: 600;

    white-space: nowrap;
}


/* =========================================================
   REGISTERED DATE
========================================================= */

.client-registered {
    display: inline-block;

    color: #64748b;

    font-size: 12px !important;

    line-height: 1.4;

    font-weight: 600;

    white-space: nowrap;
}


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

.badge {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 6px 9px;

    border-radius: 50px;

    font-size: 10px !important;

    line-height: 1;

    font-weight: 800;

    white-space: nowrap;
}

.badge .dot {
    width: 5px;
    height: 5px;

    flex: 0 0 5px;

    border-radius: 50%;

    background: currentColor;
}


/* GREEN */

.badge-green {
    background: #eaf8f0;

    color: #198754;
}


/* ORANGE */

.badge-orange {
    background: #fff5df;

    color: #b36b00;
}


/* RED */

.badge-red {
    background: #fff0f1;

    color: #dc3545;
}


/* BLUE */

.badge-blue {
    background: #eaf3ff;

    color: #1769e0;
}


/* PURPLE */

.badge-purple {
    background: #f0edff;

    color: #7057d8;
}


/* GRAY */

.badge-gray {
    background: #f0f2f5;

    color: #7a8797;
}


/* =========================================================
   ACTION
========================================================= */

.actions {
    display: flex;

    align-items: center;

    gap: 7px;
}

.view-btn {
    display: inline-flex;

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

    min-width: 55px;

    height: 32px;

    padding: 0 11px;

    box-sizing: border-box;

    border: 1px solid #dce6f1;

    border-radius: 8px;

    background: #eaf2ff;

    color: #1769e0;

    font-family: inherit;

    font-size: 11px !important;

    line-height: 1;

    font-weight: 800;

    text-decoration: none;

    white-space: nowrap;

    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.view-btn:hover {
    background: #1769e0;

    border-color: #1769e0;

    color: #ffffff;

    transform: translateY(-1px);
}


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

.empty {
    padding: 60px 20px;

    text-align: center;

    color: #9aa6b6;

    font-size: 12px;

    line-height: 1.5;
}

.empty::before {
    content: "👥";

    display: block;

    margin-bottom: 10px;

    font-size: 26px;
}


/* =========================================================
   PAGINATION
========================================================= */

.pagination-area {
    min-height: 64px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 12px 17px;

    background: #ffffff;

    border-top: 1px solid #edf1f5;

    box-sizing: border-box;
}

.pagination-info {
    flex: 0 0 auto;

    color: #8997aa;

    font-size: 10px;

    line-height: 1.4;

    white-space: nowrap;
}

.pagination-links {
    flex: 0 0 auto;

    display: flex;

    align-items: center;

    justify-content: flex-end;

    min-width: 0;

    gap: 5px;
}


/* =========================================================
   PAGINATION BUTTON
========================================================= */

.pagination-btn {
    width: 34px;
    min-width: 34px;

    height: 34px;
    min-height: 34px;

    display: inline-flex;

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

    box-sizing: border-box;

    margin: 0;
    padding: 0;

    border: 1px solid #dfe6ef;

    border-radius: 8px;

    background: #ffffff;

    color: #64748b;

    font-family: inherit;

    font-size: 11px;

    line-height: 1;

    font-weight: 700;

    text-decoration: none;

    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.pagination-btn:hover {
    background: #f4f8fd;

    border-color: #cfddeb;

    color: #1769e0;

    transform: translateY(-1px);
}

.pagination-btn.active {
    background: #1769e0;

    border-color: #1769e0;

    color: #ffffff;

    font-weight: 800;
}

.pagination-btn.disabled {
    background: #f8fafc;

    border-color: #edf1f5;

    color: #b7c0cb;

    cursor: default;
}

.pagination-btn.disabled:hover {
    background: #f8fafc;

    border-color: #edf1f5;

    color: #b7c0cb;

    transform: none;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .filter-form {
        grid-template-columns:
            1fr 1fr;
    }

}


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

@media (max-width: 700px) {

    .table-wrap table {
        min-width: 900px;
    }

    .table-wrap th {
        padding: 11px 12px;

        font-size: 9px;
    }

    .table-wrap td {
        padding: 12px;

        font-size: 12px;
    }

    .client {
        min-width: 210px;

        gap: 9px;
    }

    .client-avatar {
        width: 35px;
        height: 35px;

        flex-basis: 35px;

        font-size: 11px;
    }

    .client-name {
        font-size: 12px !important;
    }

    .client-email {
        font-size: 10px !important;
    }

    .client-mobile {
        font-size: 11px !important;
    }

    .client-registered {
        font-size: 11px !important;
    }

    .badge {
        font-size: 10px !important;

        padding: 6px 8px;
    }

    .view-btn {
        font-size: 10px !important;

        height: 31px;

        min-width: 52px;

        padding: 0 10px;
    }

}


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

@media (max-width: 600px) {

    .page-heading {
        flex-direction: column;

        align-items: flex-start;

        gap: 12px;
    }

    .page-heading .btn {
        width: 100%;
    }

    .summary-grid {
        grid-template-columns: 1fr;

        gap: 10px;
    }

    .summary-card {
        padding: 16px;

        border-radius: 14px;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-card {
        padding: 15px;
    }

    .table-header {
        min-height: 55px;

        padding: 0 15px;
    }

    .table-header h3 {
        font-size: 13px;
    }

    .result-count {
        font-size: 9px;
    }

    .pagination-area {
        min-height: auto;

        flex-direction: column;

        align-items: flex-start;

        justify-content: center;

        gap: 10px;

        padding: 12px;
    }

    .pagination-info {
        width: 100%;

        font-size: 10px;
    }

    .pagination-links {
        width: 100%;

        justify-content: flex-start;

        overflow-x: auto;

        overflow-y: hidden;

        padding-bottom: 2px;

        scrollbar-width: none;

        -webkit-overflow-scrolling: touch;
    }

    .pagination-links::-webkit-scrollbar {
        display: none;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .summary-card {
        padding: 14px;
    }

    .summary-value {
        font-size: 23px;
    }

    .table-wrap table {
        min-width: 850px;
    }

    .table-wrap th {
        padding: 10px 11px;

        font-size: 8px;
    }

    .table-wrap td {
        padding: 11px;

        font-size: 11px;
    }

    .client {
        min-width: 200px;
    }

    .client-name {
        font-size: 12px !important;
    }

    .client-email {
        font-size: 9px !important;
    }

    .client-mobile,
    .client-registered {
        font-size: 10px !important;
    }

    .badge {
        font-size: 9px !important;

        padding: 6px 8px;
    }

    .view-btn {
        font-size: 10px !important;

        min-width: 50px;

        height: 30px;
    }

    .pagination-links {
        gap: 3px;
    }

    .pagination-btn {
        width: 31px;
        min-width: 31px;

        height: 31px;
        min-height: 31px;

        border-radius: 7px;

        font-size: 10px;
    }

}


/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .summary-card,
    .view-btn,
    .search-btn,
    .pagination-btn {
        transition: none;
    }

    .summary-card:hover,
    .view-btn:hover,
    .search-btn:hover,
    .pagination-btn:hover {
        transform: none;
    }

}