* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f8fc;
    --panel: #ffffff;
    --panel-soft: #f8fbff;

    --text: #17233c;
    --muted: #7a879e;

    --blue: #3478f6;
    --blue-dark: #2163d8;
    --blue-soft: #eaf2ff;
    --blue-pale: #f3f7ff;

    --yellow: #ffc94a;
    --yellow-soft: #fff7dc;

    --green: #29a86b;
    --green-soft: #eaf8f1;

    --red: #df5260;

    --border: #e6edf6;

    --shadow:
        0 10px 30px rgba(40, 77, 130, .06);

    --shadow-hover:
        0 14px 35px rgba(40, 77, 130, .10);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

button,
input {
    font: inherit;
}

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

.hidden {
    display: none !important;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-screen {
    min-height: 100vh;

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

    padding: 30px;

    position: relative;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(255, 201, 74, .26),
            transparent 27%
        ),
        radial-gradient(
            circle at 85% 75%,
            rgba(52, 120, 246, .20),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            #f9fbff,
            #edf4ff
        );
}

.login-screen::before {
    content: "";

    position: absolute;
    width: 340px;
    height: 340px;

    left: -120px;
    bottom: -150px;

    border-radius: 50%;

    background:
        rgba(52, 120, 246, .08);
}

.login-screen::after {
    content: "";

    position: absolute;
    width: 280px;
    height: 280px;

    right: -100px;
    top: -110px;

    border-radius: 50%;

    background:
        rgba(255, 201, 74, .15);
}

.login-card {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 430px;

    padding: 42px 42px 36px;

    border: 1px solid rgba(255,255,255,.85);
    border-radius: 26px;

    background:
        rgba(255,255,255,.94);

    backdrop-filter: blur(20px);

    box-shadow:
        0 30px 70px rgba(48, 83, 135, .14);
}

.brand-mark {
    width: 58px;
    height: 58px;

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

    margin-bottom: 25px;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            #6099ff
        );

    color: white;

    font-weight: 800;
    font-size: 28px;

    box-shadow:
        0 10px 24px rgba(52,120,246,.24);
}

.brand-mark::after {
    content: "";

    position: absolute;
}

.brand-mark.small {
    width: 42px;
    height: 42px;

    min-width: 42px;

    margin: 0;

    border-radius: 13px;

    font-size: 20px;
}

.login-card h1 {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 30px;
    letter-spacing: -.02em;
}

.login-subtitle {
    margin: 0 0 29px;

    color: var(--muted);

    font-size: 14px;
}

.login-card label {
    display: block;

    margin-bottom: 17px;

    color: #536078;

    font-size: 12px;
    font-weight: 650;
}

.login-card input {
    display: block;

    width: 100%;

    margin-top: 8px;
    padding: 14px 15px;

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

    background: #f9fbfe;
    color: var(--text);

    outline: none;

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

.login-card input:hover {
    background: white;
}

.login-card input:focus {
    background: white;

    border-color: #83adff;

    box-shadow:
        0 0 0 4px rgba(52,120,246,.09);
}

.login-card button {
    width: 100%;

    margin-top: 3px;
    padding: 14px 16px;

    border: none;
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            #5a94ff
        );

    color: white;

    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 10px 22px rgba(52,120,246,.19);
}

.login-card button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 13px 28px rgba(52,120,246,.26);
}

.login-card button:disabled {
    opacity: .7;
    cursor: default;
    transform: none;
}

.error-message {
    min-height: 20px;

    margin: -3px 0 12px;

    color: var(--red);

    font-size: 12px;
}

.login-footer {
    margin-top: 25px;

    text-align: center;

    color: #9ba6b8;

    font-size: 11px;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    min-height: 100vh;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    z-index: 20;

    width: 250px;

    display: flex;
    flex-direction: column;

    padding: 22px 16px;

    background: #ffffff;

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

    box-shadow:
        8px 0 30px rgba(56, 85, 130, .025);
}

.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 12px;

    margin: 2px 7px 31px;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand strong {
    color: var(--text);

    font-size: 17px;
    letter-spacing: -.01em;
}

.sidebar-brand span {
    margin-top: 1px;

    color: var(--blue);

    font-size: 12px;
    font-weight: 650;
}

nav {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.nav-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 12px 13px;

    border: 1px solid transparent;
    border-radius: 11px;

    background: transparent;

    color: #68758b;

    text-align: left;

    cursor: pointer;
}

.nav-item span {
    width: 22px;

    text-align: center;

    color: #8ba2c5;

    font-size: 17px;
}

.nav-item:hover {
    background: var(--blue-pale);

    color: var(--blue-dark);
}

.nav-item.active {
    background:
        linear-gradient(
            90deg,
            #edf4ff,
            #f5f9ff
        );

    border-color: #dce9ff;

    color: var(--blue-dark);

    font-weight: 650;
}

.nav-item.active span {
    color: var(--blue);
}

.nav-item.disabled {
    opacity: .56;
    cursor: default;
}

.nav-item.disabled:hover {
    background: transparent;
    color: #68758b;
}

.sidebar-bottom {
    margin-top: auto;
}

.api-status {
    display: flex;
    align-items: center;

    gap: 9px;

    padding: 13px 10px;

    color: #8e9aae;

    font-size: 11px;
}

.api-status span:first-child {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #bdc5d0;
}

.api-status span:first-child.online {
    background: var(--green);

    box-shadow:
        0 0 0 4px rgba(41,168,107,.10);
}

.logout {
    width: 100%;

    padding: 11px;

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

    background: #fafbfd;
    color: #758297;

    cursor: pointer;
}

.logout:hover {
    background: #f2f6fb;

    color: var(--blue-dark);
}


/* =========================================================
   CONTENT
   ========================================================= */

.content {
    margin-left: 250px;

    min-height: 100vh;

    padding: 30px 35px 50px;

    background:
        linear-gradient(
            180deg,
            #f7faff 0,
            #f5f8fc 330px
        );
}


/* =========================================================
   TOPBAR
   ========================================================= */

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

    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;

    color: var(--text);

    font-size: 27px;
    letter-spacing: -.025em;
}

.topbar p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 13px;
}

.topbar-right {
    display: flex;
    align-items: center;

    gap: 12px;
}

.date-box {
    color: #8490a3;

    font-size: 12px;
}

.refresh-button {
    padding: 9px 14px;

    border: 1px solid #dae5f4;
    border-radius: 10px;

    background: #ffffff;
    color: var(--blue-dark);

    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 5px 14px rgba(56,90,140,.04);
}

.refresh-button:hover {
    border-color: #bdd2f5;

    background: var(--blue-pale);
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    position: relative;

    min-height: 215px;

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

    padding: 35px 40px;

    border: 1px solid #dfe9f7;
    border-radius: 22px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 91% 20%,
            rgba(255, 201, 74, .48),
            transparent 25%
        ),
        radial-gradient(
            circle at 72% 90%,
            rgba(52,120,246,.14),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #ffffff,
            #edf5ff
        );

    box-shadow: var(--shadow);
}

.hero::after {
    content: "";

    position: absolute;

    width: 230px;
    height: 230px;

    right: -80px;
    bottom: -110px;

    border-radius: 50%;

    border: 35px solid rgba(52,120,246,.05);
}

.hero > * {
    position: relative;
    z-index: 2;
}

.hero-label {
    display: inline-flex;

    padding: 7px 11px;

    margin-bottom: 16px;

    border: 1px solid #d9e6f8;
    border-radius: 50px;

    background: rgba(255,255,255,.75);

    color: var(--blue-dark);

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

    text-transform: uppercase;
    letter-spacing: .07em;
}

.hero h2 {
    margin: 0;

    color: #182745;

    font-size: 30px;
    line-height: 1.14;

    letter-spacing: -.025em;
}

.hero p {
    max-width: 530px;

    margin: 15px 0 0;

    color: #728097;

    line-height: 1.55;

    font-size: 13px;
}

.hero-status {
    min-width: 150px;

    padding: 20px;

    border: 1px solid #dce8f7;
    border-radius: 17px;

    background:
        rgba(255,255,255,.78);

    box-shadow:
        0 10px 25px rgba(40,75,120,.05);
}

.hero-status span,
.hero-status strong {
    display: block;
}

.hero-status span {
    color: #8c98a9;

    font-size: 11px;
}

.hero-status strong {
    margin-top: 6px;

    color: var(--green);

    font-size: 19px;
}


/* =========================================================
   CARDS
   ========================================================= */

.cards {
    display: grid;

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

    gap: 16px;

    margin-top: 18px;
}

.card,
.panel {
    background: var(--panel);

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

    box-shadow: var(--shadow);
}

.card {
    position: relative;

    padding: 21px;

    overflow: hidden;

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

.card::before {
    content: "";

    position: absolute;

    width: 42px;
    height: 5px;

    top: 0;
    left: 21px;

    border-radius: 0 0 5px 5px;

    background: var(--blue);
}

.card:nth-child(2)::before {
    background: var(--yellow);
}

.card:nth-child(3)::before {
    background: #6a9dff;
}

.card:nth-child(4)::before {
    background: #75c3a0;
}

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

    border-color: #d9e5f5;

    box-shadow: var(--shadow-hover);
}

.card-title {
    color: var(--muted);

    font-size: 12px;
}

.card-value {
    margin-top: 12px;

    color: #172746;

    font-size: 31px;
    font-weight: 760;

    letter-spacing: -.035em;
}

.card-note {
    margin-top: 6px;

    color: #a0aabd;

    font-size: 10px;
}


/* =========================================================
   PANELS
   ========================================================= */

.dashboard-grid {
    display: grid;

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

    gap: 18px;

    margin-top: 18px;
}

.panel {
    padding: 23px;
}

.panel-header h3 {
    margin: 0;

    color: var(--text);

    font-size: 16px;
}

.panel-header p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 11px;
}

.competitor-row {
    display: flex;
    align-items: center;

    margin-top: 22px;
    padding: 15px;

    border: 1px solid #e4edf8;
    border-radius: 13px;

    background:
        linear-gradient(
            90deg,
            #f8fbff,
            #ffffff
        );
}

.competitor-logo {
    width: 43px;
    height: 43px;

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

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--yellow),
            #ffda75
        );

    color: #634b08;

    font-weight: 800;
}

.competitor-info {
    flex: 1;

    margin-left: 13px;
}

.competitor-info strong,
.competitor-info span {
    display: block;
}

.competitor-info strong {
    color: var(--text);

    font-size: 13px;
}

.competitor-info span {
    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;
}

.badge {
    padding: 6px 9px;

    border-radius: 50px;

    background: var(--green-soft);
    color: #188354;

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

.coming-row {
    display: flex;
    justify-content: space-between;

    padding: 13px 5px;

    border-bottom: 1px solid #eff3f8;

    color: #657289;

    font-size: 11px;
}

.coming-row span:last-child {
    color: #a2adbe;
}

.empty-state {
    min-height: 190px;

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

    text-align: center;
}

.empty-icon {
    width: 44px;
    height: 44px;

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

    margin-bottom: 12px;

    border-radius: 13px;

    background: var(--blue-soft);
    color: var(--blue);

    font-size: 21px;
}

.empty-state strong {
    color: #34425b;

    font-size: 13px;
}

.empty-state span {
    max-width: 320px;

    margin-top: 7px;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.55;
}

.parser-info {
    display: grid;

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

    gap: 10px;

    margin-top: 25px;
}

.parser-info > div {
    padding: 14px;

    border: 1px solid #e7eef7;
    border-radius: 11px;

    background: #f8fbff;
}

.parser-info span,
.parser-info strong {
    display: block;
}

.parser-info span {
    color: var(--muted);

    font-size: 9px;
}

.parser-info strong {
    margin-top: 7px;

    color: var(--blue-dark);

    font-size: 17px;
}


/* =========================================================
   AI PANEL
   ========================================================= */

.ai-preview {
    display: flex;
    align-items: center;

    gap: 18px;

    margin-top: 18px;

    border-color: #dce8f8;

    background:
        radial-gradient(
            circle at 92% 50%,
            rgba(255,201,74,.14),
            transparent 25%
        ),
        #ffffff;
}

.ai-icon {
    width: 52px;
    height: 52px;

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

    flex: 0 0 auto;

    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            var(--blue),
            #6d9fff
        );

    color: white;

    font-size: 22px;

    box-shadow:
        0 8px 18px rgba(52,120,246,.18);
}

.ai-text {
    flex: 1;
}

.ai-text > span {
    color: #bc8a10;

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

.ai-text h3 {
    margin: 4px 0 5px;

    color: var(--text);

    font-size: 15px;
}

.ai-text p {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
}

.ai-preview button {
    padding: 10px 15px;

    border: 1px solid #e3eaf3;
    border-radius: 9px;

    background: #f7f9fc;
    color: #a1aab7;
}


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

@media (max-width: 1000px) {

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

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

}

@media (max-width: 720px) {

    .sidebar {
        width: 70px;

        padding: 16px 9px;
    }

    .sidebar-brand {
        margin-left: 4px;
    }

    .sidebar-brand > div:last-child {
        display: none;
    }

    .nav-item {
        justify-content: center;

        padding: 12px 8px;

        font-size: 0;
    }

    .nav-item span {
        width: auto;

        font-size: 20px;
    }

    .api-status span:last-child,
    .logout {
        display: none;
    }

    .content {
        margin-left: 70px;

        padding: 18px;
    }

    .topbar {
        align-items: flex-start;
    }

    .date-box {
        display: none;
    }

    .hero {
        min-height: auto;

        padding: 25px;
    }

    .hero-status {
        display: none;
    }

    .hero h2 {
        font-size: 23px;
    }

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

    .ai-preview button {
        display: none;
    }

}

@media (max-width: 480px) {

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

    .topbar h1 {
        font-size: 22px;
    }

    .login-card {
        padding: 31px 24px;
    }

}
