:root {
    --bg: #0d1117;
    --panel: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #2f81f7;
    --danger: #f85149;
}

* { box-sizing: border-box; }

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

#login-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    width: 320px;
}

.login-box h1 {
    font-size: 18px;
    margin: 0 0 20px;
}

.login-box input {
    width: 100%;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.login-box button:disabled { opacity: 0.6; cursor: default; }

.error-text {
    color: var(--danger);
    font-size: 13px;
    margin: -4px 0 12px;
    min-height: 16px;
}

#app-screen {
    display: none;
    height: 100%;
    grid-template-columns: 260px 1fr;
}

#app-screen.visible { display: grid; }

#sidebar {
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#sidebar-header {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#sidebar-header h2 {
    font-size: 14px;
    margin: 0;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#new-session-btn {
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}

#session-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
    gap: 8px;
}

.session-item:hover { background: rgba(255,255,255,0.04); }
.session-item.active { background: rgba(47,129,247,0.15); }

.session-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.session-name[contenteditable="true"] {
    outline: 1px solid var(--accent);
    border-radius: 3px;
    padding: 0 2px;
}

.session-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3fb950;
    flex-shrink: 0;
}
.session-dot.offline { background: var(--muted); }

.session-delete {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    flex-shrink: 0;
}
.session-delete:hover { color: var(--danger); }

#sidebar-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}

#logout-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 8px;
    width: 100%;
    cursor: pointer;
    font-size: 13px;
}
#logout-btn:hover { color: var(--text); border-color: var(--muted); }

#main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

#terminal-wrap {
    flex: 1;
    min-height: 0;
    padding: 8px;
}

#terminal-container {
    height: 100%;
}

#empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 14px;
    flex-direction: column;
    gap: 12px;
}

#empty-state button {
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
}
