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

:root {
    --green: #009b4d;
    --green-dark: #008341;
    --green-light: #eaf8f0;
    --green-soft: #dff5e8;

    --red: #ed1c24;
    --red-light: #ffeded;

    --text: #20252b;
    --text-secondary: #68727c;
    --border: #e5e8eb;
    --background: #f6f8f7;
    --white: #ffffff;

    --radius: 10px;
}

body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
   MAIN CONTAINER
========================================================= */

.page-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px 35px 45px;
}


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

.page-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 18px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-header p {
    font-size: 12px;
    color: var(--text-secondary);
}


/* =========================================================
   SEARCH AREA
========================================================= */

.search-area {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.search-box {
    width: 400px;
    height: 42px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 7px;

    display: flex;
    align-items: center;

    padding: 0 13px;

    transition: border-color 0.2s ease,
                box-shadow 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 155, 77, 0.08);
}

.search-box i {
    color: #737c85;
    font-size: 12px;
    margin-right: 9px;
}

.search-box input {
    width: 100%;
    height: 100%;

    border: none;
    outline: none;

    background: transparent;

    font-size: 12px;
    color: var(--text);
}

.search-box input::placeholder {
    color: #9aa1a8;
}

.search-btn {
    height: 42px;

    padding: 0 20px;

    border: none;
    border-radius: 7px;

    background: var(--green);
    color: white;

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

    cursor: pointer;

    transition: background 0.2s ease;
}

.search-btn:hover {
    background: var(--green-dark);
}


/* =========================================================
   CUSTOMER PROFILE
========================================================= */

.customer-card {
    width: 100%;

    background: var(--white);

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

    padding: 21px 25px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 15px;

    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.025);
}

.customer-main {
    display: flex;
    align-items: center;
    gap: 18px;

    min-width: 0;
}

.avatar {
    width: 72px;
    height: 72px;

    min-width: 72px;

    border-radius: 50%;

    background: var(--green-soft);

    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar i {
    font-size: 34px;
    color: var(--green);
}

.customer-info {
    min-width: 0;
}

.customer-info h2 {
    font-size: 21px;
    font-weight: 700;

    color: var(--text);

    margin-bottom: 7px;
}

.phone {
    display: flex;
    align-items: center;

    color: var(--green);

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

    margin-bottom: 6px;
}

.phone i {
    color: #606a73;
    font-size: 11px;
    margin-right: 7px;
}

.customer-since {
    display: flex;
    align-items: center;

    color: var(--text-secondary);

    font-size: 11px;
}

.customer-since i {
    font-size: 11px;
    margin-right: 7px;
}


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

.customer-status {
    min-width: 315px;

    padding-left: 24px;

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

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 15px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-item > span:first-child {
    color: #4d565f;
    font-size: 11px;
    font-weight: 600;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 11px;

    border-radius: 20px;

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

.status.active {
    background: var(--green-light);
    color: #008744;
}

.status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #00a653;
}

.last-activity strong {
    font-size: 11px;
    font-weight: 500;
    color: #3f474f;
}


/* =========================================================
   STATISTICS
========================================================= */

.stats-grid {
    width: 100%;

    display: grid;

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

    gap: 15px;

    margin-bottom: 15px;
}

.stat-card {
    min-width: 0;

    background: var(--white);

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

    border-radius: var(--radius);

    overflow: hidden;

    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.025);
}

.stat-content {
    min-height: 125px;

    padding: 20px;

    display: flex;
    align-items: center;

    gap: 16px;

    min-width: 0;
}


/* =========================================================
   STAT ICONS
========================================================= */

.stat-icon,
.network-icon {
    width: 58px;
    height: 58px;

    min-width: 58px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon {
    font-size: 20px;
}

.green-icon {
    background: var(--green-soft);
    color: var(--green);
}

.network-icon {
    font-size: 24px;
    font-weight: 800;
}

.safaricom-icon {
    background: var(--green-soft);
    color: #00a651;
}

.airtel-icon {
    background: var(--red);
    color: white;
}


/* =========================================================
   STAT TEXT
========================================================= */

.stat-title {
    font-size: 11px;
    font-weight: 700;

    line-height: 1.35;

    margin-bottom: 7px;
}

.green-text {
    color: var(--green);
}

.red-text {
    color: var(--red);
}

.stat-value {
    font-size: 22px;
    font-weight: 750;

    line-height: 1.1;

    margin-bottom: 7px;

    white-space: nowrap;
}

.stat-count {
    color: var(--text-secondary);

    font-size: 11px;
}

.stat-count i {
    margin-right: 5px;
    font-size: 10px;
}


/* =========================================================
   STAT FOOTER
========================================================= */

.stat-footer {
    height: 40px;

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

    gap: 5px;

    font-size: 10px;
}

.green-footer {
    background: var(--green-light);
    color: #008744;
}

.red-footer {
    background: var(--red-light);
    color: var(--red);
}


/* =========================================================
   BOTTOM GRID
========================================================= */

.bottom-grid {
    width: 100%;

    display: grid;

    grid-template-columns: minmax(280px, 34%)
                           minmax(0, 66%);

    gap: 15px;

    align-items: stretch;
}


/* =========================================================
   COMMON CARD
========================================================= */

.overview-card,
.transactions-card {
    min-width: 0;

    background: var(--white);

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

    border-radius: var(--radius);

    padding: 21px;

    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.025);
}

.overview-card h3,
.transactions-card h3 {
    font-size: 15px;
    font-weight: 650;

    color: var(--text);

    margin-bottom: 18px;
}


/* =========================================================
   AIRTIME OVERVIEW
========================================================= */

.overview-content {
    display: flex;

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

    gap: 30px;

    min-width: 0;
}


/* =========================================================
   DONUT
========================================================= */

.donut-container {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
}

.donut {
    width: 155px;
    height: 155px;

    border-radius: 50%;

    background:
        conic-gradient(
            #00a651 0deg 230deg,
            #ed1c24 230deg 360deg
        );

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
}

.donut::before {
    content: "";

    width: 108px;
    height: 108px;

    background: white;

    border-radius: 50%;

    position: absolute;
}

.donut-center {
    position: relative;

    z-index: 2;

    display: flex;
    flex-direction: column;

    align-items: center;

    text-align: center;
}

.donut-center span {
    font-size: 10px;
    color: #5f6871;
}

.donut-center strong {
    font-size: 20px;
    font-weight: 750;
}

.donut-center small {
    font-size: 9px;
    color: #7a838c;

    margin-top: 2px;
}


/* =========================================================
   LEGEND
========================================================= */

.legend {
    display: flex;
    flex-direction: column;

    gap: 18px;

    min-width: 0;
}

.legend-item {
    display: flex;

    align-items: flex-start;

    gap: 8px;
}

.legend-dot {
    width: 9px;
    height: 9px;

    min-width: 9px;

    border-radius: 50%;

    margin-top: 3px;
}

.safaricom-dot {
    background: #00a651;
}

.airtel-dot {
    background: #ed1c24;
}

.legend-item div {
    display: flex;
    flex-direction: column;

    gap: 4px;

    min-width: 0;
}

.legend-item strong {
    font-size: 10px;
    font-weight: 650;

    white-space: nowrap;
}

.legend-item span {
    color: var(--text-secondary);

    font-size: 10px;

    white-space: nowrap;
}


/* =========================================================
   INSIGHT
========================================================= */

.insight {
    width: 100%;

    margin-top: 18px;

    padding: 10px 12px;

    border-radius: 7px;

    background: var(--green-light);

    display: flex;
    align-items: center;

    gap: 8px;

    font-size: 10px;

    color: #46534b;

    line-height: 1.4;
}

.insight-icon {
    width: 29px;
    height: 29px;

    min-width: 29px;

    border-radius: 50%;

    background: #d3f1df;

    color: var(--green);

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

    font-size: 11px;
}


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

.table-header {
    display: flex;

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

    gap: 15px;

    margin-bottom: 15px;
}

.table-header h3 {
    margin-bottom: 0;
}

.view-all-btn {
    flex-shrink: 0;

    background: white;

    color: var(--green);

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

    border-radius: 6px;

    padding: 6px 11px;

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

    cursor: pointer;

    transition: all 0.2s ease;
}

.view-all-btn:hover {
    background: var(--green-light);
}


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

.table-wrapper {
    width: 100%;

    max-width: 100%;

    overflow-x: auto;

    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;

    scrollbar-color: #c9d0d5 transparent;

    border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar {
    height: 5px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f2f4f5;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #c9d0d5;
    border-radius: 10px;
}


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

.table-wrapper table {
    width: 100%;

    min-width: 680px;

    border-collapse: collapse;

    table-layout: auto;
}

.table-wrapper thead th {
    text-align: left;

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

    color: #40484f;

    padding: 9px 10px;

    background: #fafbfb;

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

    white-space: nowrap;
}

.table-wrapper tbody td {
    padding: 10px;

    font-size: 12px;

    color: #505961;

    border-bottom: 1px solid #edf0f2;

    white-space: nowrap;

    vertical-align: middle;
}

.table-wrapper tbody tr:last-child td {
    border-bottom: none;
}

.table-wrapper tbody tr:hover {
    background: #fafcfb;
}


/* =========================================================
   NETWORK
========================================================= */

.network {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    white-space: nowrap;
}

.mini-safaricom,
.mini-airtel {
    width: 18px;
    height: 18px;

    min-width: 18px;

    border-radius: 50%;

    display: inline-flex;

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

    color: white;

    font-size: 8px;

    font-weight: 700;
}

.mini-safaricom {
    background: #00a651;
}

.mini-airtel {
    background: #ed1c24;
}


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

.transaction-success,
.transaction-failed {
    display: inline-block;

    padding: 4px 8px;

    border-radius: 5px;

    font-size: 9px;

    font-weight: 600;

    white-space: nowrap;
}

.transaction-success {
    background: #e1f5e8;
    color: #008a43;
}

.transaction-failed {
    background: #ffe9e9;
    color: #ed1c24;
}


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

.pagination {
    display: flex;

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

    gap: 5px;

    margin-top: 16px;
}

.pagination button {
    width: 29px;
    height: 29px;

    border: 1px solid #e0e4e8;

    background: white;

    border-radius: 5px;

    color: #59636d;

    cursor: pointer;

    font-size: 10px;
}

.pagination button:hover {
    background: #f2f5f3;
}

.pagination .active-page {
    background: var(--green);

    border-color: var(--green);

    color: white;
}

.pagination span {
    color: #7b838a;

    font-size: 10px;

    padding: 0 2px;
}


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

@media (max-width: 1200px) {

    .page-container {
        padding: 22px 25px 40px;
    }

    .search-box {
        width: 330px;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .overview-content {
        justify-content: flex-start;
    }
}


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

@media (max-width: 900px) {

    .page-container {
        padding: 20px;
    }

    .page-header {
        flex-direction: column;

        align-items: stretch;

        gap: 15px;
    }

    .search-area {
        width: 100%;
    }

    .search-box {
        width: 100%;
        /* flex: 1; */
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .customer-card {
        flex-direction: column;

        align-items: flex-start;

        gap: 20px;
    }

    .customer-status {
        width: 100%;

        min-width: 0;

        padding-left: 0;
        padding-top: 18px;

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


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

@media (max-width: 600px) {

    body {
        font-size: 12px;
    }

    .page-container {
        padding: 15px 12px 30px;
    }


    /* Header */

    .page-header {
        margin-bottom: 14px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .page-header p {
        font-size: 11px;
    }


    /* Search */

    .search-area {
        flex-direction: column;

        align-items: stretch;

        width: 100%;
    }

    .search-box {
        height: 40px;

        width: 100%;
    }

    .search-btn {
        width: 100%;
        height: 40px;
    }


    /* Customer */

    .customer-card {
        padding: 18px;

        gap: 18px;
    }

    .customer-main {
        width: 100%;

        align-items: center;

        gap: 14px;
    }

    .avatar {
        width: 58px;
        height: 58px;

        min-width: 58px;
    }

    .avatar i {
        font-size: 27px;
    }

    .customer-info h2 {
        font-size: 17px;

        margin-bottom: 5px;
    }

    .phone {
        font-size: 12px;

        margin-bottom: 4px;
    }

    .customer-since {
        font-size: 10px;
    }


    /* Status */

    .customer-status {
        padding-top: 16px;
    }

    .status-item {
        margin-bottom: 12px;
    }


    /* Stats */

    .stats-grid {
        gap: 12px;
    }

    .stat-content {
        padding: 18px;

        min-height: 110px;

        gap: 14px;
    }

    .stat-icon,
    .network-icon {
        width: 50px;
        height: 50px;

        min-width: 50px;
    }

    .stat-icon {
        font-size: 17px;
    }

    .network-icon {
        font-size: 21px;
    }

    .stat-title {
        font-size: 10px;
    }

    .stat-value {
        font-size: 19px;
    }

    .stat-count {
        font-size: 10px;
    }


    /* Bottom cards */

    .overview-card,
    .transactions-card {
        padding: 16px;
    }

    .overview-card h3,
    .transactions-card h3 {
        font-size: 14px;
    }


    /* Overview */

    .overview-content {
        flex-direction: column;

        align-items: center;

        gap: 20px;
    }

    .legend {
        width: 100%;

        align-items: flex-start;
    }

    .insight {
        font-size: 9px;
    }


    /* Transaction header */

    .table-header {
        flex-wrap: wrap;

        align-items: center;
    }

    .view-all-btn {
        font-size: 9px;

        padding: 6px 9px;
    }


    /*
       IMPORTANT:
       Table remains wide enough to be readable,
       but scrolls INSIDE its card.
    */

    .table-wrapper {
        width: 100%;

        overflow-x: auto;
    }

    .table-wrapper table {
        min-width: 680px;

        width: 680px;
    }

    .table-wrapper th {
        font-size: 9px;

        padding: 8px;
    }

    .table-wrapper td {
        font-size: 9px;

        padding: 8px;
    }


    /* Pagination */

    .pagination {
        margin-top: 13px;

        gap: 4px;
    }

    .pagination button {
        width: 27px;
        height: 27px;
    }
}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 380px) {

    .page-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .customer-card {
        padding: 15px;
    }

    .customer-main {
        gap: 11px;
    }

    .avatar {
        width: 52px;
        height: 52px;

        min-width: 52px;
    }

    .customer-info h2 {
        font-size: 15px;
    }

    .stat-content {
        padding: 15px;
    }

    .stat-value {
        font-size: 18px;
    }

    .overview-card,
    .transactions-card {
        padding: 13px;
    }
}

