/* ─────────────────────────────────────────────
   AI Skills Portal — Stylesheet
   Clean, professional, non-intimidating
   ───────────────────────────────────────────── */

:root {
    --navy:       #1a2744;
    --navy-light: #243460;
    --gold:       #c9a84c;
    --gold-light: #e8c97a;
    --white:      #ffffff;
    --off-white:  #f5f6fa;
    --text:       #2c2c2c;
    --text-muted: #6b7280;
    --border:     #d1d5db;
    --success:    #166534;
    --success-bg: #dcfce7;
    --warning:    #854d0e;
    --warning-bg: #fef9c3;
    --error:      #991b1b;
    --error-bg:   #fee2e2;
    --info:       #1e40af;
    --info-bg:    #dbeafe;
    --radius:     6px;
    --shadow:     0 1px 3px rgba(0,0,0,0.12);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.10);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--off-white);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navigation ── */
.navbar {
    background: var(--navy);
    color: var(--white);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}
.nav-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.02em;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--gold-light); }
.nav-user {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}
.btn-logout {
    background: rgba(255,255,255,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius);
}

/* ── Layout ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}
.footer {
    background: var(--navy);
    color: rgba(255,255,255,0.4);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
}

/* ── Alerts ── */
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.alert-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.alert-error   { background: var(--error-bg);   color: var(--error);   border-left: 4px solid var(--error); }
.alert-info    { background: var(--info-bg);     color: var(--info);    border-left: 4px solid var(--info); }
.alert-warning { background: var(--warning-bg);  color: var(--warning); border-left: 4px solid var(--warning); }

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-disabled, .btn-link, .btn-danger, .btn-success {
    display: inline-block;
    padding: 0.6rem 1.3rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.15s;
}
.btn-primary  { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--off-white); }
.btn-disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn-link     { background: none; color: var(--navy); padding: 0; text-decoration: underline; }
.btn-link:hover { color: var(--navy-light); }
.btn-danger   { background: var(--error); color: var(--white); }
.btn-danger:hover { background: #7a1515; }
.btn-success  { background: var(--success); color: var(--white); }
.btn-success:hover { background: #0f4a26; }
.btn-full     { width: 100%; text-align: center; }
.btn-sm       { padding: 0.35rem 0.85rem; font-size: 0.83rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,39,68,0.1);
}
.form-group textarea { resize: vertical; font-family: inherit; }
.field-help { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.form-page { max-width: 600px; }
.form-intro { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Section Blocks ── */
.section-block {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.section-block h2 {
    font-size: 1.1rem;
    color: var(--navy);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--off-white);
}
.section-block h3 { font-size: 0.95rem; color: var(--text-muted); margin: 1rem 0 0.5rem; }
.section-intro { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.88rem; display: block; margin-bottom: 1rem; }
.back-link:hover { color: var(--navy); }

/* ── Login ── */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}
.login-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}
.login-box h1 { color: var(--navy); margin-bottom: 0.3rem; font-size: 1.5rem; }
.login-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.8rem; }
.login-help { font-size: 0.82rem; color: var(--text-muted); margin-top: 1.2rem; text-align: center; }

/* ── Dashboard Header ── */
.dashboard-header { margin-bottom: 1.5rem; }
.dashboard-header h1 { color: var(--navy); font-size: 1.6rem; margin-bottom: 0.75rem; }
.progress-bar-wrapper {
    background: var(--border);
    border-radius: 20px;
    height: 10px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 0.4rem;
}
.progress-bar {
    background: var(--gold);
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s;
    min-width: 4px;
}
.progress-label { font-size: 0.88rem; color: var(--text-muted); }
.portfolio-ready-banner {
    background: var(--success-bg);
    color: var(--success);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 600;
    font-size: 1rem;
}

/* ── Materials ── */
.materials-list, .materials-admin-list { display: flex; flex-direction: column; gap: 0.5rem; }
.week-header { font-size: 0.88rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 1rem 0 0.4rem; }
.material-item, .material-admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--off-white);
    border-radius: var(--radius);
    gap: 1rem;
}
.material-info { display: flex; align-items: center; gap: 0.75rem; flex: 1; flex-wrap: wrap; }
.material-type-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}
.material-type-badge.manual   { background: var(--info-bg); color: var(--info); }
.material-type-badge.handout  { background: var(--success-bg); color: var(--success); }
.material-type-badge.resource { background: var(--warning-bg); color: var(--warning); }
.material-title { font-weight: 600; font-size: 0.92rem; }
.material-desc { color: var(--text-muted); font-size: 0.85rem; }
.material-filename { color: var(--text-muted); font-size: 0.8rem; font-family: monospace; }
.material-admin-actions { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.visibility-status { font-size: 0.8rem; }
.visibility-status.visible { color: var(--success); font-weight: 600; }
.visibility-status.hidden  { color: var(--text-muted); }

/* ── Skill Cards (Student Dashboard) ── */
.skill-category { margin-bottom: 1.5rem; }
.skill-category h3 {
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.skill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.skill-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.skill-card.status-accepted  { border-left: 4px solid var(--success); }
.skill-card.status-needs_revision { border-left: 4px solid var(--gold); }
.skill-card.status-pending,
.skill-card.status-evaluating { border-left: 4px solid var(--info); }
.skill-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.skill-number { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.skill-status-badge { font-size: 0.75rem; font-weight: 600; }
.skill-status-badge.accepted       { color: var(--success); }
.skill-status-badge.needs_revision { color: var(--warning); }
.skill-status-badge.pending,
.skill-status-badge.evaluating     { color: var(--info); }
.skill-name { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.75rem; line-height: 1.4; }
.skill-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Submit Page ── */
.submit-wrapper { max-width: 780px; }
.submit-header { margin-bottom: 1.5rem; }
.submit-header h1 { color: var(--navy); font-size: 1.4rem; margin-bottom: 0.25rem; }
.skill-category { color: var(--text-muted); font-size: 0.9rem; }
.previous-submission-notice {
    background: var(--warning-bg); color: var(--warning);
    padding: 0.85rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem;
    font-size: 0.9rem;
}
.previous-submission-notice a { color: var(--warning); }
.submission-guidance {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.submission-guidance h2 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--navy); }
.submission-guidance ol { padding-left: 1.4rem; font-size: 0.9rem; }
.submission-guidance li { margin-bottom: 0.3rem; }
.checklist-reminder { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.75rem; }
.submit-actions { display: flex; gap: 1rem; margin-top: 1rem; justify-content: flex-end; }

/* ── Feedback Page ── */
.feedback-wrapper { max-width: 780px; }
.feedback-header { margin-bottom: 1.5rem; }
.feedback-header h1 { color: var(--navy); font-size: 1.4rem; margin-bottom: 0.2rem; }
.score-panel {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1.25rem 1.5rem; border-radius: var(--radius); margin-bottom: 1.5rem;
}
.score-panel.accepted      { background: var(--success-bg); }
.score-panel.needs-revision { background: var(--warning-bg); }
.score-display { display: flex; align-items: baseline; gap: 0.2rem; }
.score-number { font-size: 2.8rem; font-weight: 800; color: var(--navy); line-height: 1; }
.score-denom  { font-size: 1.2rem; color: var(--text-muted); }
.recommendation-badge { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.score-panel.accepted .recommendation-badge      { color: var(--success); }
.score-panel.needs-revision .recommendation-badge { color: var(--warning); }
.attempt-info { font-size: 0.82rem; color: var(--text-muted); }
.feedback-narrative { font-size: 0.95rem; line-height: 1.75; }
.checklist-category {
    font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted); margin: 1rem 0 0.5rem;
}
.checklist-items { display: flex; flex-direction: column; gap: 0.4rem; }
.checklist-item {
    display: flex; gap: 0.75rem; padding: 0.65rem 0.85rem;
    border-radius: var(--radius); font-size: 0.88rem;
}
.checklist-item.pass       { background: var(--success-bg); }
.checklist-item.needs-work { background: var(--error-bg); }
.checklist-status { font-size: 1rem; flex-shrink: 0; width: 20px; }
.checklist-item.pass .checklist-status       { color: var(--success); }
.checklist-item.needs-work .checklist-status { color: var(--error); }
.checklist-text { font-weight: 500; }
.checklist-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }
.employer-questions { display: flex; flex-direction: column; gap: 1rem; }
.question-block { padding: 1rem; background: var(--off-white); border-radius: var(--radius); }
.question-text { margin-bottom: 0.4rem; font-size: 0.92rem; }
.question-readiness { font-size: 0.87rem; color: var(--text-muted); }
.resubmit-callout {
    background: var(--info-bg); padding: 1.25rem; border-radius: var(--radius);
    margin-top: 1.5rem; display: flex; align-items: center; justify-content: space-between;
}
.pending-notice { background: var(--info-bg); color: var(--info); padding: 1rem; border-radius: var(--radius); }

/* ── Instructor Progress Grid ── */
.cohort-selector { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cohort-btn {
    padding: 0.6rem 1.1rem; border-radius: var(--radius);
    border: 1px solid var(--border); text-decoration: none;
    color: var(--text); background: var(--white); font-size: 0.9rem;
    display: flex; flex-direction: column;
}
.cohort-btn:hover { border-color: var(--navy); }
.cohort-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.cohort-btn.new { border-style: dashed; color: var(--text-muted); }
.cohort-org { font-size: 0.78rem; color: var(--text-muted); }
.cohort-btn.active .cohort-org { color: rgba(255,255,255,0.6); }
.cohort-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.cohort-header h2 { margin-bottom: 0; border: none; padding: 0; }
.cohort-org-label { color: var(--text-muted); font-size: 0.88rem; }
.cohort-actions { margin-left: auto; display: flex; gap: 0.75rem; }
.progress-grid-wrapper { overflow-x: auto; }
.progress-grid { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.progress-grid th { background: var(--navy); color: var(--white); padding: 0.5rem 0.4rem; text-align: center; font-weight: 600; }
.progress-grid th.student-col { text-align: left; padding-left: 0.75rem; min-width: 160px; }
.progress-grid td { padding: 0.5rem 0.4rem; text-align: center; border-bottom: 1px solid var(--border); }
.progress-grid td.student-name { text-align: left; padding-left: 0.75rem; }
.progress-grid td.student-name a { color: var(--navy); text-decoration: none; font-weight: 500; }
.progress-grid td.student-name a:hover { text-decoration: underline; }
.skill-cell.accepted       { color: var(--success); font-weight: 700; }
.skill-cell.needs_revision { color: var(--warning); }
.skill-cell.pending,
.skill-cell.evaluating     { color: var(--info); }
.skill-cell.not_submitted  { color: var(--border); }
.total-cell { font-weight: 700; color: var(--navy); }
.badge-complete   { background: var(--success-bg); color: var(--success); font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 3px; }
.badge-incomplete { color: var(--border); }
.badge-withdrawn  { background: var(--warning-bg); color: var(--warning); font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 3px; margin-left: 0.5rem; }

/* ── Data tables (instructor management, archive) ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 0.75rem;
}
.data-table th {
    background: var(--navy);
    color: var(--white);
    text-align: left;
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
}
.data-table td {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) { background: var(--off-white); }
.row-inactive, .row-withdrawn { opacity: 0.6; background: var(--off-white) !important; }
.action-cell { white-space: nowrap; }
.action-cell > * { margin-right: 0.4rem; }

.legend { display: flex; gap: 1.25rem; margin-top: 0.75rem; flex-wrap: wrap; font-size: 0.82rem; }
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-item.accepted       { color: var(--success); }
.legend-item.needs_revision { color: var(--warning); }
.legend-item.pending        { color: var(--info); }
.legend-item.not_submitted  { color: var(--text-muted); }
.empty-state { text-align: center; padding: 2rem; color: var(--text-muted); }

/* ── Student Detail (Instructor View) ── */
.student-detail .student-email { color: var(--text-muted); margin-bottom: 1rem; }
.skill-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 0.75rem; margin-top: 1.5rem; }
.skill-detail-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem; }
.skill-detail-card.status-accepted      { border-left: 4px solid var(--success); }
.skill-detail-card.status-needs_revision { border-left: 4px solid var(--gold); }
.skill-detail-card.status-pending,
.skill-detail-card.status-evaluating    { border-left: 4px solid var(--info); }
.skill-detail-header { display: flex; justify-content: space-between; margin-bottom: 0.3rem; }
.skill-score { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.4rem; }
