* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    margin: 0;
    padding: 0 24px 60px;
}

.header-banner {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    padding: 24px 32px;
    border-radius: 0 0 16px 16px;
    margin: 0 -24px 20px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, .15);
}
.header-title { font-size: 1.8rem; font-weight: 800; color: #fff; }
.header-subtitle { font-size: .95rem; color: #dbeafe; margin-top: 6px; }

.topnav {
    display: flex; gap: 4px; margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}
.topnav a {
    padding: 10px 16px; text-decoration: none; color: #475569; font-weight: 500;
    border-bottom: 2px solid transparent;
}
.topnav a.active { color: #2563eb; border-bottom-color: #2563eb; }
.topnav a:hover { color: #1d4ed8; }

.container { max-width: 980px; margin: 0 auto; }

h2 { color: #0f172a; font-size: 1.4rem; margin-top: 0; }
h3 { color: #1e3a8a; font-size: 1.1rem; }

.card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 20px 24px; margin-bottom: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,.04);
}

.metric-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.metric-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 16px 20px; text-align: center; flex: 1; min-width: 140px;
}
.metric-value { font-size: 1.5rem; font-weight: 700; color: #2563eb; }
.metric-label { font-size: .85rem; color: #64748b; margin-top: 4px; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .92rem; }
input[type=text], input[type=password], input[type=number], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: .95rem; font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: .82rem; color: #64748b; margin-top: 4px; }

.btn {
    display: inline-block; background: #2563eb; color: #fff; border: none;
    padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: .95rem;
    cursor: pointer; text-decoration: none;
}
.btn:hover { background: #1d4ed8; }
.btn.secondary { background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; }
.btn.secondary:hover { background: #e2e8f0; }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; }

.badge { padding: 3px 9px; border-radius: 6px; font-size: .78rem; font-weight: 600; color: #fff; }
.badge.cloud { background: #0284c7; }
.badge.rpa { background: #7c3aed; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.info { background: #eff6ff; color: #1e3a8a; }

.rec-box {
    background: #eff6ff; border-left: 4px solid #2563eb; padding: 10px 14px;
    border-radius: 0 8px 8px 0; font-size: .86rem; margin: 10px 0;
}
.rec-box code { background: #dbeafe; padding: 1px 5px; border-radius: 4px; }

table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .9rem; }
th { background: #eff6ff; color: #1e40af; padding: 8px 12px; text-align: left; border: 1px solid #bfdbfe; }
td { padding: 8px 12px; border: 1px solid #e2e8f0; }

.flow-list { list-style: none; padding: 0; margin: 0; }
.flow-list li { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.flow-list label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }

.progress-wrap { background: #e2e8f0; border-radius: 999px; height: 10px; overflow: hidden; margin: 12px 0; }
.progress-bar { background: #2563eb; height: 100%; transition: width .4s; }

.job-row { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.job-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-row-head strong { flex: 1; }
.job-delete { margin: 0 0 0 auto; }
.job-delete button { padding: 6px 10px; }
.job-status { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.job-status-queued { background: #f1f5f9; color: #475569; }
.job-status-running { background: #eff6ff; color: #1d4ed8; }
.job-status-done { background: #dcfce7; color: #166534; }
.job-status-error { background: #fee2e2; color: #991b1b; }
.job-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.job-log-toggle { cursor: pointer; text-decoration: underline; margin-top: 10px; display: inline-block; }
.job-log { margin-top: 8px; }

.log-box {
    background: #0f172a; color: #cbd5e1; border-radius: 8px; padding: 10px 14px;
    max-height: 320px; overflow-y: auto; font-family: "SF Mono", Consolas, monospace;
    font-size: .8rem; line-height: 1.5;
}
.log-line { white-space: pre-wrap; word-break: break-word; border-bottom: 1px solid #1e293b; padding: 2px 0; }
.log-line:last-child { border-bottom: none; }

.meta-group { border: 1px solid #e2e8f0; border-radius: 10px; padding: 4px 18px 14px; margin-bottom: 18px; }
.meta-group legend { font-weight: 700; color: #1e3a8a; padding: 0 8px; }
.meta-field label { margin-bottom: 4px; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.radio-option { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.radio-option input { width: auto; }
