* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        Arial,
        sans-serif;

    background: #0b0f14;
    color: #f4f7fa;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    background: #10161d;
    border-right: 1px solid #202934;

    padding: 24px 18px;

    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 38px;
}

.brand-logo {
    width: 45px;
    height: 45px;

    border-radius: 12px;

    background: #10b981;
    color: #07120e;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 900;
}

.brand h2 {
    margin: 0;
    font-size: 18px;
}

.brand span {
    font-size: 12px;
    color: #83909e;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-item {
    border: 0;
    background: transparent;
    color: #8f9ba8;

    text-align: left;

    padding: 13px 15px;

    border-radius: 9px;

    cursor: pointer;
}

.nav-item:hover {
    background: #18212b;
    color: white;
}

.nav-item.active {
    background: #172b26;
    color: #34d399;
}

.gateway-status {
    margin-top: auto;

    border-top: 1px solid #202934;

    padding-top: 20px;

    display: flex;
    align-items: center;
    gap: 10px;
}

.gateway-status strong,
.gateway-status small {
    display: block;
}

.gateway-status small {
    color: #83909e;
    margin-top: 3px;
}

.status-dot {
    width: 10px;
    height: 10px;

    background: #ef4444;
    border-radius: 50%;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.main {
    flex: 1;
    padding: 32px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 28px;
}

.header h1 {
    margin: 0 0 6px;
}

.header p {
    margin: 0;
    color: #7f8b98;
}

.server-badge {
    background: #151d26;
    border: 1px solid #26313d;

    padding: 9px 14px;
    border-radius: 8px;

    font-size: 13px;
    color: #9ba8b5;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 20px;
}

.card {
    background: #111820;

    border: 1px solid #202a35;

    border-radius: 14px;

    padding: 24px;

    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
}

.stat-card span {
    color: #85919e;
}

.stat-card h2 {
    margin:
        12px 0 0;

    font-size: 24px;
}

.grid {
    display: grid;

    grid-template-columns:
        minmax(360px, 0.9fr)
        minmax(380px, 1.1fr);

    gap: 20px;
}

label {
    display: block;

    margin:
        18px 0 7px;

    color: #aab4bf;

    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;

    border: 1px solid #2b3642;

    background: #0c1218;

    color: white;

    border-radius: 8px;

    padding: 12px 13px;

    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #10b981;
}

.primary-btn,
.secondary-btn,
.danger-btn {
    border: 0;
    border-radius: 8px;

    padding: 11px 17px;

    cursor: pointer;

    font-weight: 600;
}

.primary-btn {
    background: #10b981;
    color: #06110d;

    margin-top: 20px;
}

.secondary-btn {
    background: #202a35;
    color: white;
}

.danger-btn {
    background: #3b171b;
    color: #fca5a5;
}

.muted {
    color: #84919e;
    line-height: 1.6;
}

.qr-card {
    text-align: center;
}

.qr-placeholder {
    min-height: 350px;

    border: 1px dashed #33404d;

    border-radius: 12px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 10px;

    color: #81909e;
}

.phone-icon {
    width: 70px;
    height: 70px;

    border-radius: 50%;

    background: #17342c;

    color: #34d399;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 900;

    margin-bottom: 10px;
}

.qr-image {
    max-width: 350px;
    width: 100%;

    background: white;

    padding: 10px;

    border-radius: 12px;
}

.hidden {
    display: none;
}

.qr-status {
    margin-top: 18px;

    color: #93a0ad;
}

.message {
    margin-top: 15px;

    font-size: 13px;

    line-height: 1.5;
}

.message.success {
    color: #34d399;
}

.message.error {
    color: #f87171;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-row {
    border: 1px solid #283440;

    border-radius: 10px;

    padding: 17px;

    margin-top: 12px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-row strong,
.session-row span {
    display: block;
}

.session-row span {
    color: #8794a1;

    margin-top: 5px;

    font-size: 13px;
}

.session-connected {
    color: #34d399 !important;
}

.session-waiting {
    color: #fbbf24 !important;
}

.empty-state {
    padding: 50px 20px;

    text-align: center;

    color: #778492;
}

.form-small {
    max-width: 650px;
}

@media (max-width: 900px) {

    .sidebar {
        width: 200px;
    }

    .grid,
    .cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {

    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
    }

    nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .gateway-status {
        margin-top: 20px;
    }

    .main {
        padding: 20px;
    }

    .header {
        align-items: flex-start;
        gap: 15px;
        flex-direction: column;
    }
}