/* =============================================================================
   Scholium — Production CSS
   Bootstrap 5 base. These overrides apply the Scholium visual identity:
   warm sand background, white cards, dark emerald accents.
   No Tailwind. No build step. Plain CSS.
   ============================================================================= */

/* --- Design tokens --------------------------------------------------------- */
:root {
    --sch-sand:          #f5f0e8;
    --sch-sand-dark:     #ede6d6;
    --sch-white:         #ffffff;
    --sch-emerald:       #1a4a3a;
    --sch-emerald-mid:   #245c49;
    --sch-emerald-light: #2d7a5f;
    --sch-emerald-pale:  #e8f2ee;
    --sch-text:          #1c1c1c;
    --sch-text-muted:    #6b7280;
    --sch-border:        #e0d9ce;
    --sch-shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --sch-shadow-md:     0 4px 12px rgba(0,0,0,.08);
    --sch-radius:        .5rem;
    --sch-sidebar-w:     240px;
    --sch-header-h:      56px;
}

/* --- Base ------------------------------------------------------------------ */
body {
    background-color: var(--sch-sand);
    color: var(--sch-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .9375rem;
}

a { color: var(--sch-emerald-light); }
a:hover { color: var(--sch-emerald); }

/* --- Sidebar --------------------------------------------------------------- */
.sch-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sch-sidebar-w);
    height: 100vh;
    background-color: var(--sch-emerald);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1030;
}

.sch-sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sch-sidebar-brand .brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
    text-decoration: none;
    display: block;
}

.sch-sidebar-brand .brand-name:hover { color: #fff; }

.sch-sidebar-brand .workspace-label {
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    margin-top: .2rem;
    display: block;
}

.sch-sidebar-brand .org-name {
    font-size: .82rem;
    color: rgba(255,255,255,.75);
    margin-top: .15rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav sections */
.sch-nav-section {
    padding: .75rem 0 .25rem;
}

.sch-nav-section-label {
    font-size: .67rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    padding: 0 1.25rem .35rem;
    display: block;
}

.sch-nav-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .48rem 1.25rem;
    font-size: .875rem;
    color: rgba(255,255,255,.8);
    text-decoration: none;
    border-radius: 0;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}

.sch-nav-link:hover {
    background-color: rgba(255,255,255,.08);
    color: #fff;
    text-decoration: none;
}

.sch-nav-link.active {
    background-color: rgba(255,255,255,.14);
    color: #fff;
    border-left-color: #fff;
    font-weight: 500;
}

.sch-nav-link svg,
.sch-nav-link .nav-icon {
    width: 16px;
    height: 16px;
    opacity: .75;
    flex-shrink: 0;
}

.sch-nav-link.active svg,
.sch-nav-link.active .nav-icon { opacity: 1; }

/* Sidebar footer */
.sch-sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.12);
    font-size: .8rem;
    color: rgba(255,255,255,.5);
}

/* --- Header ---------------------------------------------------------------- */
.sch-header {
    position: fixed;
    top: 0;
    left: var(--sch-sidebar-w);
    right: 0;
    height: var(--sch-header-h);
    background-color: var(--sch-white);
    border-bottom: 1px solid var(--sch-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1020;
    gap: 1rem;
}

.sch-header .page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sch-text);
    margin: 0;
    flex: 1;
}

.sch-header .header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sch-header .user-pill {
    font-size: .82rem;
    color: var(--sch-text-muted);
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* --- Main content ---------------------------------------------------------- */
.sch-main {
    margin-left: var(--sch-sidebar-w);
    margin-top: var(--sch-header-h);
    padding: 1.75rem;
    min-height: calc(100vh - var(--sch-header-h));
}

/* --- Cards ----------------------------------------------------------------- */
.sch-card {
    background: var(--sch-white);
    border: 1px solid var(--sch-border);
    border-radius: var(--sch-radius);
    box-shadow: var(--sch-shadow);
}

.sch-card-header {
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid var(--sch-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sch-card-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--sch-text);
    margin: 0;
}

.sch-card-body {
    padding: 1.25rem;
}

/* --- Stat cards ------------------------------------------------------------ */
.sch-stat-card {
    background: var(--sch-white);
    border: 1px solid var(--sch-border);
    border-radius: var(--sch-radius);
    box-shadow: var(--sch-shadow);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.sch-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: .4rem;
    background-color: var(--sch-emerald-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sch-stat-icon svg { color: var(--sch-emerald); }

.sch-stat-label {
    font-size: .75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sch-text-muted);
    margin-bottom: .2rem;
}

.sch-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--sch-text);
}

.sch-stat-sub {
    font-size: .75rem;
    color: var(--sch-text-muted);
    margin-top: .2rem;
}

/* --- Buttons --------------------------------------------------------------- */
.btn-sch-primary {
    background-color: var(--sch-emerald);
    border-color: var(--sch-emerald);
    color: #fff;
    font-weight: 500;
}

.btn-sch-primary:hover,
.btn-sch-primary:focus {
    background-color: var(--sch-emerald-mid);
    border-color: var(--sch-emerald-mid);
    color: #fff;
}

.btn-sch-outline {
    background-color: transparent;
    border-color: var(--sch-emerald);
    color: var(--sch-emerald);
    font-weight: 500;
}

.btn-sch-outline:hover {
    background-color: var(--sch-emerald);
    color: #fff;
}

/* --- Tables ---------------------------------------------------------------- */
.sch-table {
    width: 100%;
    margin: 0;
}

.sch-table thead th {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--sch-text-muted);
    border-top: none;
    border-bottom: 1px solid var(--sch-border);
    padding: .65rem 1rem;
    background-color: #faf8f4;
}

.sch-table tbody td {
    font-size: .875rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--sch-border);
    vertical-align: middle;
    color: var(--sch-text);
}

.sch-table tbody tr:last-child td { border-bottom: none; }

.sch-table tbody tr:hover td { background-color: #faf8f4; }

/* --- Empty state ----------------------------------------------------------- */
.sch-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--sch-text-muted);
}

.sch-empty-state .empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: .35;
    color: var(--sch-emerald);
}

.sch-empty-state .empty-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--sch-text);
    margin-bottom: .35rem;
}

.sch-empty-state .empty-desc {
    font-size: .8375rem;
    margin-bottom: 1.25rem;
}

/* --- Alerts / flash -------------------------------------------------------- */
.sch-alert {
    border-radius: var(--sch-radius);
    padding: .75rem 1rem;
    font-size: .875rem;
    border: 1px solid transparent;
}

.sch-alert-success {
    background-color: #e8f5e9;
    border-color: #c8e6c9;
    color: #1b5e20;
}

.sch-alert-danger {
    background-color: #fce4ec;
    border-color: #f8bbd0;
    color: #880e4f;
}

.sch-alert-warning {
    background-color: #fff8e1;
    border-color: #ffe082;
    color: #6d4c00;
}

.sch-alert-info {
    background-color: var(--sch-emerald-pale);
    border-color: #b2dfdb;
    color: var(--sch-emerald);
}

/* --- Badges ---------------------------------------------------------------- */
.badge-coop {
    background-color: var(--sch-emerald-pale);
    color: var(--sch-emerald);
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: .04em;
    padding: .2em .6em;
    border-radius: .25rem;
}

.badge-learning {
    background-color: #e8f0fe;
    color: #1a3a6a;
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: .04em;
    padding: .2em .6em;
    border-radius: .25rem;
}

/* --- Status badges --------------------------------------------------------- */
.sch-status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    font-weight: 500;
    padding: .2em .65em;
    border-radius: 99px;
}

.sch-status-active   { background: #e8f5e9; color: #1b5e20; }
.sch-status-inactive { background: #f5f5f5; color: #555; }
.sch-status-pending  { background: #fff8e1; color: #6d4c00; }
.sch-status-paid     { background: #e8f5e9; color: #1b5e20; }
.sch-status-unpaid   { background: #fce4ec; color: #880e4f; }
.sch-status-partial  { background: #fff8e1; color: #6d4c00; }
.sch-status-void     { background: #f5f5f5; color: #555; }

/* --- Auth layout ----------------------------------------------------------- */
.sch-auth-page {
    min-height: 100vh;
    background-color: var(--sch-sand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sch-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--sch-white);
    border: 1px solid var(--sch-border);
    border-radius: var(--sch-radius);
    box-shadow: var(--sch-shadow-md);
    padding: 2rem 2rem 1.75rem;
}

.sch-auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.sch-auth-brand .brand-wordmark {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sch-emerald);
    letter-spacing: -.02em;
    text-decoration: none;
}

.sch-auth-brand .brand-tagline {
    font-size: .78rem;
    color: var(--sch-text-muted);
    margin-top: .15rem;
}

/* --- Mobile ------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .sch-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sch-sidebar.open {
        transform: translateX(0);
    }
    .sch-header {
        left: 0;
    }
    .sch-main {
        margin-left: 0;
    }
    .sch-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 1025;
    }
    .sch-sidebar-overlay.open { display: block; }
}

/* --- Print stub (Phase 6) ------------------------------------------------ */
@media print {
    .sch-sidebar,
    .sch-header,
    .no-print {
        display: none !important;
    }
    .sch-main {
        margin: 0;
        padding: 0;
    }
}

/* --- Workspace Switcher ---------------------------------------------------- */
.sch-workspace-switcher {
    padding: .5rem 1.25rem .6rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sch-workspace-label {
    font-size: .67rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    margin-bottom: .35rem;
}

.sch-workspace-option {
    display: block;
    padding: .3rem .65rem;
    border-radius: .3rem;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    color: rgba(255,255,255,.7);
    transition: background .15s, color .15s;
    margin-bottom: .15rem;
    cursor: pointer;
}

a.sch-workspace-option:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    text-decoration: none;
}

.sch-workspace-option.active {
    background: rgba(255,255,255,.18);
    color: #fff;
    font-weight: 600;
}

/* Locked: org does not have access to this product */
.sch-workspace-option.disabled {
    color: rgba(255,255,255,.25);
    cursor: not-allowed;
    font-style: italic;
}

/* --- Pagination ----------------------------------------------------------- */
nav[aria-label="Pagination Navigation"] {
    margin-top: 1rem;
}

nav[aria-label="Pagination Navigation"] .pagination {
    flex-wrap: wrap;
    gap: .2rem;
    margin-bottom: 0;
}

nav[aria-label="Pagination Navigation"] .page-link {
    min-width: 2.25rem;
    text-align: center;
}
.activity-log-table > :not(caption) > * > * {
    padding: .4rem .55rem;
}

.activity-log-table code {
    font-size: .72rem;
}

.sch-search-loading {
    opacity: .65;
    transition: opacity .12s ease;
}

.progress-report-sheet {
    --report-ink: #18242d;
    --report-border: #6f7880;
    width: min(100%, 11in);
    min-height: 8.5in;
    margin: 0 auto;
    padding: .55in;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10.5pt;
    line-height: 1.3;
    box-shadow: 0 .25rem 1rem rgba(28, 39, 47, .14);
}

.progress-report-school-header {
    text-align: center;
    line-height: 1.25;
}

.progress-report-school-name {
    font-size: 15pt;
    font-weight: 700;
}

.progress-report-school-address {
    margin-top: 2px;
    font-size: 9.5pt;
}

.progress-report-school-contact {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 2px;
    font-size: 9pt;
}

.progress-report-title {
    margin: .28in 0 .18in;
    color: var(--report-ink);
    text-align: center;
    font-size: 21pt;
    font-weight: 700;
}

.progress-report-identity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: .18in;
    border: 1px solid var(--report-border);
}

.progress-report-identity-column {
    padding: .08in .1in;
}

.progress-report-identity-column + .progress-report-identity-column {
    border-left: 1px solid var(--report-border);
}

.progress-report-identity-column div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: .08in;
    padding: 2px 0;
}

.progress-report-identity strong {
    color: var(--report-ink);
    white-space: nowrap;
}

.progress-report-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 9.25pt;
}

.progress-report-table th {
    padding: .08in .07in;
    border: 1px solid var(--report-border);
    background: var(--report-ink);
    color: #fff;
    text-align: center;
    font-size: 9.5pt;
}

.progress-report-table td {
    padding: .08in .07in;
    border: 1px solid var(--report-border);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.progress-report-subject-column { width: 18%; }
.progress-report-grade-column { width: 12%; }
.progress-report-teacher-column { width: 18%; }
.progress-report-feedback-column { width: 52%; }

.progress-report-subject { font-weight: 700; }

.progress-report-grade {
    font-weight: 700;
    text-align: center;
    font-size: 11pt;
}

.progress-report-feedback {
    white-space: normal;
}

.progress-report-detail {
    margin-top: .06in;
    font-size: 8.5pt;
}

.progress-report-administrative {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .15in;
    margin-top: .18in;
}

.progress-report-administrative-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.progress-report-administrative-table th,
.progress-report-administrative-table td {
    border: 1px solid var(--report-border);
}

.progress-report-administrative-table th {
    padding: .06in;
    background: var(--report-ink);
    color: #fff;
    text-align: center;
    font-size: 9.5pt;
}

.progress-report-administrative-table td {
    height: .8in;
    padding: .08in;
    vertical-align: bottom;
}

.progress-report-signature-line {
    display: block;
    width: 100%;
    border-bottom: 1px solid #333;
}

@media (max-width: 700px) {
    .progress-report-identity,
    .progress-report-administrative {
        grid-template-columns: 1fr;
    }
    .progress-report-identity-column + .progress-report-identity-column {
        border-top: 1px solid var(--report-border);
        border-left: 0;
    }
    .progress-report-school-contact {
        flex-direction: column;
        gap: 0;
    }
}

@media print {
    @page {
        size: Letter landscape;
        margin: .45in;
    }
    .progress-report-sheet {
        width: 100%;
        min-height: auto;
        padding: 0;
        box-shadow: none;
    }
    .progress-report-table thead {
        display: table-header-group;
    }
    .progress-report-table tr,
    .progress-report-administrative {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
