@font-face {
    font-family: Vazir;
    src: url('/static/fonts/Vazirmatn.ttf') format('truetype');
    font-display: swap
}

* {
    box-sizing: border-box
}

html {
    --bg: #0c0f17;
    --panel: #131722;
    --panel2: #191e2c;
    --line: #272d3d;
    --text: #eef0f8;
    --muted: #8e96ad;
    --accent: #a49aff;
    --solid: #7665ec;
    --soft: #25213b;
    --green: #6fd3b4;
    --red: #f597a7;
    --gold: #eac38a;
    color-scheme: dark
}

html[data-theme=light] {
    --bg: #f6f7fb;
    --panel: #fff;
    --panel2: #f2f3f9;
    --line: #e5e7f0;
    --text: #202335;
    --muted: #7c8297;
    --accent: #6c58db;
    --solid: #705adc;
    --soft: #eeebff;
    --green: #14816b;
    --red: #c14d66;
    --gold: #936d22;
    color-scheme: light
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Vazir, sans-serif;
    font-size: 14px;
    line-height: 1.8
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select,
textarea {
    font: inherit
}

button {
    cursor: pointer
}

button:disabled {
    cursor: wait;
    opacity: .5
}

button,
input,
select,
textarea {
    outline: none
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px
}

input,
select,
textarea {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 12px 14px;
    color: var(--text);
    width: 100%;
    transition: border .2s
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--solid);
    box-shadow: 0 0 0 3px #8875ff14
}

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 19px
}

label input,
label select,
label textarea {
    display: block;
    margin-top: 8px
}

input[type=checkbox] {
    display: inline;
    width: 17px;
    accent-color: var(--solid);
    vertical-align: middle;
    margin-left: 7px
}

h1,
h2,
h3,
p {
    margin: 0
}

h1 {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -1px
}

h2 {
    font-size: 20px
}

h3 {
    font-size: 16px
}

small {
    display: block;
    color: var(--muted);
    font-size: 11px
}

b {
    font-weight: 600
}

.muted {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px
}

.eyebrow {
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-weight: 600
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2
}

.brand b {
    font-size: 14px;
    color: var(--accent);
    font-weight: 400
}

.brand small {
    font-size: 10px;
    margin-top: 7px;
    font-weight: 400
}

.brand-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 42px;
    background: linear-gradient(135deg, #b6adff, #6a55d7);
    color: #fff;
    font-family: sans-serif;
    font-size: 30px;
    border-radius: 12px 12px 4px 12px
}

.shell {
    display: flex;
    min-height: 100vh
}

.shell[hidden],
section[hidden] {
    display: none
}

.sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: 246px;
    background: var(--panel);
    padding: 32px 22px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--line);
    z-index: 20
}

.workspace {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin: 33px 0 25px;
    font-size: 12px
}

.workspace-icon {
    border: 1px solid var(--line);
    border-radius: 9px;
    width: 30px;
    height: 32px;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-family: sans-serif
}

.tiny-dot {
    height: 5px;
    width: 5px;
    background: var(--green);
    border-radius: 50%;
    margin-right: auto
}

.nav-label {
    font-size: 10px;
    color: var(--muted);
    margin: 0 13px 8px
}

nav {
    display: flex;
    flex-direction: column;
    gap: 4px
}

nav button {
    border: 0;
    background: none;
    color: var(--muted);
    text-align: right;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 12px
}

nav button:hover {
    background: var(--panel2);
    color: var(--text)
}

nav button.active {
    background: var(--soft);
    color: var(--accent)
}

nav svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6
}

nav .nav-separator {
    font-size: 10px;
    color: var(--muted);
    padding: 19px 13px 6px
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 30px
}

.safe-box {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 2px 24px;
    border-bottom: 1px solid var(--line);
    font-size: 11px
}

.safe-icon {
    font-size: 26px;
    color: var(--accent)
}

.safe-box small {
    font-size: 9px
}

.profile {
    margin-top: 19px;
    display: flex;
    gap: 11px;
    align-items: center;
    background: none;
    border: 0;
    color: var(--text);
    text-align: right;
    width: 100%;
    font-size: 12px
}

.profile>span:last-child {
    margin-right: auto;
    color: var(--muted)
}

.avatar {
    display: grid;
    place-items: center;
    height: 37px;
    width: 37px;
    background: var(--soft);
    border-radius: 12px;
    color: var(--accent);
    font-size: 14px
}

.avatar.small {
    height: 31px;
    width: 31px;
    border-radius: 10px
}

.main {
    margin-right: 246px;
    flex: 1;
    min-width: 0
}

.topbar {
    height: 83px;
    padding: 0 40px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.breadcrumb {
    font-size: 11px;
    color: var(--muted)
}

.breadcrumb span {
    margin: 0 12px;
    color: var(--line)
}

.breadcrumb b {
    color: var(--text)
}

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

.environment {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 10px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px
}

.environment i {
    height: 5px;
    width: 5px;
    background: var(--green);
    border-radius: 100%
}

.icon-button {
    background: none;
    border: 0;
    color: var(--muted);
    height: 34px;
    min-width: 34px;
    font-size: 20px;
    border-radius: 8px
}

.icon-button:hover {
    background: var(--panel2);
    color: var(--text)
}

.mobile-menu {
    display: none
}

.content {
    padding: 36px 40px 20px;
    max-width: 1540px;
    margin: auto
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 31px
}

.button {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 16px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    display: inline-flex;
    gap: 12px;
    align-items: center;
    justify-content: center
}

.button.primary {
    background: var(--solid);
    border-color: var(--solid);
    color: white;
    box-shadow: 0 4px 20px #7665ec20
}

.button.danger {
    color: var(--red)
}

.button:hover {
    filter: brightness(1.1)
}

.button.small {
    padding: 5px 10px;
    font-size: 10px
}

.button.wide {
    width: 100%;
    padding: 13px;
    justify-content: space-between
}

.row {
    display: flex;
    align-items: center;
    gap: 10px
}

.stack {
    display: grid;
    gap: 20px
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px
}

.metric,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 15px
}

.metric {
    padding: 22px;
    position: relative;
    overflow: hidden
}

.metric .metric-label {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 19px
}

.metric-icon {
    border: 1px solid var(--line);
    border-radius: 9px;
    display: grid;
    place-items: center;
    height: 31px;
    width: 31px;
    color: var(--accent)
}

.metric strong {
    display: block;
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -.5px
}

.metric .unit {
    font-size: 10px;
    color: var(--muted);
    font-weight: 400;
    margin-right: 6px
}

.metric-footer {
    margin-top: 13px;
    font-size: 10px;
    color: var(--muted)
}

.metric-footer .dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--green);
    margin-left: 4px
}

.grid-main {
    display: grid;
    grid-template-columns: 1.85fr 1fr;
    gap: 20px;
    margin-top: 22px
}

.panel {
    padding: 24px;
    min-width: 0
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 25px
}

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

.panel-head h2 {
    font-size: 14px
}

.badge {
    padding: 4px 9px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--panel2);
    border-radius: 6px;
    font-size: 9px;
    white-space: nowrap;
    display: inline-block
}

.badge.green {
    color: var(--green);
    background: #51b99310;
    border-color: #51b99325
}

.badge.purple {
    color: var(--accent);
    background: var(--soft);
    border-color: transparent
}

.badge.red {
    color: var(--red);
    background: #f597a710
}

.badge.gold {
    color: var(--gold);
    background: #eac38a10
}

.chart {
    height: 230px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px
}

.chart svg {
    width: 100%;
    height: 100%;
    overflow: visible
}

.chart-legend {
    display: flex;
    gap: 20px;
    font-size: 10px;
    color: var(--muted)
}

.legend-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 3px;
    margin-left: 6px
}

.legend-dot.cost {
    background: var(--green)
}

.provider-status {
    padding: 14px 0;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid var(--line)
}

.provider-status:last-child {
    border-bottom: 0
}

.provider-logo {
    height: 36px;
    width: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--panel2);
    font-family: sans-serif;
    font-size: 15px;
    color: var(--accent)
}

.provider-status>div:nth-child(2) {
    flex: 1
}

.provider-status h3 {
    font-size: 12px
}

.provider-status small {
    font-size: 9px
}

.panel-summary {
    margin-top: 21px;
    padding: 13px 15px;
    border-radius: 10px;
    background: var(--soft);
    color: var(--accent);
    font-size: 10px;
    display: flex;
    gap: 10px;
    align-items: center
}

.popular-row {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 19px
}

.popular-row:last-child {
    margin: 0
}

.rank {
    color: var(--muted);
    font-size: 11px;
    width: 13px
}

.popular-main {
    flex: 1
}

.popular-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    margin-bottom: 7px
}

.bar-track {
    height: 4px;
    background: var(--panel2);
    border-radius: 3px;
    overflow: hidden
}

.bar-track i {
    display: block;
    height: 100%;
    background: var(--solid);
    border-radius: 3px
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px
}

.action-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--text);
    text-align: right
}

.action-tile span:first-child {
    font-size: 22px;
    color: var(--accent)
}

.action-tile b {
    font-size: 11px;
    display: block
}

.action-tile small {
    font-size: 9px;
    margin-top: 3px
}

.page-footer {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    padding-top: 20px;
    margin-top: 35px
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 650px;
    font-size: 11px;
    text-align: right
}

th {
    font-weight: 500;
    color: var(--muted);
    background: var(--panel2);
    padding: 13px 17px;
    white-space: nowrap
}

td {
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle
}

tr:last-child td {
    border-bottom: 0
}

.ltr {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
    font-family: Vazir, sans-serif;
    max-width: 300px;
    overflow-wrap: anywhere
}

.table-name {
    font-size: 12px
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    min-height: 210px;
    padding: 30px;
    color: var(--muted)
}

.empty .empty-icon {
    height: 55px;
    width: 55px;
    border-radius: 17px;
    background: var(--soft);
    color: var(--accent);
    font-size: 27px;
    display: grid;
    place-items: center;
    margin-bottom: 6px
}

.empty h3 {
    color: var(--text);
    font-size: 14px
}

.empty p {
    font-size: 11px;
    max-width: 380px
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px
}

.form-grid .full {
    grid-column: 1/-1
}

.hint {
    font-size: 11px;
    background: var(--soft);
    border: 1px solid #8e7bff25;
    color: var(--accent);
    border-radius: 11px;
    padding: 13px 16px;
    margin: 16px 0;
    line-height: 2
}

.form-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 12px
}

.details-list {
    display: grid;
    gap: 13px;
    font-size: 12px
}

.details-list>div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px
}

.details-list span {
    color: var(--muted)
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px
}

.toolbar input {
    max-width: 340px;
    font-size: 12px
}

.toolbar select {
    max-width: 150px;
    padding: 9px
}

.skeleton {
    background: linear-gradient(100deg, var(--panel2), var(--panel), var(--panel2));
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite;
    border: 1px solid var(--line);
    border-radius: 14px;
    min-height: 125px
}

.skeleton.large {
    height: 300px;
    margin-top: 20px
}

@keyframes shimmer {
    to {
        background-position: -200% 0
    }
}

#toast {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 1000;
    background: var(--panel2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 13px 23px;
    border-radius: 12px;
    box-shadow: 0 8px 40px #0003;
    font-size: 12px;
    display: none;
    max-width: 440px
}

dialog {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 17px;
    width: min(700px, 92vw);
    padding: 25px;
    max-height: 85vh;
    box-shadow: 0 20px 80px #0006
}

dialog::backdrop {
    background: #080c14b0;
    backdrop-filter: blur(6px)
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px
}

.modal-head h2 {
    font-size: 18px
}

pre {
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--bg);
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 11px;
    max-height: 350px;
    overflow: auto
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    direction: ltr
}

.auth-art {
    position: relative;
    overflow: hidden;
    background: #111222;
    padding: 65px;
    direction: rtl;
    display: flex;
    flex-direction: column;
    justify-content: end
}

.auth-art:before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(#ffffff04 1px, transparent 1px), linear-gradient(90deg, #ffffff04 1px, transparent 1px);
    background-size: 55px 55px;
    mask-image: linear-gradient(black, transparent)
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(75px);
    pointer-events: none
}

.orb-one {
    width: 400px;
    height: 400px;
    background: #6654dc55;
    top: 5%;
    left: 8%
}

.orb-two {
    width: 260px;
    height: 260px;
    background: #5586e522;
    top: 40%;
    right: 0
}

.auth-mark {
    position: absolute;
    top: 14%;
    left: 29%;
    font-family: Arial;
    font-size: 260px;
    line-height: 1;
    font-weight: 700;
    background: linear-gradient(135deg, #f1edff, #8570df 55%, #342b62);
    background-clip: text;
    color: transparent;
    transform: rotate(-9deg);
    text-shadow: 0 30px 90px #6654dc33
}

.auth-mark span {
    position: absolute;
    font-size: 100px;
    top: 15%;
    right: -75px;
    color: #ae9dff;
    font-weight: 400
}

.auth-art-copy {
    position: relative;
    margin-bottom: 60px
}

.auth-art h1 {
    color: #fff;
    font-size: 43px;
    line-height: 1.7;
    letter-spacing: -1px;
    margin: 15px 0
}

.auth-art p:last-child {
    color: #979ab9;
    font-size: 13px
}

.art-footer {
    position: relative;
    display: flex;
    justify-content: space-between;
    color: #8f91ae;
    font-family: sans-serif;
    font-size: 10px;
    letter-spacing: 3px;
    direction: ltr
}

.auth-form {
    direction: rtl;
    width: 100%;
    max-width: 510px;
    margin: auto;
    padding: 60px
}

.auth-form .brand {
    margin-bottom: 75px
}

.auth-form h2 {
    font-size: 27px;
    margin-bottom: 10px;
    letter-spacing: -1px
}

.auth-form form {
    margin-top: 30px
}

.fineprint {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    margin-top: 23px
}

.auth-form .eyebrow {
    font-size: 11px;
    letter-spacing: 0
}

.auth-form .muted {
    font-size: 12px
}

@media(min-width:1600px) {
    .auth-form {
        max-width: 590px;
        padding: 60px 75px
    }
}

@media(max-width:1180px) {
    .metrics {
        grid-template-columns: repeat(2, 1fr)
    }

    .content {
        padding: 30px 24px
    }

    .topbar {
        padding: 0 24px
    }

    .grid-main {
        grid-template-columns: 1.5fr 1fr
    }

    .sidebar {
        width: 222px;
        padding: 28px 15px
    }

    .main {
        margin-right: 222px
    }
}

@media(max-width:900px) {
    .grid-main {
        grid-template-columns: 1fr
    }

    .auth-art {
        padding: 38px
    }

    .auth-mark {
        font-size: 210px;
        left: 23%
    }

    .auth-art h1 {
        font-size: 32px
    }

    .auth-form {
        padding: 35px
    }

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

    .form-grid .full {
        grid-column: auto
    }

    .auth-form .brand {
        margin-bottom: 45px
    }
}

@media(max-width:700px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform .2s;
        width: 246px
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: -20px 0 80px #0004
    }

    .main {
        margin-right: 0
    }

    .mobile-menu {
        display: block
    }

    .breadcrumb {
        display: none
    }

    .topbar {
        height: 68px
    }

    .top-actions {
        gap: 12px
    }

    .environment {
        font-size: 9px
    }

    .content {
        padding: 28px 18px
    }

    .page-heading {
        align-items: start
    }

    h1 {
        font-size: 23px
    }

    .page-subtitle {
        max-width: 200px
    }

    .metrics {
        gap: 12px
    }

    .metric {
        padding: 16px
    }

    .metric strong {
        font-size: 23px
    }

    .metric .metric-label {
        font-size: 10px
    }

    .metric-icon {
        height: 26px;
        width: 26px
    }

    .panel {
        padding: 19px
    }

    .actions-grid {
        gap: 8px
    }

    .action-tile {
        padding: 12px;
        gap: 8px
    }

    .page-footer span:first-child {
        font-size: 8px
    }

    .auth-screen {
        grid-template-columns: 1fr
    }

    .auth-art {
        display: none
    }

    .auth-form {
        padding: 35px 28px;
        max-width: 440px
    }

    .auth-form .brand {
        margin-bottom: 60px
    }

    #page-actions .button {
        padding: 8px;
        font-size: 10px
    }

    .row.wrap {
        flex-wrap: wrap
    }

    .toolbar {
        flex-wrap: wrap
    }

    #toast {
        left: 15px;
        right: 15px;
        bottom: 15px
    }

    .auth-form h2 {
        font-size: 25px
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}

.sidebar {
    overflow-y: auto
}

.sidebar-bottom {
    flex-shrink: 0
}
