:root {
    --black: #080808;
    --black2: #0e0e0e;
    --panel: #111111;
    --panel2: #151515;
    --gold: #d6ad45;
    --gold2: #f0ce72;
    --gold-dark: #8c6a20;
    --white: #f4f1e8;
    --muted: #8f8b80;
    --green: #49c98b;
    --border: rgba(214,173,69,.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--black);
    color: var(--white);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

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

.sidebar {
    width: 250px;
    background: #070707;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
}

.brand {
    height: 86px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gold);
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--gold2);
    font-size: 23px;
    font-weight: 800;
    box-shadow: 0 0 18px rgba(214,173,69,.12);
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
}

.brand-sub {
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-top: 3px;
}

nav {
    padding: 22px 12px;
}

.nav-label {
    color: #625e55;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
    padding: 12px 12px 7px;
}

.nav-item {
    display: flex;
    gap: 12px;
    align-items: center;
    height: 43px;
    padding: 0 13px;
    margin: 3px 0;
    color: #a7a298;
    text-decoration: none;
    border-radius: 7px;
    font-size: 12px;
}

.nav-item span {
    width: 18px;
    text-align: center;
    color: #777269;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(214,173,69,.09);
    color: var(--gold2);
}

.nav-item.active {
    border-left: 2px solid var(--gold);
}

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

.sidebar-bottom {
    margin-top: auto;
    padding: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-bottom strong {
    display: block;
    font-size: 10px;
    color: var(--green);
}

.sidebar-bottom small {
    color: #69665f;
    font-size: 9px;
}

.system-dot,
.node-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(73,201,139,.7);
}

.main {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
}

.topbar {
    height: 86px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(8,8,8,.96);
}

.page-title {
    font-size: 21px;
    font-weight: 700;
}

.page-subtitle {
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 1.3px;
    margin-top: 5px;
}

.top-actions,
.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.live-status {
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    padding: 8px 12px;
    border: 1px solid rgba(73,201,139,.25);
    border-radius: 20px;
}

.live-status span,
.pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 8px var(--green);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg,#8b6a20,#e1bd5c);
    color: #090909;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 900;
}

.admin-user strong {
    display: block;
    font-size: 9px;
    letter-spacing: 1px;
}

.admin-user small {
    color: var(--muted);
    font-size: 9px;
}

.content {
    padding: 30px 32px;
}

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

.welcome h1 {
    font-size: 25px;
    margin: 0 0 6px;
}

.welcome h1 span {
    color: var(--gold2);
}

.welcome p {
    color: var(--muted);
    margin: 0;
    font-size: 12px;
}

.engine-badge {
    border: 1px solid var(--border);
    color: var(--gold2);
    background: rgba(214,173,69,.05);
    padding: 11px 15px;
    border-radius: 6px;
    font-size: 9px;
    letter-spacing: 1px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 15px;
}

.stat-card,
.panel {
    background: linear-gradient(145deg,var(--panel),#0d0d0d);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.stat-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    color: var(--gold);
    font-size: 17px;
    margin-bottom: 18px;
}

.stat-label {
    color: #817d73;
    font-size: 9px;
    letter-spacing: 1.3px;
}

.stat-value {
    color: var(--gold2);
    font-size: 25px;
    font-weight: 700;
    margin: 7px 0;
}

.stat-meta {
    color: var(--muted);
    font-size: 9px;
}

.positive {
    color: var(--green);
}

.grid-main {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.grid-bottom {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.panel {
    padding: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0 0 5px;
    font-size: 14px;
}

.panel-header span {
    color: var(--muted);
    font-size: 9px;
}

.period,
.month {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--gold2);
    padding: 7px 10px;
    font-size: 9px;
    border-radius: 5px;
}

.chart-placeholder {
    height: 190px;
    position: relative;
    border-bottom: 1px solid #25231f;
    background:
        linear-gradient(#181715 1px,transparent 1px),
        linear-gradient(90deg,#181715 1px,transparent 1px);
    background-size: 50px 45px;
}

.chart-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 55%;
    height: 2px;
    background: var(--gold);
    transform: rotate(-3deg);
    box-shadow: 0 0 12px rgba(214,173,69,.5);
}

.chart-labels {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -20px;
    display: flex;
    justify-content: space-between;
    color: #666158;
    font-size: 8px;
}

.node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 18px;
    border-bottom: 1px solid #24221e;
}

.node-info {
    flex: 1;
}

.node-info strong {
    display: block;
    font-size: 10px;
}

.node-info small {
    color: var(--muted);
    font-size: 8px;
}

.online-text {
    color: var(--green);
    font-size: 8px;
    font-weight: 700;
}

.resource {
    margin-top: 15px;
}

.resource > div:first-child {
    display: flex;
    justify-content: space-between;
    color: #777269;
    font-size: 9px;
    margin-bottom: 5px;
}

.resource strong {
    color: var(--white);
}

.bar {
    height: 4px;
    background: #26231d;
    border-radius: 5px;
}

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

.calendar {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    gap: 5px;
}

.weekday {
    text-align: center;
    color: #68645c;
    font-size: 8px;
    padding-bottom: 4px;
}

.day {
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    font-size: 9px;
}

.day.trade {
    background: rgba(73,201,139,.12);
    border: 1px solid rgba(73,201,139,.25);
    color: var(--green);
}

.day.off {
    background: #171613;
    color: #69655d;
}

.calendar-legend {
    margin-top: 15px;
    display: flex;
    gap: 18px;
    color: #777269;
    font-size: 8px;
}

.calendar-legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    margin-right: 4px;
}

.legend-trade {
    background: var(--green);
}

.legend-off {
    background: #4a4740;
}

.activity {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #24221e;
}

.activity:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 6px;
    height: 6px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--gold);
}

.activity strong {
    display: block;
    font-size: 10px;
}

.activity small {
    display: block;
    color: var(--muted);
    font-size: 8px;
    margin-top: 4px;
}

footer {
    padding: 18px 32px;
    border-top: 1px solid var(--border);
    color: #514e47;
    font-size: 8px;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
}

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

    .grid-main,
    .grid-bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 750px) {
    .sidebar {
        width: 70px;
    }

    .brand {
        justify-content: center;
        padding: 0;
    }

    .brand > div:not(.brand-mark),
    .nav-label,
    .nav-item:not(.active)::after,
    .nav-item {
        font-size: 0;
    }

    .nav-item {
        justify-content: center;
    }

    .nav-item span {
        font-size: 16px;
    }

    .sidebar-bottom {
        justify-content: center;
    }

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

    .main {
        margin-left: 70px;
        width: calc(100% - 70px);
    }

    .topbar {
        padding: 0 18px;
    }

    .content {
        padding: 20px 18px;
    }

    .welcome {
        align-items: flex-start;
        gap: 15px;
        flex-direction: column;
    }

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

    footer {
        padding: 15px 18px;
    }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 35%, rgba(214,173,69,.09), transparent 35%),
        #080808;
}

.login-shell {
    width: min(430px, calc(100% - 36px));
}

.login-card {
    background: linear-gradient(145deg, #151515, #0b0b0b);
    border: 1px solid rgba(214,173,69,.28);
    border-radius: 14px;
    padding: 42px 38px;
    box-shadow: 0 25px 80px rgba(0,0,0,.65);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-mark {
    margin: 0 auto 15px;
}

.login-brand .brand-name {
    font-size: 22px;
    letter-spacing: 3px;
}

.login-brand .brand-sub {
    margin-top: 6px;
    font-size: 9px;
}

.login-title {
    color: var(--gold2);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
}

.login-description {
    text-align: center;
    color: var(--muted);
    font-size: 10px;
    margin: 7px 0 30px;
}

#loginForm label {
    display: block;
    color: #8d897f;
    font-size: 9px;
    letter-spacing: 1.3px;
    margin: 16px 0 7px;
}

#loginForm input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border-radius: 6px;
    border: 1px solid #302d27;
    background: #090909;
    color: var(--white);
    outline: none;
    font-size: 13px;
}

#loginForm input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(214,173,69,.08);
}

#loginButton {
    width: 100%;
    height: 46px;
    margin-top: 25px;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: linear-gradient(135deg, #8f6c22, #d9b452);
    color: #080808;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
    cursor: pointer;
}

#loginButton:hover {
    filter: brightness(1.08);
}

#loginButton:disabled {
    opacity: .65;
    cursor: wait;
}

.login-error {
    min-height: 18px;
    margin-top: 13px;
    color: #e17878;
    text-align: center;
    font-size: 10px;
}

.login-footer {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(214,173,69,.12);
    text-align: center;
    color: #625e56;
    font-size: 8px;
    letter-spacing: 1px;
}

.secure-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}
