/* =========================================
   NEXUS BUSINESS INTELLIGENCE
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {

    --background: #f5f6f8;
    --card: #ffffff;

    --border: #e5e7eb;

    --text: #17191c;
    --muted: #858b94;

    --dark: #101214;
    --dark-light: #1d2126;

    --green: #159570;
    --red: #d84c4c;

    --shadow:
        0 8px 30px rgba(0, 0, 0, 0.035);
}

body {

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);

    color: var(--text);
}

button,
input {

    font-family: inherit;
}

button {

    cursor: pointer;
}


/* =========================================
   APP
========================================= */

.app {

    min-height: 100vh;
}


/* =========================================
   SIDEBAR
========================================= */

.sidebar {

    width: 245px;

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    background: var(--dark);

    color: white;

    padding: 24px 15px;

    display: flex;
    flex-direction: column;

    z-index: 100;
}


.brand {

    display: flex;

    align-items: center;

    gap: 11px;

    padding: 0 8px 32px;
}


.brand-logo {

    width: 37px;
    height: 37px;

    border-radius: 10px;

    background: white;

    color: #111;

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: 800;

    font-size: 17px;
}


.brand h2 {

    font-size: 15px;

    letter-spacing: 1px;
}


.brand span {

    display: block;

    font-size: 7px;

    letter-spacing: 1px;

    color: #70767e;

    margin-top: 3px;
}


.menu-section {

    margin-bottom: 18px;
}


.menu-section > p {

    color: #62686f;

    font-size: 9px;

    letter-spacing: 1.6px;

    padding: 0 12px 8px;
}


.menu {

    width: 100%;

    height: 43px;

    border: none;

    background: transparent;

    color: #92979f;

    border-radius: 8px;

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 0 12px;

    font-size: 12px;

    text-align: left;

    transition:
        background .2s,
        color .2s,
        transform .2s;
}


.menu span {

    width: 18px;

    text-align: center;

    font-size: 15px;
}


.menu:hover {

    background: #181b1f;

    color: white;

    transform: translateX(2px);
}


.menu.active {

    background: var(--dark-light);

    color: white;
}


.live-dot {

    width: 6px !important;
    height: 6px;

    border-radius: 50%;

    background: #38d99b;

    margin-left: auto;

    box-shadow:
        0 0 8px rgba(56, 217, 155, .8);
}


.system {

    margin-top: auto;

    background: #181b1f;

    border-radius: 10px;

    padding: 14px;

    display: flex;

    gap: 9px;

    align-items: flex-start;
}


.system-indicator {

    width: 7px;
    height: 7px;

    background: #38d99b;

    border-radius: 50%;

    margin-top: 4px;

    box-shadow:
        0 0 8px rgba(56, 217, 155, .8);
}


.system strong {

    display: block;

    font-size: 9px;
}


.system small {

    display: block;

    color: #71777e;

    font-size: 8px;

    margin-top: 4px;
}


/* =========================================
   MAIN
========================================= */

.main {

    margin-left: 245px;

    min-height: 100vh;
}


/* =========================================
   TOP BAR
========================================= */

.topbar {

    height: 88px;

    background: white;

    border-bottom: 1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 32px;
}


.topbar h1 {

    font-size: 21px;

    font-weight: 700;
}


.topbar p {

    font-size: 11px;

    color: var(--muted);

    margin-top: 5px;
}


.top-actions {

    display: flex;

    align-items: center;

    gap: 9px;
}


.search {

    width: 220px;

    height: 37px;

    border: 1px solid var(--border);

    border-radius: 8px;

    display: flex;

    align-items: center;

    padding: 0 11px;

    gap: 7px;

    color: #9ca1a8;

    background: white;
}


.search input {

    border: none;

    outline: none;

    width: 100%;

    font-size: 10px;
}


.notification {

    width: 37px;
    height: 37px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: white;

    position: relative;

    color: #555b63;
}


.notification b {

    width: 6px;
    height: 6px;

    background: #df5555;

    border-radius: 50%;

    position: absolute;

    top: 8px;
    right: 8px;
}


.date-button {

    height: 37px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: white;

    padding: 0 13px;

    font-size: 10px;

    color: #454a51;
}


/* =========================================
   DASHBOARD
========================================= */

.dashboard {

    padding: 24px 32px;
}


/* =========================================
   LIVE STATUS
========================================= */

.live-status {

    height: 43px;

    border: 1px solid #dfe8e4;

    background: #f8fcfa;

    border-radius: 9px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 14px;

    margin-bottom: 16px;
}


.live-left {

    display: flex;

    align-items: center;

    gap: 9px;
}


.pulse {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #25b981;

    box-shadow:
        0 0 0 5px #dff7ed;
}


.live-left strong {

    font-size: 9px;

    letter-spacing: 1px;

    color: #157d5b;
}


.live-left span:last-child {

    font-size: 9px;

    color: #808a84;
}


#lastUpdated {

    font-size: 9px;

    color: #929a95;
}


/* =========================================
   STATS
========================================= */

.stats {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-bottom: 14px;
}


.stat-card {

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 18px;

    transition:
        transform .2s,
        box-shadow .2s;
}


.stat-card:hover {

    transform: translateY(-2px);

    box-shadow: var(--shadow);
}


.stat-heading {

    display: flex;

    align-items: center;

    justify-content: space-between;
}


.stat-heading > span {

    color: #7e848c;

    font-size: 9px;

    letter-spacing: .7px;
}


.stat-icon {

    width: 31px;
    height: 31px;

    background: #f1f2f4;

    border-radius: 8px;

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: 700;

    font-size: 13px;
}


.stat-card h2 {

    font-size: 25px;

    margin: 13px 0 7px;
}


.growth {

    font-size: 9px;

    font-weight: 600;
}


.growth.positive {

    color: var(--green);
}


.growth.negative {

    color: var(--red);
}


.growth small {

    color: #9ca1a7;

    font-weight: 400;

    margin-left: 5px;
}


/* =========================================
   CARDS
========================================= */

.card {

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 18px;

    box-shadow:
        0 1px 2px rgba(0,0,0,.01);
}


.chart-grid {

    display: grid;

    grid-template-columns:
        2fr 1fr;

    gap: 14px;

    margin-bottom: 14px;
}


.card-title {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;
}


.card-title h3 {

    font-size: 13px;
}


.card-title p {

    color: #969ca3;

    font-size: 9px;

    margin-top: 4px;
}


.card-title button {

    background: white;

    border: 1px solid var(--border);

    border-radius: 6px;

    padding: 6px 9px;

    font-size: 9px;
}


/* =========================================
   CHART
========================================= */

.chart {

    height: 245px;

    display: flex;

    margin-top: 18px;
}


.y-labels {

    width: 38px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    padding-bottom: 25px;

    color: #a0a5ab;

    font-size: 8px;
}


.chart-area {

    flex: 1;

    position: relative;
}


.chart-area svg {

    position: absolute;

    inset: 0;

    width: 100%;

    height: calc(100% - 25px);

    overflow: visible;
}


.grid-line {

    position: absolute;

    left: 0;
    right: 0;

    border-top: 1px dashed #eceef0;
}


.grid-line.one {
    top: 0;
}

.grid-line.two {
    top: 25%;
}

.grid-line.three {
    top: 50%;
}

.grid-line.four {
    top: 75%;
}

.grid-line.five {
    bottom: 25px;
}


.revenue-line {

    fill: none;

    stroke: #252a30;

    stroke-width: 3;

    stroke-linecap: round;

    stroke-linejoin: round;
}


.area {

    fill: url(#areaGradient);
}


.x-labels {

    position: absolute;

    bottom: 0;

    left: 0;
    right: 0;

    display: flex;

    justify-content: space-between;

    color: #999fa6;

    font-size: 8px;
}


/* =========================================
   REGIONS
========================================= */

.regions {

    margin-top: 28px;
}


.region {

    margin-bottom: 24px;
}


.region > div:first-child {

    display: flex;

    justify-content: space-between;

    margin-bottom: 8px;
}


.region span {

    font-size: 10px;

    color: #5f656c;
}


.region strong {

    font-size: 10px;
}


.bar {

    height: 7px;

    background: #edf0f2;

    border-radius: 20px;

    overflow: hidden;
}


.bar i {

    display: block;

    height: 100%;

    background: #252a30;

    border-radius: 20px;

    transition: width .6s ease;
}


/* =========================================
   LOWER GRID
========================================= */

.lower-grid {

    display: grid;

    grid-template-columns:
        1.45fr 1fr;

    gap: 14px;
}


.activity {

    display: flex;

    align-items: center;

    gap: 11px;

    padding: 14px 0;

    border-bottom: 1px solid #f0f1f3;

    animation: slideIn .3s ease;
}


@keyframes slideIn {

    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}


.activity-icon {

    width: 32px;
    height: 32px;

    border-radius: 8px;

    background: #f1f2f4;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 13px;

    font-weight: 700;
}


.activity-info {

    flex: 1;
}


.activity-info strong {

    display: block;

    font-size: 10px;
}


.activity-info small {

    display: block;

    color: #9ca1a7;

    font-size: 8px;

    margin-top: 3px;
}


.activity > b {

    font-size: 9px;
}


.live-badge {

    color: #148761;

    font-size: 8px;

    display: flex;

    align-items: center;

    gap: 5px;

    font-weight: 700;
}


.live-badge span {

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #27b982;
}


/* =========================================
   ANOMALY
========================================= */

.anomaly {

    background: #fff8f8;

    border: 1px solid #f0dddd;

    border-radius: 11px;

    padding: 17px;

    margin-bottom: 14px;
}


.anomaly-title {

    display: flex;

    gap: 10px;

    align-items: center;
}


.warning {

    width: 33px;
    height: 33px;

    border-radius: 8px;

    background: #fce5e5;

    color: #d54b4b;

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: 800;
}


.anomaly-title span {

    font-size: 8px;

    letter-spacing: 1px;

    color: #c14b4b;

    font-weight: 700;
}


.anomaly-title h3 {

    font-size: 11px;

    margin-top: 3px;
}


.anomaly-values {

    display: flex;

    gap: 35px;

    margin: 19px 0;
}


.anomaly-values small {

    display: block;

    color: #999da2;

    font-size: 8px;
}


.anomaly-values strong {

    display: block;

    font-size: 14px;

    margin-top: 3px;
}


.red {

    color: #ce4a4a;
}


.anomaly button {

    background: transparent;

    border: none;

    color: #b64343;

    font-size: 9px;

    font-weight: 600;
}


/* =========================================
   AI CARD
========================================= */

.ai-card {

    background: #111416;

    color: white;

    border-radius: 11px;

    padding: 19px;
}


.ai-label {

    color: #a7adb4;

    font-size: 8px;

    letter-spacing: 1.2px;
}


.ai-card h3 {

    font-size: 14px;

    margin: 17px 0 8px;
}


.ai-card p {

    color: #9399a0;

    font-size: 9px;

    line-height: 1.7;
}


.ai-card p strong {

    color: #dce0e3;
}


.recommendation {

    border-top: 1px solid #292d31;

    margin-top: 17px;

    padding-top: 13px;
}


.recommendation span {

    display: block;

    color: #72787e;

    font-size: 7px;

    letter-spacing: 1px;
}


.recommendation strong {

    display: block;

    color: #d7dbdf;

    font-size: 9px;

    margin-top: 5px;

    line-height: 1.5;
}


/* =========================================
   PAGE HEAD
========================================= */

.page-head {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 18px;
}


.page-head h2 {

    font-size: 17px;
}


.page-head p {

    color: var(--muted);

    font-size: 10px;

    margin-top: 5px;
}


.primary-button {

    background: #171a1e;

    color: white;

    border: none;

    border-radius: 7px;

    padding: 9px 13px;

    font-size: 10px;

    transition: transform .2s;
}


.primary-button:hover {

    transform: translateY(-1px);
}


/* =========================================
   ANALYTICS
========================================= */

.analytics-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 14px;

    margin-bottom: 14px;
}


.metric-box {

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 18px;
}


.metric-box span {

    font-size: 9px;

    color: var(--muted);

    letter-spacing: .6px;
}


.metric-box h3 {

    font-size: 23px;

    margin: 11px 0 5px;
}


.metric-box small {

    color: var(--green);

    font-size: 9px;
}


.table-card {

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 18px;

    overflow: hidden;
}


.table {

    width: 100%;

    border-collapse: collapse;

    margin-top: 18px;
}


.table th {

    text-align: left;

    font-size: 8px;

    color: #90969d;

    letter-spacing: .8px;

    padding: 10px;

    background: #f7f8f9;
}


.table td {

    font-size: 10px;

    padding: 13px 10px;

    border-bottom: 1px solid #f0f1f3;
}


.badge {

    display: inline-block;

    padding: 4px 7px;

    border-radius: 5px;

    background: #e9f8f2;

    color: #148761;

    font-size: 8px;

    font-weight: 600;
}


/* =========================================
   LIVE MONITOR
========================================= */

.monitor-layout {

    display: grid;

    grid-template-columns:
        1.7fr 1fr;

    gap: 14px;
}


.connection-card {

    background: #111416;

    color: white;

    border-radius: 11px;

    padding: 22px;

    margin-bottom: 14px;
}


.connection-top {

    display: flex;

    justify-content: space-between;

    align-items: center;
}


.connection {

    display: flex;

    align-items: center;

    gap: 7px;

    color: #4be0aa;

    font-size: 9px;

    font-weight: 700;
}


.connection span {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #38d99b;

    box-shadow:
        0 0 9px #38d99b;
}


.connection-card h2 {

    font-size: 25px;

    margin-top: 20px;
}


.connection-card p {

    color: #858b91;

    font-size: 9px;

    margin-top: 4px;
}


.event-stream {

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 18px;
}


.event {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 14px 0;

    border-bottom: 1px solid #f0f1f3;
}


.event-time {

    color: #a1a6ac;

    font-size: 8px;

    width: 55px;
}


.event-dot {

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #22272d;
}


.event-content {

    flex: 1;
}


.event-content strong {

    font-size: 10px;

    display: block;
}


.event-content span {

    color: #989da3;

    font-size: 8px;

    display: block;

    margin-top: 3px;
}


.event-value {

    font-size: 9px;

    font-weight: 700;
}


/* =========================================
   AI ANALYST
========================================= */

.ai-panel {

    max-width: 900px;

    margin: auto;
}


.ai-hero {

    background: #111416;

    color: white;

    border-radius: 13px;

    padding: 28px;

    margin-bottom: 14px;
}


.ai-hero-label {

    color: #aab0b6;

    font-size: 8px;

    letter-spacing: 1.5px;
}


.ai-hero h2 {

    font-size: 23px;

    margin-top: 13px;
}


.ai-hero p {

    color: #8e959c;

    font-size: 10px;

    line-height: 1.7;

    max-width: 650px;

    margin-top: 7px;
}


.question-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    margin-top: 20px;
}


.question {

    background: #1c2024;

    border: 1px solid #2b3035;

    color: #cdd1d5;

    border-radius: 8px;

    padding: 11px;

    text-align: left;

    font-size: 9px;

    transition:
        background .2s,
        transform .2s;
}


.question:hover {

    background: #252a30;

    transform: translateY(-2px);
}


.ai-response {

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 20px;
}


.response-label {

    font-size: 8px;

    color: #868c93;

    letter-spacing: 1px;

    font-weight: 700;
}


.ai-response h3 {

    font-size: 15px;

    margin: 12px 0 8px;
}


.ai-response p {

    font-size: 10px;

    color: #666c73;

    line-height: 1.8;
}


.response-action {

    margin-top: 15px;

    background: #f5f6f7;

    border-radius: 7px;

    padding: 12px;
}


.response-action span {

    display: block;

    font-size: 7px;

    color: #8c9298;

    letter-spacing: 1px;
}


.response-action strong {

    display: block;

    font-size: 9px;

    margin-top: 5px;
}


/* =========================================
   REPORTS
========================================= */

.report-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 14px;
}


.report-card {

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 20px;

    transition:
        transform .2s,
        box-shadow .2s;
}


.report-card:hover {

    transform: translateY(-3px);

    box-shadow: var(--shadow);
}


.report-icon {

    width: 38px;
    height: 38px;

    background: #f1f2f4;

    border-radius: 9px;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 16px;

    margin-bottom: 15px;
}


.report-card h3 {

    font-size: 13px;
}


.report-card p {

    color: var(--muted);

    font-size: 9px;

    line-height: 1.6;

    margin: 7px 0 17px;
}


.report-card button {

    width: 100%;

    background: #171a1e;

    color: white;

    border: none;

    border-radius: 6px;

    padding: 9px;

    font-size: 9px;
}


/* =========================================
   SETTINGS
========================================= */

.settings-card {

    max-width: 750px;

    background: white;

    border: 1px solid var(--border);

    border-radius: 11px;

    overflow: hidden;
}


.setting {

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 18px 20px;

    border-bottom: 1px solid #f0f1f3;
}


.setting:last-child {

    border-bottom: none;
}


.setting h3 {

    font-size: 11px;
}


.setting p {

    font-size: 8px;

    color: #969ca2;

    margin-top: 4px;
}


.toggle {

    width: 37px;
    height: 21px;

    border: none;

    border-radius: 20px;

    background: #d8dce0;

    position: relative;

    transition: background .2s;
}


.toggle::after {

    content: "";

    position: absolute;

    width: 15px;
    height: 15px;

    background: white;

    border-radius: 50%;

    left: 3px;
    top: 3px;

    transition: left .2s;
}


.toggle.on {

    background: #20252a;
}


.toggle.on::after {

    left: 19px;
}


/* =========================================
   TOAST
========================================= */

.toast {

    position: fixed;

    right: 25px;
    bottom: 25px;

    background: #111416;

    color: white;

    padding: 12px 16px;

    border-radius: 8px;

    font-size: 10px;

    box-shadow:
        0 10px 30px rgba(0,0,0,.2);

    animation: toastIn .3s ease;

    z-index: 1000;
}


@keyframes toastIn {

    from {

        opacity: 0;

        transform: translateY(10px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}


/* =========================================
   FOOTER
========================================= */

footer {

    display: flex;

    justify-content: space-between;

    color: #a0a5ab;

    font-size: 8px;

    padding: 20px 2px;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1050px) {

    .stats {

        grid-template-columns:
            repeat(2, 1fr);
    }

    .chart-grid,
    .lower-grid,
    .monitor-layout {

        grid-template-columns: 1fr;
    }

    .analytics-grid,
    .report-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }

}


@media (max-width: 700px) {

    .sidebar {

        display: none;
    }

    .main {

        margin-left: 0;
    }

    .topbar {

        padding: 18px;
    }

    .top-actions {

        display: none;
    }

    .dashboard {

        padding: 18px;
    }

    .stats,
    .analytics-grid,
    .report-grid,
    .question-grid {

        grid-template-columns: 1fr;
    }

    .live-left span:last-child {

        display: none;
    }

}