/* =========================================
   RESET
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================================
   ROOT
========================================= */

:root {

    --bg:
        #f5f6fa;

    --sidebar:
        #11001f;

    --sidebar-light:
        #1d0731;

    --primary:
        #7c3aed;

    --primary-dark:
        #5b21b6;

    --primary-light:
        #f3e8ff;

    --blue:
        #2563eb;

    --blue-light:
        #eff6ff;

    --green:
        #16a34a;

    --green-light:
        #ecfdf3;

    --text:
        #171321;

    --text-secondary:
        #6b7280;

    --border:
        #e5e7eb;

    --white:
        #ffffff;

    --danger:
        #dc2626;
}


/* =========================================
   BODY
========================================= */

body {

    min-height: 100vh;

    font-family:
        "Inter",
        "Segoe UI",
        Arial,
        sans-serif;

    background:
        var(--bg);

    color:
        var(--text);
}


/* =========================================
   APP SHELL
========================================= */

.app-shell {

    display: flex;

    min-height: 100vh;
}


/* =========================================
   SIDEBAR
========================================= */

.sidebar {

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    width: 260px;

    padding: 28px 18px;

    background:
        linear-gradient(
            180deg,
            #11001f 0%,
            #18042a 100%
        );

    color: white;

    display: flex;

    flex-direction: column;

    z-index: 20;
}


/* =========================================
   BRAND
========================================= */

.brand {

    display: flex;

    align-items: center;

    gap: 12px;

    padding:
        0 10px 30px;
}


.brand-icon {

    width: 45px;
    height: 45px;

    display: grid;

    place-items: center;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #8b5cf6,
            #6d28d9
        );

    font-size: 13px;

    font-weight: 800;

    box-shadow:
        0 8px 25px
        rgba(124, 58, 237, 0.35);
}


.brand h2 {

    font-size: 17px;

    font-weight: 800;

    letter-spacing: -0.02em;
}


.brand span {

    display: block;

    margin-top: 3px;

    color:
        #b8a8c7;

    font-size: 10px;
}


/* =========================================
   SIDEBAR NAV
========================================= */

.sidebar-nav {

    display: flex;

    flex-direction: column;

    gap: 7px;
}


.nav-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 13px 14px;

    border-radius: 11px;

    color:
        #bfb0cc;

    text-decoration: none;

    font-size: 13px;

    font-weight: 600;

    transition:
        0.2s ease;
}


.nav-item:hover {

    color: white;

    background:
        rgba(255, 255, 255, 0.07);
}


.nav-item.active {

    color: white;

    background:
        linear-gradient(
            135deg,
            rgba(124, 58, 237, 0.9),
            rgba(91, 33, 182, 0.9)
        );

    box-shadow:
        0 8px 20px
        rgba(0, 0, 0, 0.15);
}


.nav-icon {

    width: 25px;

    font-size: 17px;

    text-align: center;
}


/* =========================================
   SIDEBAR FOOTER
========================================= */

.sidebar-footer {

    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: auto;

    padding: 15px 12px;

    border:
        1px solid
        rgba(255, 255, 255, 0.07);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.04);
}


.sidebar-footer strong {

    display: block;

    color:
        #eee7f4;

    font-size: 11px;
}


.sidebar-footer span {

    display: block;

    margin-top: 3px;

    color:
        #92829f;

    font-size: 9px;
}


.status-dot {

    width: 9px;
    height: 9px;

    flex-shrink: 0;

    border-radius: 50%;

    background:
        #22c55e;

    box-shadow:
        0 0 0 4px
        rgba(34, 197, 94, 0.12);
}


/* =========================================
   MAIN CONTENT
========================================= */

.main-content {

    width: calc(100% - 260px);

    margin-left: 260px;

    padding:
        40px 45px 30px;
}


/* =========================================
   TOPBAR
========================================= */

.topbar {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 30px;
}


.page-label {

    margin-bottom: 8px;

    color:
        var(--primary);

    font-size: 11px;

    font-weight: 800;

    letter-spacing:
        0.14em;
}


.topbar h1 {

    font-size: 32px;

    line-height: 1.1;

    letter-spacing:
        -0.04em;
}


.page-description {

    margin-top: 8px;

    color:
        var(--text-secondary);

    font-size: 13px;
}


.database-status {

    display: flex;

    align-items: center;

    gap: 8px;

    padding:
        9px 13px;

    border:
        1px solid
        #d1fae5;

    border-radius: 999px;

    background:
        #f0fdf4;

    color:
        #15803d;

    font-size: 11px;

    font-weight: 700;

    white-space: nowrap;
}


.live-dot {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background:
        #22c55e;
}


/* =========================================
   STATS
========================================= */

.stats {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 16px;

    margin-bottom: 22px;
}


.stat-card {

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 18px;

    border:
        1px solid
        var(--border);

    border-radius: 15px;

    background:
        var(--white);

    box-shadow:
        0 5px 18px
        rgba(17, 24, 39, 0.035);
}


.stat-icon {

    width: 44px;
    height: 44px;

    display: grid;

    place-items: center;

    border-radius: 12px;

    font-size: 18px;
}


.stat-icon.purple {

    background:
        var(--primary-light);
}


.stat-icon.blue {

    background:
        var(--blue-light);
}


.stat-icon.green {

    background:
        var(--green-light);
}


.stat-content span {

    display: block;

    color:
        var(--text-secondary);

    font-size: 11px;

    font-weight: 600;
}


.stat-content strong {

    display: block;

    margin-top: 4px;

    font-size: 21px;

    letter-spacing:
        -0.03em;
}


.online-text {

    color:
        var(--green);

    font-size: 17px !important;
}


/* =========================================
   SEARCH PANEL
========================================= */

.search-panel {

    padding: 23px;

    border:
        1px solid
        var(--border);

    border-radius: 17px;

    background:
        var(--white);

    box-shadow:
        0 8px 25px
        rgba(17, 24, 39, 0.045);
}


.search-heading h2 {

    font-size: 17px;

    letter-spacing:
        -0.02em;
}


.search-heading p {

    margin-top: 5px;

    color:
        var(--text-secondary);

    font-size: 12px;
}


/* =========================================
   SEARCH INPUT
========================================= */

.search-wrapper {

    position: relative;

    display: flex;

    align-items: center;

    margin-top: 17px;
}


.search-icon {

    position: absolute;

    left: 17px;

    color:
        #9ca3af;

    font-size: 17px;

    pointer-events: none;

    z-index: 2;
}


.search-wrapper input {

    width: 100%;

    height: 56px;

    padding:
        0 95px 0 48px;

    border:
        1px solid
        #dfe1e7;

    border-radius: 13px;

    outline: none;

    background:
        #fafafa;

    color:
        var(--text);

    font-family: inherit;

    font-size: 14px;

    transition:
        0.2s ease;
}


.search-wrapper input::placeholder {

    color:
        #a1a1aa;
}


.search-wrapper input:focus {

    border-color:
        var(--primary);

    background:
        white;

    box-shadow:
        0 0 0 4px
        rgba(124, 58, 237, 0.09);
}


/* =========================================
   CLEAR BUTTON
========================================= */

.clear-button {

    position: absolute;

    right: 8px;

    height: 40px;

    padding:
        0 14px;

    border: none;

    border-radius: 9px;

    background:
        #f1f1f4;

    color:
        #55565f;

    cursor: pointer;

    font-family: inherit;

    font-size: 11px;

    font-weight: 700;

    transition:
        0.2s ease;
}


.clear-button:hover {

    background:
        #e8e8ed;

    color:
        var(--text);
}


/* =========================================
   SEARCH TIPS
========================================= */

.search-tips {

    display: flex;

    align-items: center;

    gap: 7px;

    margin-top: 11px;

    color:
        var(--text-secondary);

    font-size: 10px;
}


.quick-search {

    padding:
        5px 9px;

    border:
        1px solid
        #e5e7eb;

    border-radius: 7px;

    background:
        #fafafa;

    color:
        #5b21b6;

    cursor: pointer;

    font-family: inherit;

    font-size: 10px;

    font-weight: 700;

    transition:
        0.2s ease;
}


.quick-search:hover {

    border-color:
        #c4b5fd;

    background:
        #f5f3ff;
}


/* =========================================
   RESULTS HEADER
========================================= */

.results-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin:
        30px 0 15px;
}


.results-title-row {

    display: flex;

    align-items: center;

    gap: 10px;
}


.results-header h2 {

    font-size: 18px;

    letter-spacing:
        -0.025em;
}


.results-header p {

    margin-top: 5px;

    color:
        var(--text-secondary);

    font-size: 11px;
}


.result-badge {

    padding:
        5px 9px;

    border-radius: 999px;

    background:
        var(--primary-light);

    color:
        var(--primary-dark);

    font-size: 10px;

    font-weight: 800;
}


/* =========================================
   RESULTS GRID
========================================= */

.results-grid {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}


/* =========================================
   CLIENT CARD
========================================= */

.client-card {

    position: relative;

    display: flex;

    align-items: center;

    gap: 13px;

    min-height: 88px;

    padding: 15px;

    border:
        1px solid
        var(--border);

    border-radius: 14px;

    background:
        var(--white);

    cursor: default;

    overflow: hidden;

    transition:
        0.2s ease;
}


.client-card::before {

    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 3px;

    background:
        var(--primary);

    opacity: 0;

    transition:
        0.2s ease;
}


.client-card:hover {

    border-color:
        #d8ccf5;

    transform:
        translateY(-2px);

    box-shadow:
        0 10px 25px
        rgba(17, 24, 39, 0.07);
}


.client-card:hover::before {

    opacity: 1;
}


/* =========================================
   CLIENT NUMBER
========================================= */

.client-number {

    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: grid;

    place-items: center;

    border-radius: 11px;

    background:
        #f5f3ff;

    color:
        var(--primary);

    font-size: 10px;

    font-weight: 800;
}


/* =========================================
   CLIENT DETAILS
========================================= */

.client-details {

    min-width: 0;

    flex: 1;
}


.client-code {

    display: inline-flex;

    align-items: center;

    margin-bottom: 5px;

    padding:
        3px 7px;

    border-radius: 5px;

    background:
        #f5f3ff;

    color:
        var(--primary-dark);

    font-size: 10px;

    font-weight: 800;

    letter-spacing:
        0.04em;
}


.client-name {

    color:
        var(--text);

    font-size: 13px;

    font-weight: 650;

    line-height: 1.45;

    word-break: break-word;
}


/* =========================================
   ARROW
========================================= */

.client-arrow {

    color:
        #b4b5bd;

    font-size: 16px;

    transition:
        0.2s ease;
}


.client-card:hover .client-arrow {

    color:
        var(--primary);

    transform:
        translateX(3px);
}


/* =========================================
   EMPTY STATE
========================================= */

.empty-state {

    grid-column:
        1 / -1;

    padding:
        60px 20px;

    border:
        1px dashed
        #d9d9df;

    border-radius: 15px;

    background:
        white;

    text-align: center;
}


.empty-icon {

    width: 55px;
    height: 55px;

    margin:
        0 auto 14px;

    display: grid;

    place-items: center;

    border-radius: 16px;

    background:
        #f5f3ff;

    color:
        var(--primary);

    font-size: 22px;
}


.empty-state h3 {

    margin-bottom: 7px;

    font-size: 16px;
}


.empty-state p {

    color:
        var(--text-secondary);

    font-size: 12px;
}


.error-state {

    color:
        var(--danger);
}


/* =========================================
   FOOTER
========================================= */

.footer {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-top: 35px;

    padding:
        18px 2px;

    border-top:
        1px solid
        var(--border);

    color:
        #9ca3af;

    font-size: 10px;
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 1000px) {

    .sidebar {

        width: 220px;
    }

    .main-content {

        width:
            calc(100% - 220px);

        margin-left:
            220px;

        padding:
            30px;
    }

    .results-grid {

        grid-template-columns:
            1fr;
    }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 760px) {

    .sidebar {

        position: relative;

        width: 100%;

        height: auto;

        padding: 18px;

    }

    .app-shell {

        display: block;
    }

    .brand {

        padding-bottom: 15px;
    }

    .sidebar-nav {

        display: none;
    }

    .sidebar-footer {

        display: none;
    }

    .main-content {

        width: 100%;

        margin-left: 0;

        padding:
            25px 15px;
    }

    .topbar {

        flex-direction: column;
    }

    .topbar h1 {

        font-size: 27px;
    }

    .database-status {

        align-self:
            flex-start;
    }

    .stats {

        grid-template-columns:
            1fr;
    }

    .search-panel {

        padding: 17px;
    }

    .search-tips {

        flex-wrap: wrap;
    }

    .results-grid {

        grid-template-columns:
            1fr;
    }

    .footer {

        flex-direction: column;

        align-items: flex-start;

        gap: 5px;
    }

}


/* =========================================
   SMALL MOBILE
========================================= */

@media (max-width: 420px) {

    .main-content {

        padding:
            20px 12px;
    }

    .search-wrapper input {

        height: 52px;

        padding-left: 44px;
    }

    .client-card {

        padding: 13px;
    }

    .client-number {

        width: 36px;
        height: 36px;

        flex-basis: 36px;
    }

}