/* ============ Earnice App Styles v2 ============ */
:root {
    --grad-start: #6e8efb;
    --grad-end: #a777e3;
    --grad: linear-gradient(135deg, #6e8efb, #a777e3);
    --sidebar-w: 230px;
    --topbar-h: 56px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    background: #f4f5fa;
    margin: 0;
}

/* Topbar */
.topbar {
    background: var(--grad);
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* Layout */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid #e6e8f0;
    padding-top: 14px;
    flex-shrink: 0;
}
.sidebar a {
    display: block;
    padding: 10px 20px;
    color: #444;
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: .15s;
}
.sidebar a i { margin-right: 8px; }
.sidebar a:hover { background: #f4f5fa; color: #6e8efb; }
.sidebar a.active {
    background: #f0f3ff;
    color: #6e8efb;
    border-left-color: #6e8efb;
}
.sidebar-user { padding: 10px 20px; font-weight: 600; color: #555; border-bottom: 1px solid #eee; margin-bottom: 8px; }

.content { flex: 1; min-width: 0; }

/* Mobile sidebar */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: calc(-1 * var(--sidebar-w));
        height: calc(100vh - var(--topbar-h));
        z-index: 1050;
        transition: left .25s;
        overflow-y: auto;
    }
    .sidebar.open { left: 0; box-shadow: 4px 0 16px rgba(0,0,0,.15); }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: var(--topbar-h) 0 0 0;
        background: rgba(0,0,0,.35);
        z-index: 1045;
    }
    .sidebar-backdrop.show { display: block; }
}

/* Cards */
.card {
    border: none;
    border-radius: .9rem;
    box-shadow: 0 2px 10px rgba(50,50,90,.06);
}
.stat-card { color: #fff; border-radius: .9rem; }
.stat-card .icon { font-size: 1.9rem; opacity: .55; }
.stat-card .value { font-size: 1.25rem; font-weight: 700; }
.bg-grad-1 { background: linear-gradient(135deg, #6e8efb, #4a6cf7); }
.bg-grad-2 { background: linear-gradient(135deg, #a777e3, #8e54e9); }
.bg-grad-3 { background: linear-gradient(135deg, #43cea2, #1898a0); }
.bg-grad-4 { background: linear-gradient(135deg, #f7971e, #f5576c); }

/* Chat */
.chat-box {
    height: 380px;
    overflow-y: auto;
    background: #f8f9fd;
    border: 1px solid #e6e8f0;
    border-radius: .6rem;
    padding: 10px;
}
.chat-msg { margin-bottom: 10px; }
.chat-msg .who { font-weight: 600; color: #4a6cf7; }
.chat-msg .time { font-size: 11px; color: #999; }
.chat-msg .reply-ref {
    border-left: 3px solid #c5cdfb;
    background: #eef1ff;
    border-radius: .3rem;
    padding: 3px 8px;
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}
.chat-msg .btn-reply { font-size: 11px; padding: 0; }

/* Leads */
.leads-box {
    max-height: 420px;
    overflow-y: auto;
}
.lead-item {
    background: #fff;
    border: 1px solid #eef0f7;
    border-radius: .6rem;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.lead-item .payout { font-weight: 700; color: #1a9c6b; }

.app-footer {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 20px 0 10px;
}

.table { font-size: 13px; }
.text-truncate-300 { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Auth pages */
.auth-body {
    background: var(--grad);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
}
.auth-body .brand h1 { color: #fff; font-weight: 700; text-align: center; margin-bottom: 24px; }
.auth-body .card { border-radius: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.auth-body footer { text-align: center; color: #eee; font-size: .85rem; margin-top: 24px; }
