html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: #0f172a;
    color: #e2e8f0;
}

.panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
}

.panel-immediate {
    border: 2px solid #22c55e;
    background: linear-gradient(180deg, #1e293b 0%, #14532d22 100%);
}

.panel-massal {
    border: 2px solid #3b82f6;
    background: linear-gradient(180deg, #1e293b 0%, #1e3a8a22 100%);
}

.form-control, .form-control:focus, .form-select {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(59,130,246,.25);
}

#host, #newHost {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.02em;
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    padding: 0;
}

.password-toggle:hover {
    color: #e2e8f0;
}

.password-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .icon-hide {
    display: none;
}

.password-toggle.visible .icon-show {
    display: none;
}

.password-toggle.visible .icon-hide {
    display: block;
}

.badge-task { background: #1d4ed8; }
.subtitle, .hint { color: #94a3b8; font-size: 0.9rem; }
.section-title { font-size: 1rem; font-weight: 600; }

.server-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: .6rem .85rem;
}

.server-item.disabled { opacity: .55; }

.top-nav {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: .5rem 1rem;
    flex-shrink: 0;
}

.top-nav .nav-link {
    color: #94a3b8;
    border-radius: 8px;
    padding: .5rem 1rem;
}

.top-nav .nav-link.active {
    background: #334155;
    color: #fff;
    font-weight: 600;
}

.top-nav .nav-link:hover { color: #e2e8f0; }

.login-wrap {
    max-width: 400px;
    margin: 0 auto;
    padding-top: 8vh;
}

h1 { font-size: 1.35rem; }

/* Full-screen app shell */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    padding: .75rem 1rem 1rem;
    box-sizing: border-box;
    gap: .75rem;
}

.app-header {
    flex-shrink: 0;
}

.app-header h1 {
    font-size: 1.25rem;
    margin-bottom: .15rem;
}

.app-header .subtitle {
    font-size: .85rem;
}

.app-main {
    flex: 1;
    display: flex;
    gap: 1rem;
    min-height: 0;
    overflow: hidden;
}

.app-left {
    flex: 0 1 440px;
    width: 38%;
    min-width: 300px;
    max-width: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: .25rem;
}

.app-left-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.app-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1rem;
}

.log-box {
    background: #020617;
    border: 1px solid #334155;
    border-radius: 8px;
    font-family: ui-monospace, monospace;
    font-size: clamp(0.72rem, 0.8vw + 0.6rem, 0.82rem);
    white-space: pre-wrap;
    word-break: break-word;
    color: #94a3b8;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.log-header {
    flex-shrink: 0;
    margin-bottom: .5rem;
}

/* Scrollbar halus */
.app-left::-webkit-scrollbar,
.log-box::-webkit-scrollbar {
    width: 6px;
}

.app-left::-webkit-scrollbar-thumb,
.log-box::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

/* Tablet */
@media (max-width: 991.98px) {
    html, body {
        overflow: auto;
        height: auto;
    }

    .app-shell {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .app-main {
        flex-direction: column;
        overflow: visible;
    }

    .app-left {
        width: 100%;
        max-width: none;
        flex: none;
        overflow: visible;
    }

    .app-right {
        min-height: 45vh;
        height: 50vh;
    }
}

/* Mobile */
@media (max-width: 575.98px) {
    .app-shell {
        padding: .5rem;
    }

    .top-nav .nav-link {
        padding: .4rem .65rem;
        font-size: .85rem;
    }

    h1, .app-header h1 {
        font-size: 1.1rem;
    }

    .app-right {
        min-height: 40vh;
        height: 45vh;
    }
}

/* Monitor lebar — log lebih dominan */
@media (min-width: 1400px) {
    .app-left {
        flex: 0 1 400px;
        width: 32%;
    }
}

@media (min-width: 1920px) {
    .app-shell {
        padding: 1rem 1.5rem 1.25rem;
    }
}
