/* Teacher portal layout, on top of the app's chalk stylesheet. */

body {
    background-color: #f4f1ea;
}

.portal-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding: 0.5rem 1.25rem;
    background-color: #2f3a34;
    border-bottom: 6px solid #8a6a47;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #f7f5ee;
    text-decoration: none;
    font-family: var(--chalk-font);
    font-size: 1.4rem;
}

    .portal-brand img {
        width: 40px;
        height: 40px;
    }

.portal-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .portal-nav a,
    .portal-nav button {
        color: #f7f5ee;
        background: none;
        border: none;
        padding: 0;
        text-decoration: none;
        font-family: var(--chalk-font);
        font-size: 1.15rem;
        cursor: pointer;
    }

    .portal-nav form {
        margin: 0;
    }

.portal-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem;
}

    .portal-main h1 {
        font-family: var(--chalk-font);
        font-size: 2rem;
    }

    .portal-main h2 {
        font-family: var(--chalk-font);
        font-size: 1.4rem;
        margin: 1.5rem 0 0.6rem;
    }

.panel {
    background: #fffdf8;
    border: 1px solid #ddd5c4;
    padding: 1rem;
    margin-bottom: 1rem;
}

.portal-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
}

    .portal-row .form-control {
        flex: 1 1 240px;
    }

.portal-narrow {
    max-width: 420px;
}

    .portal-narrow label {
        display: block;
        margin-bottom: 0.75rem;
    }

.portal-login {
    max-width: 380px;
    margin: 3rem auto;
    padding: 1.5rem;
    background: #fffdf8;
    border-top: 6px solid #8a6a47;
}

    .portal-login label {
        display: block;
        margin-bottom: 0.75rem;
    }

.portal-code {
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.portal-table {
    width: 100%;
    background: #fffdf8;
    border-collapse: collapse;
    font-size: 0.95rem;
}

    .portal-table th,
    .portal-table td {
        padding: 0.5rem 0.6rem;
        border-bottom: 1px solid #e6dfd0;
        text-align: left;
    }

    .portal-table th {
        background: #efe9dc;
    }

.portal-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.portal-item {
    padding: 0.35rem 0;
    border-bottom: 1px dashed #d8cfbc;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat {
    background: #fffdf8;
    border: 1px solid #ddd5c4;
    border-top: 4px solid #2e7d32;
    padding: 0.75rem 1rem;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label,
.note {
    color: #666;
    font-size: 0.9rem;
}

.problems {
    margin: 0.5rem 0;
    padding: 0.6rem 0.8rem;
    background: #fff1f0;
    border-left: 4px solid #b32121;
}

.score-bar {
    display: inline-block;
    width: 90px;
    height: 10px;
    margin-right: 0.4rem;
    background: #eee7d8;
    vertical-align: middle;
}

    .score-bar > span {
        display: block;
        height: 100%;
    }

.score-low {
    background: #b32121;
}

.score-mid {
    background: #c77700;
}

.score-high {
    background: #2e7d32;
}

/* ---- Worksheets ---- */
.worksheet-count { width: 5rem; display: inline-block; }
.worksheet-check { display: inline-flex; gap: 0.3rem; align-items: center; margin: 0 0.8rem 0.3rem 0; font-weight: normal; }
.worksheet-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem; }
.worksheet-sections strong { display: block; margin-bottom: 0.2rem; }
.worksheet { background: #fff; color: #222; padding: 1.5rem 2rem; margin: 1rem 0; border: 1px solid #ddd; }
.worksheet-head { border-bottom: 2px solid #222; margin-bottom: 1rem; padding-bottom: 0.5rem; }
.worksheet-head h2 { font-size: 1.3rem; margin: 0 0 0.4rem; }
.worksheet-item { margin: 0 0 1.1rem; break-inside: avoid; }
.worksheet-marks { color: #666; font-size: 0.9rem; }
.worksheet-picture svg { max-width: 320px; height: auto; display: block; margin: 0.4rem 0; }
.worksheet-part { margin: 0.25rem 0 0 1.2rem; }
.worksheet-working { height: 4.5rem; border-bottom: 1px dotted #bbb; }
.memo .worksheet-working { display: none; }
.worksheet-answer { margin-left: 1.2rem; font-weight: 600; }
.worksheet-explain { margin-left: 1.2rem; color: #555; font-size: 0.92rem; }
.worksheet-code { color: #888; font-size: 0.8rem; margin-top: 1rem; }

@media print {
    .no-print, .portal-bar, .portal-nav { display: none !important; }
    body { background: #fff; }
    .worksheet { border: none; margin: 0; padding: 0; break-after: page; }
}
