*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    background: #f3f4f6;
    color: #1f2937;
    min-height: 100vh;
}

header {
    background: #0078d4;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 { font-size: 18px; font-weight: 600; }

.user-bar { display: flex; align-items: center; gap: 12px; font-size: 13px; }

main { max-width: 860px; margin: 24px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 20px; }

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 24px;
}

.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: #374151; }

#login-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    gap: 16px;
}

#login-section p { color: #6b7280; }

.input-row { display: flex; gap: 8px; }

input[type=text] {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

input[type=text]:focus { outline: 2px solid #0078d4; border-color: transparent; }

.hint { font-size: 12px; color: #9ca3af; margin-top: 5px; }

button {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary   { background: #0078d4; color: #fff; }
.btn-primary:hover   { background: #106ebe; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover    { background: #b91c1c; }

button:disabled { opacity: 0.5; cursor: not-allowed; }

#derived-user-row { margin-top: 8px; font-size: 13px; color: #6b7280; }
#derived-user { font-weight: 600; color: #1f2937; }

/* Tree */
#tree-section { display: none; }

.tree-container {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    max-height: 380px;
    overflow-y: auto;
    background: #fafafa;
}

ul.tree { list-style: none; padding-left: 18px; }
ul.tree:first-child { padding-left: 4px; }

.tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 4px;
    cursor: default;
}

.tree-row:hover { background: #f0f4ff; }

.expander {
    font-size: 10px;
    width: 14px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: #6b7280;
}

.node-label { cursor: pointer; }

.tree-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Progress */
#progress-section { display: none; }

#current-job { font-size: 13px; color: #6b7280; margin-bottom: 8px; min-height: 18px; }

#log {
    background: #111827;
    color: #d1fae5;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    padding: 12px;
    border-radius: 6px;
    height: 220px;
    overflow-y: auto;
}

#log p { margin-bottom: 3px; }

#status { font-size: 13px; margin-top: 8px; min-height: 18px; color: #555; }
