/* ================================================================
   CST TEACHER PAGES — Shared stylesheet
   ================================================================ */

/* ── Page header ──────────────────────────────────────────────── */
.pg-header {
    background: #f0f4f8;
    border: 1px solid #dde3ee;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.pg-header-left  { display: flex; align-items: center; gap: 14px; }
.pg-header-icon  {
    width: 46px; height: 46px;
    background: #0D2241;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; color: #fff; flex-shrink: 0;
}
.pg-header-title { font-size: 1.2rem; font-weight: 700; color: #0D2241; margin: 0; }
.pg-header-sub   { font-size: .82rem; color: #64748b; margin: 2px 0 0; }
.pg-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Filter card ──────────────────────────────────────────────── */
.pg-filter {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 1px 6px rgba(13,34,65,.05);
}
.pg-filter-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.pg-filter-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; }
.pg-filter-label {
    font-size: .73rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: #374151;
}
.pg-select {
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: .9rem;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color .15s, box-shadow .15s;
    font-family: 'Segoe UI', sans-serif;
    width: 100%;
}
.pg-select:focus {
    outline: none;
    border-color: #0D2241;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13,34,65,.1);
}

/* ── Stats chips ──────────────────────────────────────────────── */
.pg-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: .8rem; font-weight: 700;
}
.pg-chip-green { background: #dcfce7; color: #16a34a; }
.pg-chip-red   { background: #fee2e2; color: #dc2626; }
.pg-chip-blue  { background: #dbeafe; color: #1d4ed8; }
.pg-chip-gray  { background: #f1f5f9; color: #475569; }

/* ── Main content card ────────────────────────────────────────── */
.pg-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(13,34,65,.05);
    overflow: hidden;
    margin-bottom: 16px;
}
.pg-card-head {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 13px 18px;
    display: flex; align-items: center; justify-content: space-between;
}
.pg-card-title {
    font-size: .88rem; font-weight: 700; color: #0D2241;
    display: flex; align-items: center; gap: 8px;
}
.pg-card-body  { padding: 14px; }

/* ── Student row ──────────────────────────────────────────────── */
.pg-student-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    transition: border-color .15s, background .15s;
}
.pg-student-row:hover { border-color: #cbd5e1; background: #fafbfd; }
.pg-student-row.is-present { border-color: #bbf7d0; background: #f0fdf4; }
.pg-student-row.is-absent  { border-color: #fecaca; background: #fff5f5; }

.pg-student-av {
    width: 38px; height: 38px; border-radius: 50%;
    background: #0D2241;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: #fff;
    flex-shrink: 0;
    font-family: 'Segoe UI', sans-serif;
}
.pg-student-name  { font-size: .9rem; font-weight: 600; color: #1e293b; margin: 0; }
.pg-student-id    { font-size: .78rem; color: #94a3b8; margin: 0; }
.pg-student-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pg-stat-chip {
    font-size: .72rem; font-weight: 600;
    padding: 2px 8px; border-radius: 12px;
}
.pg-stat-classes  { background: #f1f5f9; color: #475569; }
.pg-stat-present  { background: #dcfce7; color: #16a34a; }
.pg-stat-pct-good { background: #dcfce7; color: #16a34a; }
.pg-stat-pct-warn { background: #fef9c3; color: #854d0e; }
.pg-stat-pct-bad  { background: #fee2e2; color: #dc2626; }

/* ── Attendance toggle ────────────────────────────────────────── */
.pg-att-toggle { margin-left: auto; flex-shrink: 0; }
.pg-att-btn {
    padding: 8px 20px;
    border: none; border-radius: 8px;
    font-size: .85rem; font-weight: 700;
    cursor: pointer; transition: all .15s;
    min-width: 110px;
    font-family: 'Segoe UI', sans-serif;
}
.pg-att-btn.present {
    background: #16a34a; color: #fff;
    box-shadow: 0 2px 8px rgba(22,163,74,.25);
}
.pg-att-btn.absent  {
    background: #dc2626; color: #fff;
    box-shadow: 0 2px 8px rgba(220,38,38,.2);
}
.pg-att-btn.present:hover { background: #15803d; }
.pg-att-btn.absent:hover  { background: #b91c1c; }

/* ── Grade select (result entry) ──────────────────────────────── */
.pg-grade-select {
    padding: 7px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: .85rem;
    color: #1e293b;
    background: #f8fafc;
    width: 100%;
    font-family: 'Segoe UI', sans-serif;
    transition: border-color .15s;
}
.pg-grade-select:focus { outline: none; border-color: #0D2241; background: #fff; }
.pg-grade-select:disabled { opacity: .55; cursor: not-allowed; }

/* Grade colour strip on selected rows */
.pg-grade-mastery    { border-left: 3px solid #16a34a !important; }
.pg-grade-proficient { border-left: 3px solid #0891b2 !important; }
.pg-grade-developing { border-left: 3px solid #2563eb !important; }
.pg-grade-approaching{ border-left: 3px solid #d97706 !important; }
.pg-grade-emerging   { border-left: 3px solid #ea580c !important; }
.pg-grade-beginning  { border-left: 3px solid #dc2626 !important; }

/* ── Comment textarea ─────────────────────────────────────────── */
.pg-comment {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: .85rem;
    color: #1e293b;
    resize: vertical;
    min-height: 72px;
    font-family: 'Segoe UI', sans-serif;
    transition: border-color .15s;
}
.pg-comment:focus { outline: none; border-color: #0D2241; }
.pg-comment:disabled { opacity: .55; background: #f8fafc; }

/* ── Achievement legend ───────────────────────────────────────── */
.pg-legend {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
}
.pg-legend-title { font-size: .8rem; font-weight: 700; color: #1d4ed8; margin-bottom: 8px; }
.pg-legend-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px; }
.pg-legend-item  { font-size: .78rem; color: #374151; display: flex; align-items: center; gap: 6px; }
.pg-legend-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Deadline banner ──────────────────────────────────────────── */
.pg-deadline {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 9px;
    padding: 10px 16px;
    font-size: .87rem; font-weight: 500;
    color: #c2410c;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
}

/* ── Trait column labels (Learner Profile) ────────────────────── */
.pg-trait-header {
    display: grid;
    grid-template-columns: 200px repeat(4, 1fr);
    gap: 10px;
    padding: 8px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #475569;
}
.pg-trait-row {
    display: grid;
    grid-template-columns: 200px repeat(4, 1fr);
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    transition: background .12s;
}
.pg-trait-row:last-child { border-bottom: none; }
.pg-trait-row:hover { background: #fafbfd; }

/* ── Loading / empty states ───────────────────────────────────── */
.pg-loading {
    text-align: center; padding: 40px 20px;
    color: #64748b;
}
.pg-empty {
    text-align: center; padding: 36px 20px;
    color: #94a3b8;
}
.pg-empty-icon { font-size: 2.2rem; margin-bottom: 8px; }
.pg-empty-text { font-size: .9rem; }

/* ── Sticky save bar ──────────────────────────────────────────── */
.pg-save-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.pg-save-status { flex: 1; }
.pg-btn-save {
    background: #0D2241; color: #fff;
    border: none; border-radius: 8px;
    padding: 10px 26px; font-size: .92rem; font-weight: 700;
    cursor: pointer; transition: background .15s, box-shadow .15s;
    display: inline-flex; align-items: center; gap: 7px;
    font-family: 'Segoe UI', sans-serif;
}
.pg-btn-save:hover:not(:disabled) {
    background: #0a1a33;
    box-shadow: 0 3px 12px rgba(13,34,65,.25);
}
.pg-btn-save:disabled { opacity: .55; cursor: not-allowed; }

/* ── Action buttons (Print, Excel) ───────────────────────────── */
.pg-btn {
    padding: 8px 16px;
    border: none; border-radius: 8px;
    font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: all .15s;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Segoe UI', sans-serif;
}
.pg-btn-navy { background: #0D2241; color: #fff; }
.pg-btn-navy:hover { background: #0a1a33; }
.pg-btn-green { background: #16a34a; color: #fff; }
.pg-btn-green:hover { background: #15803d; }

/* ── Password modal (first-time login) ────────────────────────── */
.pg-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.pg-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: pgModalIn .25s ease;
    overflow: hidden;
}
@@keyframes pgModalIn {
    from { transform: translateY(-30px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
.pg-modal-head {
    background: #C8102E;
    color: #fff;
    padding: 18px 22px;
    display: flex; align-items: center; justify-content: space-between;
}
.pg-modal-head h5 { margin: 0; font-size: 1rem; font-weight: 700; }
.pg-modal-body { padding: 22px; }
.pg-modal-foot {
    padding: 14px 22px;
    border-top: 1px solid #e2e8f0;
    display: flex; justify-content: flex-end;
}
.pg-field { margin-bottom: 16px; }
.pg-field-label {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #374151; margin-bottom: 6px; display: block;
}
.pg-field-input {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid #e2e8f0; border-radius: 8px;
    font-size: .9rem; color: #1e293b; background: #f8fafc;
    font-family: 'Segoe UI', sans-serif; box-sizing: border-box;
    transition: border-color .15s;
}
.pg-field-input:focus { outline: none; border-color: #C8102E; background: #fff; }
.pg-field-input.invalid { border-color: #dc2626; }
.pg-field-error { font-size: .78rem; color: #dc2626; margin-top: 4px; }
.pg-field-hint  { font-size: .77rem; color: #94a3b8; margin-top: 3px; }

/* ── PTC table ────────────────────────────────────────────────── */
.pg-table-wrap { overflow-x: auto; }
.pg-table {
    width: 100%; border-collapse: collapse;
    font-size: .86rem;
}
.pg-table thead tr { background: #0D2241; color: #fff; }
.pg-table thead th { padding: 11px 14px; font-weight: 600; white-space: nowrap; border: none; }
.pg-table tbody tr { border-bottom: 1px solid #e2e8f0; transition: background .12s; }
.pg-table tbody tr:hover { background: #f8fafc; }
.pg-table tbody td { padding: 11px 14px; color: #1e293b; vertical-align: middle; }
.pg-table .td-num { font-weight: 600; color: #0D2241; text-align: center; }

@@media (max-width: 600px) {
    .pg-trait-header, .pg-trait-row { grid-template-columns: 140px repeat(4, 1fr); }
}
