@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
    --surface: rgba(10, 20, 39, .78);
    --surface2: rgba(18, 30, 55, .96);
    --border: rgba(148, 163, 184, .18);
    --text: #edf5ff;
    --muted: #91a6c9;
    --green: #22c55e;
    --shadow: 0 22px 60px rgba(2, 6, 23, .42);
    --panel-glow: rgba(96, 165, 250, .28);
    --soft-card: rgba(255, 255, 255, .04);
    --accent: #7c3aed;
    --accent-2: #38bdf8;
    --accent-3: #22c55e
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Vazirmatn, system-ui, sans-serif;
    background:
        radial-gradient(circle at 20% 0%, rgba(124, 58, 237, .28), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(56, 189, 248, .22), transparent 30%),
        linear-gradient(180deg, #071225 0%, #0a1327 22%, #040914 100%);
    line-height: 1.6
}

body.light {
    --surface: rgba(255, 255, 255, .92);
    --surface2: #fff;
    --border: rgba(30, 60, 110, .12);
    --text: #122238;
    --muted: #65738b;
    --soft-card: rgba(17, 24, 39, .03);
    background:
        radial-gradient(circle at 20% 0%, rgba(124, 58, 237, .12), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(56, 189, 248, .10), transparent 30%),
        linear-gradient(180deg, #f4f8ff 0%, #edf4ff 100%)
}

.bg-glow {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: .18;
    pointer-events: none
}

.glow-1 {
    background: #7c3aed;
    top: -180px;
    right: -100px
}

.glow-2 {
    background: #00b7ff;
    bottom: -220px;
    left: -120px
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 5%;
    background: rgba(3, 8, 20, .75);
    backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(2, 6, 23, .22)
}

body.light .topbar {
    background: rgba(255, 255, 255, .8)
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 235px
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 23px;
    background-image: url('../assets/icon-192.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 8px 25px #3159c944
}

.brand strong,
.brand-title {
    display: block;
    font-size: 16px;
    margin: 0;
    color: var(--text)
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px
}

.nav-shell {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center
}

nav {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch
}

nav::-webkit-scrollbar {
    display: none
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    cursor: pointer
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 99px
}

.nav,
.icon-btn {
    font: inherit;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: .2s ease
}

.nav {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12px;
    min-height: 40px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.nav::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, .12), rgba(124, 58, 237, .12));
    opacity: 0;
    transition: .2s ease
}

.nav::after {
    content: "";
    position: absolute;
    right: 12px;
    left: 12px;
    bottom: 8px;
    height: 1px;
    background: rgba(255, 255, 255, .45);
    opacity: 0;
    transition: .2s ease
}

.nav:hover::before,
.nav.active::before,
.nav.chat-link:hover::before,
.nav.chat-link.active::before {
    opacity: 1
}

.nav:hover::after,
.nav.active::after,
.nav.chat-link:hover::after,
.nav.chat-link.active::after {
    opacity: 1
}

.nav:hover,
.nav.active,
.nav.chat-link {
    color: white;
    background: rgba(255, 255, 255, .04);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .24), 0 12px 24px rgba(56, 189, 248, .08)
}

.nav.chat-link {
    color: white;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .24), 0 12px 24px rgba(56, 189, 248, .08);
    background: rgba(255, 255, 255, .025)
}

body.light .nav.active,
body.light .nav.chat-link {
    color: #35206c
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center
}

.icon-btn {
    font-size: 21px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08)
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .08);
    transform: translateY(-1px)
}

main {
    width: min(1180px, 90%);
    margin: 28px auto 50px
}

.status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(17, 28, 53, .9), rgba(10, 17, 34, .78));
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    backdrop-filter: blur(14px)
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px
}

.status-item strong {
    color: var(--text);
    font-size: 13px
}

.clock {
    font-size: 22px;
    color: #70a5ff
}

.live {
    font-size: 11px;
    color: #4ade80;
    background: #0c3b2a;
    border: 1px solid #1c8a5a;
    padding: 6px 11px;
    border-radius: 20px
}

.live i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    margin-left: 5px;
    box-shadow: 0 0 12px #22c55e
}

.cards {
    display: block;
    width: 100%
}

.dashboard-spotlight,
.dashboard-grid,
.card-grid {
    display: grid;
    gap: 15px
}

.dashboard-spotlight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 15px
}

.dashboard-grid,
.card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    width: 100%;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(16, 29, 54, .94), rgba(8, 16, 31, .82));
    min-height: 155px;
    transition: .25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 14px 28px rgba(2, 6, 23, .18)
}

.card::before {
    content: "";
    position: absolute;
    inset: -25% auto auto -25%;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(96, 165, 250, .16), transparent 70%);
    pointer-events: none
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, .5);
    box-shadow: 0 22px 35px rgba(15, 23, 42, .26), inset 0 1px 0 rgba(255, 255, 255, .06)
}

body.light .card {
    background: linear-gradient(160deg, rgba(255, 255, 255, .94), rgba(238, 245, 255, .96));
    box-shadow: 0 16px 30px rgba(15, 23, 42, .06), inset 0 1px 0 rgba(255, 255, 255, .8)
}

.orb {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--orb, #173b6a), rgba(255, 255, 255, .08));
    font-size: 20px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 18px rgba(15, 23, 42, .18)
}

.card h3 {
    font-size: 12px;
    margin: 12px 0 5px;
    color: #dce6ff
}

.price {
    font-size: 22px;
    font-weight: 800;
    color: var(--price, #fff);
    letter-spacing: -.02em
}

.unit {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px
}

.gold {
    --price: #fbbf24;
    --orb: #4c3a12
}

.green {
    --price: #22c55e;
    --orb: #0c4d35
}

.blue {
    --price: #38bdf8;
    --orb: #123c59
}

.purple {
    --price: #a78bfa;
    --orb: #3c216b
}

.red {
    --price: #fb7185;
    --orb: #5c1b35
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 34px 2px 14px
}

.section-title h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 800
}

.section-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px
}

.api-state {
    font-size: 11px;
    color: #67e8f9
}

.insights {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 15px
}

.panel {
    background: linear-gradient(180deg, rgba(13, 24, 43, .9), rgba(9, 18, 32, .82));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow)
}

.panel-head {
    display: flex;
    justify-content: space-between
}

.panel h3 {
    font-size: 14px;
    margin: 0
}

.panel-head span {
    font-size: 9px;
    color: #22c55e
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 17px
}

.mini {
    padding: 13px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(120, 150, 210, .08), rgba(120, 150, 210, .03));
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02)
}

.mini span {
    display: block;
    color: var(--muted);
    font-size: 10px
}

.mini b {
    display: block;
    margin-top: 6px;
    font-size: 14px
}

.service {
    margin-top: 15px
}

.service div {
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 11px
}

.service div:last-child {
    border: 0
}

.service span {
    color: var(--muted)
}

.credit {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 13px 18px;
    background: linear-gradient(180deg, rgba(13, 24, 43, .88), rgba(8, 16, 28, .76));
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--muted);
    font-size: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04)
}

.credit b,
footer strong {
    color: #a78bfa
}

.loading {
    text-align: center;
    padding: 40px;
    grid-column: 1/-1;
    color: var(--muted)
}

.error-box {
    grid-column: 1/-1;
    text-align: center;
    line-height: 2;
    color: #fca5a5
}

footer {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10px;
    padding: 20px 5%;
    border-top: 1px solid var(--border)
}

@media(max-width:900px) {
    .topbar {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: space-between;
        position: sticky
    }

    .menu-toggle {
        display: flex;
        order: 1
    }

    .brand {
        order: 2;
        flex: 1;
        min-width: 0
    }

    .actions {
        order: 3;
        margin-right: auto
    }

    .nav-shell {
        order: 4;
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc(100% + 8px);
        width: auto;
        display: none;
        z-index: 30
    }

    .nav-shell.open {
        display: block
    }

    nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background: rgba(8, 18, 35, .95);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 8px;
        gap: 6px;
        box-shadow: var(--shadow)
    }

    .nav {
        width: 100%;
        text-align: right;
        padding: 12px 14px
    }

    .dashboard-grid,
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .insights {
        grid-template-columns: 1fr
    }
}

@media(max-width:560px) {
    main {
        width: 94%
    }

    .brand {
        min-width: auto
    }

    .dashboard-spotlight,
    .dashboard-grid,
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .card {
        padding: 14px;
        min-height: 130px
    }

    .price {
        font-size: 17px
    }

    .status {
        padding: 12px
    }

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

    .credit,
    footer {
        flex-direction: column;
        gap: 8px
    }
}

.mik-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 800;
    transition: .2s
}

.mik-link:hover {
    color: #a78bfa;
    text-decoration: underline
}

.credit {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 18px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px
}

@media(max-width:560px) {
    .credit {
        flex-direction: column
    }
}