/*
 * AISA Learning Hub — Staff Performance Review forms.
 *
 * Shared styling for the data-driven performance-review.js renderer.
 * Used by the Teacher Assistant, Admin Support Staff, and Hallway / Bus
 * Monitor report pages. Designed to look clean on screen and print to a
 * tidy A4 PDF via the browser print dialog (no server, no PDF library).
 */

:root {
    --pr-ink: #1f2937;        /* primary text            */
    --pr-muted: #6b7280;      /* secondary text          */
    --pr-line: #cbd5e1;       /* borders / rules         */
    --pr-line-soft: #e2e8f0;  /* hairlines               */
    --pr-band: #0f766e;       /* section heading band    */
    --pr-band-ink: #ffffff;
    --pr-accent: #0f766e;     /* teal — matches Tools hub */
    --pr-accent-soft: #ccfbf1;
    --pr-page: #eef2f5;       /* app background          */
    --pr-paper: #ffffff;      /* the "sheet"             */
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    font-size: 14px;
    color: var(--pr-ink);
    line-height: 1.45;
    margin: 0;
    /* Leave padding-top to auth/menu.js, which sets body{padding-top:3.75rem}
       at runtime to clear its fixed app-bar. We only own the sides + bottom. */
    padding: 0 16px 64px;
    background-color: var(--pr-page);
}

/* ---- The A4 sheet ------------------------------------------------------ */
.pr-sheet {
    max-width: 210mm;
    margin: 0 auto;
    background: var(--pr-paper);
    padding: 40px 44px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12), 0 8px 24px rgba(15, 23, 42, .08);
    border: 1px solid var(--pr-line-soft);
    border-radius: 6px;
}

/* ---- Masthead ---------------------------------------------------------- */
.pr-masthead {
    text-align: center;
    border-bottom: 3px solid var(--pr-accent);
    padding-bottom: 16px;
    margin-bottom: 22px;
}
.pr-masthead img { height: 46px; width: auto; margin-bottom: 10px; }
.pr-school {
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--pr-muted);
    margin: 0 0 4px;
    font-weight: 600;
}
.pr-title {
    font-size: 21px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
    margin: 0;
    color: var(--pr-ink);
}
.pr-subtitle {
    font-size: 13px;
    color: var(--pr-accent);
    font-weight: 600;
    margin: 6px 0 0;
}

/* ---- Header fields (name / evaluator / date / position …) -------------- */
.pr-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 22px;
    margin-bottom: 26px;
}
.pr-field label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--pr-muted);
    margin-bottom: 4px;
}
.pr-field input {
    width: 100%;
    border: none;
    border-bottom: 1.5px solid var(--pr-line);
    padding: 5px 2px;
    font-size: 14px;
    font-family: inherit;
    color: var(--pr-ink);
    background: transparent;
}
.pr-field input:focus {
    outline: none;
    border-bottom-color: var(--pr-accent);
}

/* ---- Sections ---------------------------------------------------------- */
.pr-section { margin-bottom: 22px; }
.pr-section-band {
    background: var(--pr-band);
    color: var(--pr-band-ink);
    font-size: 15px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 4px 4px 0 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pr-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.pr-table th, .pr-table td {
    border: 1px solid var(--pr-line);
    padding: 7px 8px;
    vertical-align: middle;
}
.pr-table thead th {
    background: var(--pr-accent-soft);
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    text-align: center;
    color: #0b5750;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.pr-table th.pr-crit-col, .pr-table td.pr-crit {
    width: 40%;
    text-align: left;
}
.pr-table td.pr-crit { font-size: 13px; }
.pr-table td.pr-rate { text-align: center; padding: 4px; }

/* A whole rating cell is clickable; the radio sits centered inside it. */
.pr-rate label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 26px;
    cursor: pointer;
    margin: 0;
}
.pr-rate input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--pr-accent);
    cursor: pointer;
}
.pr-table tbody tr:hover td { background: #f8fafc; }
.pr-table tbody tr:hover td.pr-rate:has(input:checked) { background: #f8fafc; }

/* ---- Comment + free-text boxes ---------------------------------------- */
.pr-comment { margin-top: 8px; }
.pr-comment label,
.pr-block label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--pr-muted);
    margin-bottom: 5px;
}
textarea.pr-text {
    width: 100%;
    border: 1px solid var(--pr-line);
    border-radius: 4px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    color: var(--pr-ink);
    resize: vertical;
    background: #fff;
}
textarea.pr-text:focus { outline: none; border-color: var(--pr-accent); }
.pr-comment textarea { min-height: 52px; }

/* ---- Closing blocks (reflection, growth, signatures) ------------------ */
.pr-block { margin: 22px 0; }
.pr-block .pr-helper {
    font-size: 12.5px;
    color: var(--pr-muted);
    margin: 0 0 8px;
}
.pr-block-reflection textarea { min-height: 90px; }
.pr-block-growth textarea { min-height: 120px; }

.pr-signatures {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px 32px;
}
.pr-sign {
    border-top: 1.5px solid var(--pr-ink);
    padding-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pr-muted);
}
.pr-sign .pr-date {
    font-weight: 400;
    color: var(--pr-muted);
    margin-top: 4px;
}
.pr-footnote {
    margin-top: 26px;
    font-size: 11px;
    color: var(--pr-muted);
    border-top: 1px solid var(--pr-line-soft);
    padding-top: 10px;
}

/* ---- Sticky toolbar (screen only) -------------------------------------
   Sits just below the global app-bar (~60px). The container is transparent
   and lets clicks pass through; only the pill controls are interactive, so
   they read as floating buttons as the form scrolls under them. */
.pr-toolbar {
    position: sticky;
    top: 66px;
    z-index: 30;
    width: 100%;
    max-width: 210mm;
    margin: 8px auto 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    pointer-events: none;
}
.pr-toolbar > * { pointer-events: auto; }
.pr-saved {
    font-size: 12px;
    color: var(--pr-muted);
    min-width: 70px;
    text-align: right;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(6px);
    transition: color .3s;
    opacity: 0;
}
.pr-saved.is-shown { color: var(--pr-accent); opacity: 1; }
.pr-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--pr-line);
    background: #fff;
    color: var(--pr-ink);
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .14);
    transition: background .15s, border-color .15s;
}
.pr-btn:hover { background: #f1f5f9; }
.pr-btn-primary {
    background: var(--pr-accent);
    border-color: var(--pr-accent);
    color: #fff;
}
.pr-btn-primary:hover { background: #0b5d56; }

/* ---- Print ------------------------------------------------------------- */
@media print {
    @page { margin: 12mm; }
    body { background: #fff; padding: 0; }
    .pr-toolbar { display: none !important; }
    .pr-sheet {
        max-width: none;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    .pr-field input,
    textarea.pr-text { border-color: #94a3b8; }
    .pr-section { page-break-inside: avoid; }
    .pr-table thead th,
    .pr-section-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Narrow screens ---------------------------------------------------- */
@media (max-width: 640px) {
    body { padding: 0 8px 48px; }
    .pr-sheet { padding: 24px 18px; }
    .pr-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .pr-table { min-width: 560px; }
}
