:root {
    --bg: #070a10;
    --panel: #0d121b;
    --panel-2: #111824;
    --border: #202938;
    --text: #f4f7fb;
    --muted: #8994a5;
    --accent: #6d7cff;
    --accent-2: #8f9aff;
    --green: #35d49a;
    --red: #ff647c;
    --yellow: #ffc857;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(109, 124, 255, .12),
            transparent 32%
        ),
        var(--bg);
}

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

button,
input {
    font: inherit;
}

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

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    padding: 28px 18px;
    background: rgba(9, 13, 20, .96);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 21px;
    color: white;
    background: linear-gradient(135deg, var(--accent), #4354e9);
    box-shadow: 0 10px 30px rgba(109,124,255,.25);
}

.brand-mark.large {
    width: 62px;
    height: 62px;
    font-size: 30px;
    border-radius: 18px;
}

.brand-name {
    font-weight: 900;
    letter-spacing: 2px;
}

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

.network-status {
    margin: 32px 8px 18px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: .7px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(53,212,154,.6);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    transition: .2s;
}

.nav-item span {
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,.04);
}

.nav-item.active {
    color: white;
    background: linear-gradient(
        90deg,
        rgba(109,124,255,.18),
        rgba(109,124,255,.05)
    );
    border: 1px solid rgba(109,124,255,.18);
}

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

.account-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--panel-2);
    border: 1px solid var(--border);
    font-weight: 700;
}

.avatar.small {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.account-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.account-info strong {
    font-size: 12px;
}

.account-info span {
    color: var(--accent-2);
    font-size: 9px;
    letter-spacing: 1px;
    margin-top: 3px;
}

.logout {
    color: var(--muted);
    padding: 10px 12px;
    font-size: 12px;
}

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

.topbar {
    height: 74px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 36px;
    background: rgba(7,10,16,.72);
    backdrop-filter: blur(18px);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.network-pill,
.user-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.user-pill {
    color: white;
}

.content {
    max-width: 1450px;
    margin: auto;
    padding: 42px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 30px;
}

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

h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -.8px;
}

.page-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.header-status {
    color: var(--muted);
    font-size: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card,
.panel,
.current-plan {
    background: linear-gradient(
        145deg,
        rgba(17,24,36,.95),
        rgba(10,14,22,.95)
    );
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.stat-card {
    min-height: 155px;
    padding: 22px;
}

.stat-card.highlight {
    border-color: rgba(109,124,255,.35);
    background:
        radial-gradient(
            circle at 90% 0%,
            rgba(109,124,255,.18),
            transparent 55%
        ),
        var(--panel);
}

.stat-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.stat-value {
    margin-top: 17px;
    font-size: 27px;
    font-weight: 800;
}

.stat-unit {
    display: inline-block;
    margin-left: 5px;
    color: var(--accent-2);
    font-size: 11px;
}

.stat-footer {
    margin-top: 12px;
    color: var(--muted);
    font-size: 11px;
}

.online-text {
    color: var(--green);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

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

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

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

.live-badge,
.online-badge {
    color: var(--green) !important;
    font-size: 9px !important;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 6px 9px;
    border: 1px solid rgba(53,212,154,.25);
    background: rgba(53,212,154,.07);
    border-radius: 7px;
}

.chart {
    height: 280px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(
            rgba(255,255,255,.025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,.025) 1px,
            transparent 1px
        );
    background-size: 50px 50px;
}

.chart-line {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.chart-line span {
    width: 2px;
    height: 35%;
    background: linear-gradient(
        transparent,
        var(--accent),
        transparent
    );
    opacity: .5;
}

.chart-line span:nth-child(2) {
    height: 60%;
}

.chart-line span:nth-child(3) {
    height: 42%;
}

.chart-line span:nth-child(4) {
    height: 72%;
}

.chart-line span:nth-child(5) {
    height: 50%;
}

.chart-line span:nth-child(6) {
    height: 68%;
}

.chart-message {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    background: rgba(7,10,16,.25);
}

.hub-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px;
    background: rgba(255,255,255,.025);
    border-radius: 12px;
}

.hub-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: white;
    font-weight: 900;
    background: rgba(109,124,255,.16);
    border: 1px solid rgba(109,124,255,.25);
}

.hub-card strong,
.hub-card span {
    display: block;
}

.hub-card span {
    color: var(--muted);
    font-size: 9px;
    margin-top: 4px;
}

.device-summary,
.hub-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.device-summary div,
.hub-stats div {
    padding: 13px;
    border-radius: 10px;
    background: rgba(255,255,255,.025);
}

.device-summary strong,
.device-summary span,
.hub-stats strong,
.hub-stats span {
    display: block;
}

.device-summary strong,
.hub-stats strong {
    font-size: 18px;
}

.device-summary span,
.hub-stats span {
    color: var(--muted);
    font-size: 10px;
    margin-top: 4px;
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    transition: .2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    color: white;
    background: linear-gradient(135deg, var(--accent), #4c5bea);
    box-shadow: 0 10px 25px rgba(109,124,255,.18);
}

.btn.secondary {
    color: white;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
}

.btn.full {
    width: 100%;
}

.text-link {
    color: var(--accent-2);
    font-size: 11px;
}

.wallet-address {
    padding: 16px;
    border-radius: 10px;
    background: #080c13;
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 12px;
    color: var(--accent-2);
    overflow: hidden;
}

.wallet-address.break {
    word-break: break-all;
    margin-bottom: 12px;
}

.device-overview,
.wallet-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}

.capacity-number {
    font-size: 38px;
    font-weight: 900;
}

.capacity-number span {
    color: var(--muted);
    font-size: 16px;
}

.progress {
    height: 7px;
    margin-top: 20px;
    background: #080c13;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.device-list {
    display: flex;
    flex-direction: column;
}

.device-row {
    display: grid;
    grid-template-columns: 55px 1fr 120px;
    align-items: center;
    gap: 15px;
    padding: 15px 8px;
    border-top: 1px solid rgba(255,255,255,.05);
}

.device-number {
    color: var(--muted);
    font-family: monospace;
}

.device-name strong,
.device-name span {
    display: block;
}

.device-name span {
    color: var(--muted);
    font-size: 10px;
    margin-top: 3px;
}

.device-status {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.device-status.active {
    color: var(--green);
}

.device-status.inactive {
    color: var(--red);
}

.wallet-big {
    margin-top: 20px;
    font-size: 42px;
    font-weight: 900;
}

.wallet-big span {
    color: var(--accent-2);
    font-size: 14px;
}

.wallet-label {
    color: var(--muted);
    margin-top: 10px;
    font-size: 11px;
}

.empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-icon {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    border-radius: 16px;
    color: var(--accent-2);
    background: rgba(109,124,255,.08);
    font-size: 22px;
}

.empty-state strong {
    color: white;
    font-size: 13px;
}

.empty-state span {
    margin-top: 6px;
    font-size: 11px;
}

.current-plan {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.current-plan span,
.current-plan strong {
    display: block;
}

.current-plan span {
    color: var(--muted);
    font-size: 10px;
}

.current-plan strong {
    margin-top: 5px;
    color: var(--accent-2);
}

.plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.plan-card {
    position: relative;
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.plan-card.featured {
    border-color: rgba(109,124,255,.5);
    box-shadow: 0 20px 50px rgba(109,124,255,.08);
}

.plan-card.current {
    opacity: .8;
}

.featured-label {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 8px;
    border-radius: 6px;
    color: var(--accent-2);
    background: rgba(109,124,255,.1);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 1px;
}

.plan-name {
    font-size: 17px;
    font-weight: 900;
}

.plan-price {
    margin: 20px 0 6px;
    font-size: 28px;
    font-weight: 900;
}

.plan-description {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 25px;
}

.plan-feature {
    color: #bbc3d0;
    font-size: 11px;
    padding: 9px 0;
    border-top: 1px solid rgba(255,255,255,.05);
}

.plan-card .btn {
    margin-top: 22px;
}

.login-page {
    min-height: calc(100vh - 74px);
    display: grid;
    place-items: center;
}

.login-card {
    width: 410px;
    max-width: 100%;
    padding: 38px;
    background: rgba(13,18,27,.96);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.login-title {
    text-align: center;
    font-size: 25px;
    font-weight: 900;
}

.login-subtitle {
    margin-top: 7px;
    margin-bottom: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.login-card label {
    display: block;
    margin: 15px 0 7px;
    color: #cbd2dc;
    font-size: 11px;
}

.login-card input {
    width: 100%;
    padding: 13px;
    color: white;
    background: #080c13;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
}

.login-card input:focus {
    border-color: var(--accent);
}

.login-card .btn {
    margin-top: 22px;
}

.login-note {
    margin-top: 20px;
    color: var(--muted);
    text-align: center;
    font-size: 9px;
    line-height: 1.6;
}

.mobile-brand {
    display: none;
}

@media (max-width: 1100px) {

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

    .dashboard-grid,
    .device-overview,
    .wallet-grid {
        grid-template-columns: 1fr;
    }

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

}

@media (max-width: 760px) {

    .sidebar {
        display: none;
    }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        justify-content: space-between;
        padding: 0 18px;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .mobile-brand .brand-mark {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .network-pill {
        display: none;
    }

    .content {
        padding: 25px 16px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 28px;
    }

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

    .device-row {
        grid-template-columns: 40px 1fr 90px;
    }

    .login-card {
        padding: 28px 20px;
    }

}

/* NODEX Firmware Center - formular compact */
#firmware-center form,
.firmware-provision-form {
    max-width: 100%;
}

.firmware-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.firmware-fields input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .firmware-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 550px) {
    .firmware-fields {
        grid-template-columns: 1fr;
    }
}

/* Firmware Center - corectare layout */
.firmware-fields {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100%;
    margin: 16px 0;
    align-items: start;
}

.firmware-fields > div {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0;
    gap: 7px;
}

.firmware-fields > div > label {
    display: block !important;
    width: 100%;
    font-size: 12px;
    white-space: normal;
    line-height: 1.4;
}

.firmware-fields > div > input {
    display: block !important;
    width: 100% !important;
    min-width: 0;
    height: 38px;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 6px;
}

@media (max-width: 1000px) {
    .firmware-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .firmware-fields {
        grid-template-columns: 1fr !important;
    }
}

/* NODEX - ascunde câmpul de licență HUB */
.firmware-fields > div:has(#license-key) {
    display: none !important;
}

.firmware-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 900px) {
    .firmware-fields {
        grid-template-columns: 1fr !important;
    }
}


/* NODEX NANO LARGE CONTROLS V1 */

/* Selectoare AUTO/FIXED și N1-N20 */
#nodex-nano-panel select {
    min-height: 60px !important;
    min-width: 200px;
    padding: 14px 18px !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    border: 2px solid #5275aa !important;
    border-radius: 12px !important;
    cursor: pointer;
}

/* Butoane mari, ușor de apăsat */
#nodex-nano-panel button {
    min-height: 62px;
    padding: 15px 26px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

#nodex-nano-panel button:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

#nodex-nano-panel button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Butoanele de acțiune, în ordinea existentă */
#nodex-nano-panel button {
    border: 2px solid #4778b8;
}

/* Adaptare pentru telefon */
@media (max-width: 650px) {
    #nodex-nano-panel select,
    #nodex-nano-panel button {
        width: 100%;
        min-width: 0;
    }
}


/* NODEX HUB REGISTER LARGE V1 */

/* Câmpul HUB ID */
#hub-register-form input {
    min-height: 64px !important;
    min-width: 280px;
    padding: 16px 20px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    border: 2px solid #5275aa !important;
    border-radius: 12px !important;
}

/* Butonul Înregistrează */
#hub-register-form button {
    min-height: 64px !important;
    padding: 16px 30px !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    border: 2px solid #4778b8;
    border-radius: 12px !important;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

#hub-register-form button:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

#hub-register-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Telefon */
@media (max-width: 650px) {
    #hub-register-form input,
    #hub-register-form button {
        width: 100%;
        min-width: 0;
    }
}

/* Account mining observations */
.hashrate-chart { min-height: 180px; display: flex; align-items: center; color: #a9b9c7; }
.hashrate-chart svg { width: 100%; height: 180px; }
.measurement-note { color: #98aab9; font-size: 13px; margin: 12px 0; }
