/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0078d4;
    --primary-dark: #005a9e;
    --success: #107c10;
    --error: #d13438;
    --warning: #ff8c00;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #323130;
    --text-muted: #6b7280;
    --border: #e1e1e1;
    --radius: 8px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* === Navbar === */
.navbar {
    background: #1a1a2e;
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.nav-logo {
    height: 28px;
    width: auto;
    display: block;
}

#new-project-form .btn-primary {
    margin-top: 20px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-size: 14px;
    opacity: 0.9;
}

/* === Container === */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #a0a0a0; cursor: not-allowed; }

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,.3);
    color: inherit;
}

.btn-outline:hover { background: rgba(255,255,255,.1); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* === Login === */
.login-card {
    max-width: 420px;
    margin: 80px auto;
    text-align: center;
    background: var(--card-bg);
    padding: 48px 40px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.login-card h1 { margin: 20px 0 8px; font-size: 28px; }
.login-card p { color: var(--text-muted); margin-bottom: 32px; }

.setup-warning {
    text-align: left;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 20px 24px;
}

.setup-warning h3 { margin-bottom: 8px; font-size: 16px; }
.setup-warning p { color: var(--text); margin-bottom: 8px; font-size: 14px; }
.setup-warning ul { margin: 8px 0 8px 20px; }
.setup-warning li { font-size: 14px; margin-bottom: 4px; }
.setup-warning code { background: #f5f0e0; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* === Dashboard === */
.upload-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 32px;
}

.upload-card h2 { margin-bottom: 8px; }
.upload-card > p { color: var(--text-muted); margin-bottom: 24px; }

/* === File Drop === */
.file-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
}

.file-drop:hover, .file-drop.drag-over {
    border-color: var(--primary);
    background: #f0f7ff;
}

.file-drop p { margin-top: 12px; color: var(--text-muted); }
.file-hint { font-size: 13px; }

.file-label {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f7ff;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-top: 16px;
    font-weight: 500;
}

.ai-mode-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.ai-mode-select label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.ai-mode-select select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: #fff;
}

#upload-btn {
    margin-top: 12px;
    width: 100%;
}

/* === Jobs Table === */
.jobs-section h2 { margin-bottom: 16px; }

.jobs-table-wrap { overflow-x: auto; }

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.jobs-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    background: #fafafa;
}

.jobs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.jobs-table tr:last-child td { border-bottom: none; }

.job-filename {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Status Badges === */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-queued { background: #e8e8e8; color: #666; }
.status-processing { background: #fff4ce; color: #7a6400; }
.status-success { background: #dff6dd; color: var(--success); }
.status-error { background: #fde7e9; color: var(--error); }

/* === Progress Bar === */
.progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width .3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 48px;
    background: var(--card-bg);
    border-radius: var(--radius);
    color: var(--text-muted);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.error-hint {
    color: var(--error);
    cursor: help;
    font-size: 13px;
}

.job-actions { white-space: nowrap; }
.job-actions .btn-sp { border-color: var(--primary); color: var(--primary); margin-left: 4px; }

/* === Toast notifications === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #323130;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    z-index: 1000;
    animation: slideIn .3s ease;
}

.toast.error { background: var(--error); }

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* === Curriculum (Path C) === */
.curriculum-card {
    border-left: 4px solid var(--primary);
}

.curriculum-card .form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.curriculum-card .form-row label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.curriculum-card .form-row input[type="text"],
.curriculum-card .form-row select {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: #fff;
}

.curriculum-card .form-row input[type="file"] {
    padding: 6px 0;
    font-size: 14px;
}

.curriculum-card .req {
    color: var(--error);
    font-weight: 700;
}

#curriculum-submit {
    margin-top: 8px;
    width: 100%;
}

.curriculum-jobs-section { margin-top: 16px; }

.coverage-cell {
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 12px;
    white-space: nowrap;
}

/* The shared .btn-outline is styled for the dark navbar;
   override for use inside the dashboard cards/tables. */
.upload-card .btn-outline,
.jobs-section .btn-outline {
    border: 1px solid var(--border);
    color: var(--primary);
    background: #fff;
}
.upload-card .btn-outline:hover,
.jobs-section .btn-outline:hover {
    background: #f0f7ff;
}

/* === Responsive === */
@media (max-width: 640px) {
    .container { padding: 16px; }
    .upload-card { padding: 20px; }
    .file-drop { padding: 24px; }
    .navbar { padding: 0 16px; }
}


/* === Course Studio: nav links + project wizard === */
.nav-links { display: flex; gap: 20px; margin-left: 28px; margin-right: auto; }
.nav-links a { color: #cbd5e1; text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.08); }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 14px; font-weight: 600; }
.form-row input[type=text] {
    width: 100%; margin-top: 6px; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px;
}
.error-text { color: var(--error); font-size: 13px; margin-left: 10px; }
.muted { color: var(--text-muted); font-size: 14px; }
.empty { color: var(--text-muted); font-style: italic; }

.wizard-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 24px; margin-bottom: 24px; flex-wrap: wrap;
}
.wizard-head h1 { font-size: 24px; margin: 4px 0; }
.wizard-status { min-width: 260px; }
.wizard-status .progress-bar-wrap { margin: 8px 0 4px; }

.step-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.step-card h2 { font-size: 17px; margin-bottom: 6px; }
.step-card > p { color: var(--text-muted); font-size: 14px; margin-bottom: 14px; }
.step-card input[type=file] { display: block; margin: 10px 0; font-size: 13px; }

.upload-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.upload-grid label { font-size: 14px; font-weight: 600; }
.upload-grid small { color: var(--text-muted); font-weight: 400; }

.review-box {
    margin-top: 14px; padding: 14px 16px; background: var(--bg);
    border: 1px dashed var(--border); border-radius: var(--radius);
}
.review-box p { font-size: 13px; margin-bottom: 8px; }

.artifact-list { list-style: none; margin: 8px 0 0; padding: 0; }
.artifact-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.artifact-name { font-family: 'Consolas', monospace; word-break: break-all; }
