* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, Arial, sans-serif;
    background: #080c12;
    color: #e8edf5;
}

button,
input {
    font: inherit;
}

.hidden {
    display: none !important;
}


/* LOGIN */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        radial-gradient(
            circle at top,
            #162336 0,
            #0b111b 35%,
            #070a0f 80%
        );
}

.login-card {
    width: 100%;
    max-width: 430px;

    background: rgba(16, 23, 34, 0.96);

    border: 1px solid #243246;
    border-radius: 18px;

    padding: 34px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45);
}

.logo-box {
    display: flex;
    gap: 15px;
    align-items: center;

    margin-bottom: 32px;
}

.logo {
    width: 58px;
    height: 58px;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #2563eb;

    font-weight: 900;
    font-size: 21px;

    box-shadow:
        0 10px 25px rgba(37, 99, 235, 0.25);
}

.logo-box h1 {
    margin: 0;
    font-size: 23px;
}

.logo-box p {
    margin: 5px 0 0;
    color: #8492a6;
    font-size: 13px;
}

label {
    display: block;

    margin: 18px 0 8px;

    color: #aeb9c9;

    font-size: 13px;
    font-weight: 600;
}

input {
    width: 100%;

    padding: 13px 14px;

    background: #0b111a;
    color: white;

    border: 1px solid #263448;
    border-radius: 9px;

    outline: none;
}

input:focus {
    border-color: #3b82f6;

    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.12);
}

.login-card button[type="submit"] {
    width: 100%;

    margin-top: 24px;
    padding: 13px;

    border: 0;
    border-radius: 9px;

    background: #2563eb;
    color: white;

    font-weight: 700;

    cursor: pointer;
}

.login-card button[type="submit"]:hover {
    background: #3273ed;
}

.login-card button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.login-footer {
    margin-top: 28px;

    text-align: center;

    color: #657287;
    font-size: 12px;
}

.alert {
    padding: 12px 14px;

    margin-bottom: 15px;

    background: rgba(220, 38, 38, 0.12);

    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 8px;

    color: #fca5a5;

    font-size: 13px;
}


/* PANEL */

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

.sidebar {
    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    width: 245px;

    padding: 22px 16px;

    background: #0c121b;

    border-right: 1px solid #1c2736;

    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;

    padding: 5px 8px 26px;
}

.small-logo {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #2563eb;

    font-weight: 900;
}

.brand strong,
.brand span {
    display: block;
}

.brand span {
    color: #748299;
    font-size: 12px;
    margin-top: 3px;
}

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

.nav-item {
    width: 100%;

    border: 0;
    border-radius: 8px;

    padding: 11px 13px;

    text-align: left;

    color: #8998ad;
    background: transparent;

    cursor: pointer;
}

.nav-item:hover {
    color: white;
    background: #121b28;
}

.nav-item.active {
    color: white;
    background: #172238;
}

.logout {
    margin-top: auto;

    border: 1px solid #283448;
    border-radius: 8px;

    padding: 11px;

    color: #adb7c6;
    background: transparent;

    cursor: pointer;
}

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

.topbar {
    height: 82px;

    padding: 0 30px;

    border-bottom: 1px solid #1c2736;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(8, 12, 18, 0.94);
}

.topbar h2 {
    margin: 0;
    font-size: 19px;
}

.subtitle {
    display: block;

    color: #66758a;

    margin-top: 4px;
    font-size: 12px;
}

.account {
    display: flex;
    align-items: center;
    gap: 12px;

    text-align: right;
}

.account strong,
.account span {
    display: block;
}

.account strong {
    font-size: 13px;
}

.account span {
    color: #6f7e92;
    margin-top: 3px;
    font-size: 11px;
    text-transform: uppercase;
}

.avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #18243a;
    color: #75a7ff;

    font-weight: 800;
}

.page {
    padding: 28px;
}

.welcome {
    padding: 26px;

    border: 1px solid #20304a;
    border-radius: 14px;

    background:
        linear-gradient(
            125deg,
            #101b2c,
            #0c121b
        );

    margin-bottom: 22px;
}

.welcome > div:first-child {
    color: #72d899;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.online-dot {
    display: inline-block;

    width: 7px;
    height: 7px;

    margin-right: 6px;

    border-radius: 50%;

    background: #22c55e;
}

.welcome h1 {
    margin: 15px 0 6px;

    font-size: 27px;
}

.welcome p {
    margin: 0;

    color: #8190a5;
    font-size: 13px;
}

.stats {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;

    margin-bottom: 22px;
}

.stat-card {
    padding: 19px;

    border: 1px solid #1e2a3b;
    border-radius: 12px;

    background: #0e151f;
}

.stat-card span {
    display: block;

    color: #718096;

    font-size: 12px;
}

.stat-card strong {
    display: block;

    margin: 9px 0 4px;

    font-size: 28px;
}

.stat-card small {
    color: #59687c;
}

.grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.6fr)
        minmax(300px, 0.8fr);

    gap: 18px;
}

.box {
    background: #0e151f;

    border: 1px solid #1e2a3b;
    border-radius: 12px;

    padding: 20px;
}

.box-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}

.box h3 {
    margin: 0 0 5px;
    font-size: 15px;
}

.box p {
    margin: 0;
    color: #65748a;
    font-size: 12px;
}

.primary-button {
    border: 0;
    border-radius: 8px;

    padding: 10px 14px;

    color: white;
    background: #2563eb;

    font-weight: 600;
    cursor: pointer;
}

.empty {
    padding: 35px 10px;

    color: #5f6d81;

    text-align: center;

    border-top: 1px solid #192432;
}

.server-row,
.node-row {
    display: flex;
    justify-content: space-between;

    padding: 13px 5px;

    border-top: 1px solid #192432;
}

.status-online {
    color: #4ade80;
}

.status-offline {
    color: #8b98aa;
}


@media (max-width: 900px) {

    .sidebar {
        width: 190px;
    }

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

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

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

}


@media (max-width: 650px) {

    .sidebar {
        position: static;
        width: 100%;

        min-height: auto;
    }

    .panel {
        display: block;
    }

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

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

}


/* CREATE SERVER MODAL */

.modal {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    background: rgba(0, 0, 0, 0.72);

    backdrop-filter: blur(5px);
}


.modal-card {
    width: 100%;
    max-width: 620px;

    max-height: 90vh;
    overflow-y: auto;

    padding: 25px;

    border: 1px solid #26364d;
    border-radius: 15px;

    background: #0e151f;

    box-shadow:
        0 30px 100px rgba(0,0,0,.6);
}


.modal-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 22px;
}


.modal-header h2 {
    margin: 0;

    font-size: 20px;
}


.modal-header p {
    margin-top: 5px;

    color: #718096;

    font-size: 12px;
}


.modal-close {
    width: 36px;
    height: 36px;

    border: 1px solid #29374c;
    border-radius: 8px;

    background: #121b28;
    color: white;

    font-size: 22px;

    cursor: pointer;
}


select {
    width: 100%;

    padding: 13px 14px;

    background: #0b111a;
    color: white;

    border: 1px solid #263448;
    border-radius: 9px;

    outline: none;
}


select:focus {
    border-color: #3b82f6;
}


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 15px;
}


.modal-submit {
    width: 100%;

    margin-top: 25px;

    padding: 13px;
}


@media(max-width:600px) {

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

}


/* SERVER CONTROL */

.server-clickable {
    cursor: pointer;
    transition: background .15s;
}

.server-clickable:hover {
    background: #131e2c;
}


.server-control-card {
    max-width: 1150px;
    width: 96%;
}


.server-control-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 16px;

    margin-bottom: 15px;

    background: #0a1018;

    border: 1px solid #1e2c40;
    border-radius: 10px;
}


.big-status {
    display: inline-block;

    font-size: 13px;
    font-weight: 800;

    padding: 7px 10px;

    border-radius: 6px;

    color: #94a3b8;
    background: #17202d;
}


.big-status.online {
    color: #4ade80;
    background: rgba(34,197,94,.12);
}


.big-status.installing {
    color: #60a5fa;
    background: rgba(59,130,246,.12);
}


.big-status.crashed,
.big-status.error {
    color: #f87171;
    background: rgba(239,68,68,.12);
}


.control-info {
    margin-top: 8px;

    color: #718096;

    font-size: 12px;
}


.power-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


.control-button {
    padding: 10px 13px;

    border: 1px solid #2c394c;
    border-radius: 7px;

    color: #d2d9e5;
    background: #141d29;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}


.control-button:hover {
    background: #1a2636;
}


.control-button:disabled {
    opacity: .35;
    cursor: not-allowed;
}


.start-button {
    color: #4ade80;

    border-color:
        rgba(34,197,94,.35);
}


.danger-button {
    color: #f87171;

    border-color:
        rgba(239,68,68,.35);
}


.reinstall-button {
    color: #fbbf24;

    border-color:
        rgba(245,158,11,.35);
}


.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 18px 0 8px;

    color: #cbd5e1;

    font-size: 12px;
}


.console-header span {
    margin-left: 8px;

    color: #64748b;
    font-weight: normal;
}


.small-control-button {
    border: 1px solid #263448;
    border-radius: 6px;

    color: #8fa0b7;
    background: #101824;

    padding: 6px 9px;

    cursor: pointer;
}


.server-console {
    width: 100%;
    height: 480px;

    overflow: auto;

    margin: 0;

    padding: 15px;

    border: 1px solid #233046;
    border-radius: 9px;

    background: #05080d;
    color: #c6f6d5;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 12px;
    line-height: 1.45;

    white-space: pre-wrap;
    word-break: break-word;
}


.command-bar {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 10px;
}


.command-bar > span {
    color: #4ade80;

    font-family:
        Consolas,
        monospace;

    font-weight: 800;
}


.command-bar input {
    flex: 1;

    margin: 0;
}


@media(max-width:800px) {

    .server-control-top {
        align-items: stretch;
        flex-direction: column;
    }

    .server-console {
        height: 350px;
    }

}

/* CONSOLE COLORS */

.server-console {
    color: #ffffff;
}

.console-line {
    color: #ffffff;
}

.console-line.warn {
    color: #facc15;
}

.console-line.error {
    color: #f87171;
    font-weight: 600;
}

.console-line.success {
    color: #4ade80;
}

.console-line.dim {
    color: #94a3b8;
}

/* =========================================================
   SERVER TABS / OVERVIEW / SFTP / FASTDL
   ========================================================= */

.server-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 18px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #1f2c3d;
}

.server-tab-button {
    padding: 9px 14px;
    border: 1px solid #28364a;
    border-radius: 8px;
    background: #101824;
    color: #8fa0b7;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.server-tab-button:hover {
    color: #ffffff;
    background: #162235;
}

.server-tab-button.active {
    color: #ffffff;
    background: #2563eb;
    border-color: #3b82f6;
}

.server-tab-panel {
    min-height: 180px;
}

.server-overview-grid,
.integration-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.overview-card,
.integration-card {
    padding: 15px;
    border: 1px solid #213047;
    border-radius: 10px;
    background: #0a111a;
}

.overview-card span,
.integration-card .integration-label {
    display: block;
    margin-bottom: 7px;
    color: #728197;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .45px;
}

.overview-card strong {
    display: block;
    color: #edf4ff;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.overview-wide {
    grid-column: span 2;
}

.integration-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.integration-status.online {
    color: #4ade80;
    background: rgba(34, 197, 94, .12);
}

.integration-status.warning {
    color: #facc15;
    background: rgba(234, 179, 8, .12);
}

.integration-status.offline {
    color: #94a3b8;
    background: rgba(100, 116, 139, .15);
}

.integration-status.error {
    color: #f87171;
    background: rgba(239, 68, 68, .12);
}

.overview-player-box {
    margin-top: 16px;
    border: 1px solid #213047;
    border-radius: 10px;
    overflow: hidden;
    background: #080d14;
}

.overview-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #1d2a3c;
    color: #dce7f7;
    font-size: 12px;
    font-weight: 700;
}

.overview-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-top: 1px solid #131e2b;
}

.overview-player-row:first-child {
    border-top: 0;
}

.overview-player-row strong,
.overview-player-row span {
    display: block;
}

.overview-player-row strong {
    color: #e8eef8;
    font-size: 12px;
}

.overview-player-row span {
    margin-top: 3px;
    color: #6f8097;
    font-size: 10px;
}

.overview-player-score {
    color: #75a7ff;
    font-weight: 800;
}

.empty-player-list {
    padding: 28px 14px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.server-live-meta {
    margin-top: 5px;
    color: #6f8097;
    font-size: 11px;
}

.integration-section {
    margin-bottom: 18px;
    padding: 17px;
    border: 1px solid #213047;
    border-radius: 11px;
    background: #0a111a;
}

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

.integration-section-header h3 {
    margin: 0;
    color: #eef4ff;
    font-size: 14px;
}

.integration-section-header p {
    margin: 4px 0 0;
    color: #718096;
    font-size: 11px;
}

.integration-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.integration-value {
    min-width: 0;
    color: #e6edf7;
    font-size: 12px;
    font-family: Consolas, "Courier New", monospace;
    overflow-wrap: anywhere;
}

.copy-mini-button,
.integration-action-button {
    border: 1px solid #2b3a50;
    border-radius: 7px;
    background: #111b29;
    color: #aebbd0;
    cursor: pointer;
}

.copy-mini-button {
    padding: 5px 8px;
    font-size: 10px;
}

.integration-action-button {
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
}

.integration-action-button:hover,
.copy-mini-button:hover {
    color: #ffffff;
    background: #18263a;
}

.integration-action-button.primary {
    color: #ffffff;
    background: #2563eb;
    border-color: #3b82f6;
}

.integration-action-button.warning {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .35);
}

.integration-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.server-access-message {
    margin-bottom: 14px;
    padding: 11px 13px;
    border-radius: 8px;
    font-size: 12px;
}

.server-access-message.success {
    color: #86efac;
    background: rgba(34, 197, 94, .10);
    border: 1px solid rgba(34, 197, 94, .25);
}

.server-access-message.error {
    color: #fca5a5;
    background: rgba(239, 68, 68, .10);
    border: 1px solid rgba(239, 68, 68, .25);
}

.one-time-credentials {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(245, 158, 11, .38);
    border-radius: 9px;
    background: rgba(245, 158, 11, .08);
}

.one-time-credentials h4 {
    margin: 0 0 10px;
    color: #fbbf24;
    font-size: 12px;
}

.one-time-password {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #314158;
    border-radius: 7px;
    background: #070b11;
    color: #ffffff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
    .server-overview-grid,
    .integration-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .server-overview-grid,
    .integration-grid {
        grid-template-columns: 1fr;
    }

    .overview-wide {
        grid-column: span 1;
    }

    .integration-section-header {
        align-items: stretch;
        flex-direction: column;
    }
}

/* STORED SFTP PASSWORD */

.sftp-password-row {
    align-items: stretch;
}

.credential-password-input {
    min-width: 0;
    flex: 1;
    height: 36px;
    padding: 8px 10px;
    border: 1px solid #28364a;
    border-radius: 7px;
    background: #0a1018;
    color: #eef4ff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    outline: none;
}

.credential-password-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.credential-password-input::placeholder {
    color: #64748b;
    font-family: inherit;
}

.credential-password-hint {
    display: block;
    margin-top: 8px;
    color: #718096;
    font-size: 11px;
    line-height: 1.45;
}

.credential-password-hint.saved {
    color: #4ade80;
}

.credential-password-hint.warning {
    color: #fbbf24;
}


@media (max-width: 620px) {
    .sftp-password-row {
        flex-wrap: wrap;
    }

    .credential-password-input {
        flex-basis: 100%;
    }
}
