/* ═══════════════════════════════════════════════════════════════════
   Evaluations — Staff Development Reviews
   Uses Tailwind utility classes where possible; custom classes here
   for things Tailwind can't do easily (dynamic bar widths, etc.)
═══════════════════════════════════════════════════════════════════ */

/* ── Page shell ───────────────────────────────────────────────── */
.eval-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

/* ── Header ───────────────────────────────────────────────────── */
.eval-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.eval-header-left h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}
.eval-header-left h1 i { margin-right: 8px; color: #6366f1; }
.eval-header-left p  { color: #64748b; font-size: .9rem; }
.eval-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: #6366f1;
    text-decoration: none;
    margin-bottom: 8px;
}
.eval-back-link:hover { text-decoration: underline; }

/* ── Buttons ──────────────────────────────────────────────────── */
.eval-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all .15s;
}
.eval-btn-primary  { background: #6366f1; color: #fff; }
.eval-btn-primary:hover  { background: #4f46e5; }
.eval-btn-outline  { background: transparent; color: #6366f1; border: 2px solid #6366f1; }
.eval-btn-outline:hover  { background: #eef2ff; }
.eval-btn-compare  { background: #0ea5e9; color: #fff; padding: 6px 14px; font-size: .8rem; }
.eval-btn-compare:hover  { background: #0284c7; }
.eval-btn-submit   { background: #22c55e; color: #fff; padding: 12px 28px; font-size: 1rem; }
.eval-btn-submit:hover   { background: #16a34a; }

/* ── Status badges ────────────────────────────────────────────── */
.eval-status-badge, .eval-year-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    margin-left: 8px;
}
.eval-badge-active { background: #dcfce7; color: #15803d; }
.eval-badge-closed { background: #f1f5f9; color: #64748b; }
.eval-year-badge   { background: #e0e7ff; color: #3730a3; }

.eval-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}
.eval-pill-done    { background: #dcfce7; color: #15803d; }
.eval-pill-pending { background: #fef9c3; color: #92400e; }

/* ── Dashboard cycle cards ────────────────────────────────────── */
.eval-cycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 20px;
}
.eval-cycle-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .15s;
}
.eval-cycle-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.eval-cycle-active { border-left: 4px solid #6366f1; }
.eval-cycle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.eval-cycle-card-header h2 { font-size: 1.1rem; font-weight: 700; color: #1e293b; }
.eval-cycle-meta { font-size: .78rem; color: #94a3b8; margin-top: 14px; }

/* ── Progress bars ────────────────────────────────────────────── */
.eval-progress-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.eval-progress-block   { }
.eval-progress-label   { display: flex; justify-content: space-between; font-size: .8rem; color: #475569; margin-bottom: 5px; }
.eval-progress-fraction { font-weight: 600; color: #1e293b; }
.eval-progress-bar-track {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}
.eval-progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s;
    background: #6366f1;
}
.eval-bar-manager  { background: #0ea5e9; }
.eval-bar-employee { background: #22c55e; }

/* ── Empty state ─────────────────────────────────────────────── */
.eval-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}
.eval-empty-icon { font-size: 3rem; color: #cbd5e1; margin-bottom: 16px; display: block; }
.eval-empty h3   { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; color: #475569; }
.eval-empty p    { margin-bottom: 20px; }

/* ── Sections & tables ────────────────────────────────────────── */
.eval-section { margin-bottom: 36px; }
.eval-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
}
.eval-section-title i { margin-right: 8px; color: #6366f1; }
.eval-table-wrapper { overflow-x: auto; border-radius: 10px; border: 1px solid #e2e8f0; }
.eval-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.eval-table thead tr { background: #f8fafc; }
.eval-table th { padding: 11px 16px; text-align: left; font-weight: 600; color: #64748b;
                 font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid #e2e8f0; }
.eval-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.eval-table tbody tr:last-child td { border-bottom: none; }
.eval-table tbody tr:hover { background: #fafafa; }

.eval-user-cell { display: flex; align-items: center; gap: 8px; }
.eval-role-icon-mgr { color: #6366f1; }
.eval-role-icon-emp { color: #0ea5e9; }
.eval-count-badge { background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.eval-link { color: #6366f1; text-decoration: none; font-weight: 600; }
.eval-link:hover { text-decoration: underline; }
.eval-link-action { color: #0ea5e9; }
.eval-muted { color: #94a3b8; font-size: .85rem; }
.eval-empty-text { color: #94a3b8; padding: 20px 0; font-size: .9rem; }

/* ── Form card (cycle create) ─────────────────────────────────── */
.eval-form-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    max-width: 560px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.eval-form-group   { margin-bottom: 22px; }
.eval-form-label   { display: block; font-weight: 600; color: #374151; margin-bottom: 7px; font-size: .9rem; }
.eval-form-label i { margin-right: 6px; color: #6366f1; }
.eval-required     { color: #ef4444; margin-left: 2px; }
.eval-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: .9rem;
    color: #1e293b;
    transition: border-color .15s;
}
.eval-form-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.eval-form-hint { font-size: .8rem; color: #6b7280; margin-top: 5px; display: block; }
.eval-form-actions { display: flex; gap: 12px; margin-top: 28px; }
.eval-info-box {
    display: flex;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: .85rem;
    color: #1e40af;
    margin-top: 8px;
}
.eval-info-box i { font-size: 1rem; margin-top: 2px; flex-shrink: 0; }
.eval-info-box ul { margin: 6px 0 0 16px; }
.eval-info-box li { margin-bottom: 3px; }

/* ── Survey pages ─────────────────────────────────────────────── */
.eval-survey-subtitle { color: #6366f1; font-weight: 600; font-size: .9rem; }
.eval-survey-intro-card {
    display: flex;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 28px;
    font-size: .88rem;
    color: #334155;
    line-height: 1.6;
}
.eval-intro-icon { font-size: 1.3rem; color: #6366f1; margin-top: 2px; flex-shrink: 0; }
.eval-warning-note { color: #92400e; font-size: .82rem; font-weight: 600; }
.eval-warning-note i { margin-right: 4px; }

/* Employee section within manager form */
.eval-employee-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.eval-employee-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    padding: 18px 22px;
}
.eval-employee-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    overflow: hidden;
}
.eval-employee-avatar img { width: 100%; height: 100%; object-fit: cover; }
.eval-employee-section-header h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 2px; }
.eval-emp-role { font-size: .78rem; opacity: .85; }

/* Question blocks */
.eval-questions-list { padding: 20px 22px; display: flex; flex-direction: column; gap: 22px; }
.eval-question-block {
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 16px 18px;
    background: #fafafa;
    transition: border-color .15s;
}
.eval-question-block:hover { border-color: #c7d2fe; }
.eval-question-error { border-color: #fca5a5 !important; background: #fff1f2; }
.eval-question-readonly { cursor: default; }
.eval-question-text { margin-bottom: 12px; }
.eval-question-text p { color: #1e293b; font-size: .9rem; margin-top: 4px; line-height: 1.5; }
.eval-question-number {
    display: inline-block;
    background: #6366f1;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    margin-right: 6px;
}
.eval-question-category {
    font-size: .75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Radio grid */
.eval-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.eval-option-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    cursor: pointer;
    font-size: .82rem;
    color: #374151;
    background: #fff;
    transition: all .15s;
}
.eval-option-label:hover { border-color: #a5b4fc; background: #eef2ff; }
.eval-option-label input[type="radio"] { margin-top: 1px; flex-shrink: 0; accent-color: #6366f1; }
.eval-option-label:has(input:checked) { border-color: #6366f1; background: #eef2ff; font-weight: 600; }
.eval-option-text { line-height: 1.4; }
.eval-field-error { color: #ef4444; font-size: .8rem; margin-top: 8px; }

/* Submitted / readonly answer */
.eval-selected-answer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    font-size: .88rem;
    color: #15803d;
    font-weight: 600;
}
.eval-answer-icon { font-size: 1rem; }
.eval-value-badge {
    margin-left: auto;
    background: #dcfce7;
    color: #15803d;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .78rem;
}

/* Submit bar */
.eval-submit-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 -4px 12px rgba(0,0,0,.07);
    border-radius: 0 0 12px 12px;
    margin-top: 12px;
}
.eval-submit-note { font-size: .83rem; color: #64748b; }
.eval-submit-note i { margin-right: 5px; color: #94a3b8; }

.eval-submitted-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px 18px;
    color: #15803d;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 24px;
}
.eval-submitted-banner i { font-size: 1.1rem; }

/* ── Comparison page ──────────────────────────────────────────── */
.eval-compare-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.eval-compare-meta-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 200px;
}
.eval-compare-meta-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #6366f1;
    flex-shrink: 0;
    overflow: hidden;
}
.eval-avatar-mgr { background: #e0f2fe; color: #0ea5e9; }
.eval-compare-meta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.eval-meta-role-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .7px; color: #94a3b8; font-weight: 600; }
.eval-compare-meta-card h3 { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 2px 0; }
.eval-compare-meta-card small { color: #64748b; font-size: .78rem; }
.eval-compare-vs { font-size: 1.4rem; color: #cbd5e1; flex-shrink: 0; }

/* Scorecard */
.eval-scorecard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.eval-score-block {
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.eval-score-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.eval-score-label  { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.eval-score-sub    { font-size: .73rem; opacity: .7; margin-top: 3px; }
.eval-score-green  { background: #dcfce7; color: #15803d; }
.eval-score-yellow { background: #fef9c3; color: #92400e; }
.eval-score-red    { background: #fee2e2; color: #b91c1c; }
.eval-score-total  { background: #e0e7ff; color: #3730a3; }

/* Legend */
.eval-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: .82rem;
    color: #64748b;
    flex-wrap: wrap;
}
.eval-legend-item { display: flex; align-items: center; gap: 6px; }
.eval-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.eval-dot-green  { background: #22c55e; }
.eval-dot-yellow { background: #eab308; }
.eval-dot-red    { background: #ef4444; }

/* Column headers */
.eval-compare-col-headers {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 80px;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    padding: 10px 16px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #64748b;
    margin-bottom: 2px;
}
.eval-col-header-gap { text-align: center; }

/* Comparison rows */
.eval-compare-row {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 80px;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #f1f5f9;
    border-top: none;
    align-items: center;
    transition: background .1s;
}
.eval-compare-row:last-child { border-radius: 0 0 8px 8px; }
.eval-compare-row:hover { background: #fafafa; }
.eval-compare-green  { border-left: 4px solid #22c55e; background: #f0fdf4; }
.eval-compare-yellow { border-left: 4px solid #eab308; background: #fefce8; }
.eval-compare-red    { border-left: 4px solid #ef4444; background: #fff1f2; }

/* Question cell */
.eval-compare-q-header { margin-bottom: 4px; }
.eval-compare-q-text   { font-size: .82rem; color: #475569; line-height: 1.4; }

/* Answer cells */
.eval-compare-answer { }
.eval-answer-label   { font-size: .85rem; font-weight: 600; color: #1e293b; margin-bottom: 5px; }
.eval-answer-bar-track { height: 7px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.eval-answer-bar-fill  { height: 100%; border-radius: 4px; transition: width .3s; }
.eval-bar-emp { background: #6366f1; }
.eval-bar-mgr { background: #0ea5e9; }
.eval-answer-value { font-size: .75rem; color: #94a3b8; margin-top: 3px; }

/* Gap indicator */
.eval-compare-gap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.eval-gap-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}
.eval-gap-green  { background: #dcfce7; color: #15803d; }
.eval-gap-yellow { background: #fef9c3; color: #92400e; }
.eval-gap-red    { background: #fee2e2; color: #b91c1c; }
.eval-gap-label  { font-size: .7rem; color: #64748b; font-weight: 600; }

/* Footer actions */
.eval-compare-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* ── Form errors ──────────────────────────────────────────────── */
.eval-form-errors {
    background: #fff1f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    color: #b91c1c;
    font-size: .88rem;
    margin-bottom: 20px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .eval-scorecard { grid-template-columns: 1fr 1fr; }
    .eval-compare-col-headers,
    .eval-compare-row { grid-template-columns: 1fr; }
    .eval-cycle-grid { grid-template-columns: 1fr; }
    .eval-progress-grid { grid-template-columns: 1fr; }
    .eval-compare-meta-row { flex-direction: column; }
    .eval-options-grid { grid-template-columns: 1fr; }
}
