/* ============================================================
   AFLS Assessment - Complete Stylesheet
   ============================================================ */

/* ------------------------------------------------------------
   1. Print layout (A4)
   ------------------------------------------------------------ */
@page { size: A4 landscape; margin: 6mm; }

@media print {
  @page { size: A4 landscape; margin: 0; }
  .no-print { display: none !important; }
  nav { display: none !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { height: auto !important; margin: 0 !important; padding: 0 !important; background: white !important; }
  .bg-white.rounded-lg.shadow-md,
  .card { box-shadow: none !important; }
}

.print-only { display: none; }

/* ------------------------------------------------------------
   1b. DESIGN SYSTEM — semantic components for the pastel theme
   ------------------------------------------------------------
   Paired with the tailwind.config token block in templates/base.html.

   Layer rule: these are plain, single-class rules, and the Tailwind CDN
   injects its utilities AFTER this file, so on the same element a Tailwind
   utility (e.g. `px-6`, `shadow-md`, `bg-blue-700`) WINS over these.
   Templates must therefore use a component class INSTEAD of the utilities
   it replaces, not alongside them.
   ------------------------------------------------------------ */

/* Page furniture ------------------------------------------------ */
.page-title {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: #202044;
}
.section-title {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #202044;
}
.eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #63638a;
}

.card {
    background: #ffffff;
    border: 1px solid #e8e5f4;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(32, 32, 68, 0.05), 0 12px 32px -20px rgba(32, 32, 68, 0.28);
}
.card-interactive { transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.card-interactive:hover {
    transform: translateY(-2px);
    border-color: #d9ccff;
    box-shadow: 0 2px 6px rgba(32, 32, 68, 0.07), 0 20px 44px -24px rgba(32, 32, 68, 0.35);
}

/* Navigation ---------------------------------------------------- */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #4a4a72;
    text-decoration: none;
    transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.nav-link:hover { background: #ffffff; color: #4b35b0; box-shadow: 0 1px 2px rgba(32, 32, 68, 0.1); }
.nav-link:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(139, 118, 245, 0.4); }
.nav-link-active,
.nav-link-active:hover { background: #e9e2ff; color: #4b35b0; }

/* Buttons ------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border-radius: 0.9rem;
    border: 1px solid transparent;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
    transition: transform 0.15s ease, box-shadow 0.15s ease,
                background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(139, 118, 245, 0.45); }

.btn-primary { background: #4f46e5; color: #ffffff; box-shadow: 0 8px 20px -12px rgba(79, 70, 229, 0.9); }
.btn-primary:hover { background: #4338ca; }

.btn-lily   { background: #e9e2ff; color: #4b35b0; border-color: #7563f0; }
.btn-lily:hover   { background: #ddd2ff; }
.btn-mint   { background: #d5f6e5; color: #0e6b49; border-color: #28a068; }
.btn-mint:hover   { background: #c4efd9; }
.btn-sky    { background: #dbedff; color: #23588f; border-color: #3f8fd8; }
.btn-sky:hover    { background: #cce4fb; }
.btn-peach  { background: #ffe6d7; color: #9a4a1c; border-color: #d96414; }
.btn-peach:hover  { background: #ffdbc8; }
.btn-butter { background: #fff2c9; color: #7d5c06; border-color: #e5b423; }
.btn-butter:hover { background: #ffe79a; }
.btn-rose   { background: #ffe1ea; color: #a72a52; border-color: #e0426f; }
.btn-rose:hover   { background: #ffd5e1; }

.btn-ghost { background: #ffffff; color: #3f3f6b; border-color: #918eb3; }
.btn-ghost:hover { background: #f5f1ff; border-color: #7563f0; color: #4b35b0; }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.875rem; min-height: 36px; border-radius: 0.75rem; }
.btn-block { width: 100%; }

/* Fields -------------------------------------------------------- */
.field {
    width: 100%;
    min-height: 44px;
    padding: 0.62rem 0.9rem;
    border: 1px solid #918eb3;   /* >=3:1 vs the white card (WCAG 1.4.11) */
    border-radius: 0.75rem;
    background: #fbfaff;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #202044;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.field::placeholder { color: #6f6f94; font-weight: 400; }  /* 4.6:1 on #fbfaff */
.field:hover { border-color: #8b88ad; }
.field:focus {
    outline: none;
    border-color: #8b76f5;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(139, 118, 245, 0.25);
}

/* Links --------------------------------------------------------- */
.link { color: #4b35b0; font-weight: 700; text-decoration: none; border-radius: 0.2rem; }
.link:hover { text-decoration: underline; }
.link-mint { color: #0e6b49; }
.link-sky { color: #23588f; }
.link-rose { color: #a72a52; }

/* Badges & pills ------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.badge-lily   { background: #e9e2ff; color: #4b35b0; }
.badge-mint   { background: #d5f6e5; color: #0e6b49; }
.badge-sky    { background: #dbedff; color: #23588f; }
.badge-peach  { background: #ffe6d7; color: #9a4a1c; }
.badge-butter { background: #fff2c9; color: #7d5c06; }
.badge-rose   { background: #ffe1ea; color: #a72a52; }
.badge-neutral { background: #eeedf6; color: #55557a; }

/* Dashboard metrics --------------------------------------------- */
.metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1rem 1.15rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.metric:hover {
    border-color: #d9ccff;
    box-shadow: 0 2px 6px rgba(32, 32, 68, 0.07), 0 20px 44px -24px rgba(32, 32, 68, 0.35);
}
.metric-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #63638a;
}
.metric-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #202044;
    margin-top: 0.3rem;
}
.metric-note {
    font-size: 0.78rem;
    color: #63638a;
    margin-top: 0.15rem;
}

/* Week strip: server-rendered bars, no chart library. */
.week-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: end;
}
.week-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}
.week-track {
    width: 100%;
    height: 84px;
    display: flex;
    align-items: flex-end;
    background: transparent;
    border-bottom: 2px solid #eeedf6;
}
.week-fill {
    width: 100%;
    background: #ffe79a;
    border-radius: 0.45rem 0.45rem 0 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.week-done {
    display: block;
    width: 100%;
    background: #85e4b8;
    border-radius: 0.45rem 0.45rem 0 0;
}
.week-count {
    font-size: 0.74rem;
    font-weight: 800;
    color: #202044;
    min-height: 1em;
}
.week-day {
    font-size: 0.7rem;
    font-weight: 800;
    color: #63638a;
}
.week-day.is-today { color: #4b35b0; }
.week-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    display: inline-block;
}
.week-dot-done { background: #85e4b8; }
.week-dot-ahead { background: #ffe79a; }

/* Phone: keep the four metric labels the same height so the values align,
   and satisfy the 44px tap-target rule for compact buttons. */
@media (max-width: 640px) {
    .metric-label { min-height: 2.2em; line-height: 1.1; }
    .btn-sm { min-height: 44px; }
}

/* Learner roster: scannable rows, not cards. */
.meter {
    height: 6px;
    background: #e9e2ff;
    border-radius: 999px;
    overflow: hidden;
}
.meter-fill {
    display: block;
    height: 100%;
    background: #8b76f5;
    border-radius: 999px;
}
.learner-row { text-decoration: none; }
.learner-head {
    background: #faf9ff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #63638a;
}

/* Auth backdrop — soft pastel wash behind the login cards.
   A CSS gradient rather than an SVG so it never crops or distorts at any
   viewport; the decorative objects live in partials/auth_scene.html. */
.auth-bg {
    background:
        radial-gradient(58rem 40rem at 6% -12%, #e9e2ff 0%, rgba(233, 226, 255, 0) 62%),
        radial-gradient(52rem 38rem at 104% -4%, #dbedff 0%, rgba(219, 237, 255, 0) 60%),
        radial-gradient(46rem 40rem at -6% 104%, #d5f6e5 0%, rgba(213, 246, 229, 0) 58%),
        radial-gradient(50rem 42rem at 106% 102%, #ffe6d7 0%, rgba(255, 230, 215, 0) 60%),
        radial-gradient(38rem 26rem at 50% 114%, #ffe1ea 0%, rgba(255, 225, 234, 0) 62%),
        #fbfaff;
}

/* ------------------------------------------------------------
   2. Report grid (screen)
   ------------------------------------------------------------ */
.report-grid { display: grid; gap: 10px; align-items: stretch; }

@media (max-width: 1200px) { .report-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .report-grid { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------
   3. Report block-based score visualization
   ------------------------------------------------------------ */
.report-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    margin: 0;
    padding: 2px 0;
    border-bottom: 1px solid #f0f0f0;
}

.report-category-title { line-height: 1.2; }

.category-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }

.item-code {
    font-size: 7px;
    color: #6b7280;
    white-space: nowrap;
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
    line-height: 1;
}

.segmented-bar {
    display: flex;
    width: 100%;
    height: 10px;
    gap: 2px;
    --seg-count: 3;
}

.segment {
    flex: 1 1 0;
    height: 100%;
    border-radius: 1px;
}

.segment.empty { background: #eae8f4; }
.segment.unmeasured { background: transparent; border: 1px solid #918ead; }
.segment.filled-green { background: #28a068; }
.segment.filled-orange { background: #d96414; }
.segment.filled-blue { background: #3f8fd8; }
.segment.filled-purple { background: #8b76f5; }
.segment.filled-stale { background: #918ead; }

/* ------------------------------------------------------------
   4. Assessment detail grid
   ------------------------------------------------------------ */
.assessment-detail { max-width: 1400px; margin: 0 auto; }

.assessment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.assessment-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
}

.meta-value {
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
    margin-top: 2px;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    transition: all 0.15s ease;
    margin-bottom: -2px;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.tab-btn.active {
    background: white;
    border-color: #e2e8f0;
    color: #1d4ed8;
    font-weight: 600;
}

.tab-btn .score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-left: 6px;
    color: white;
}

.score-badge.complete { background: #22c55e; }
.score-badge.partial { background: #f97316; }
.score-badge.empty { background: #d1d5db; }

/* ------------------------------------------------------------
   5. Items table
   ------------------------------------------------------------ */
.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.items-table th {
    background: #f8fafc;
    font-weight: 600;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.items-table td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.items-table tr:hover { background: #f8fafc; }

.item-label {
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.4;
}

.score-label {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.score-label.none { background: #f1f5f9; color: #94a3b8; }
.score-label.yes { background: #dcfce7; color: #166534; }
.score-label.no { background: #fee2e2; color: #991b1b; }
.score-label.partial { background: #ffedd5; color: #9a3412; }
.score-label.mastered { background: #22c55e; color: white; }

.last-assessed {
    font-size: 0.75rem;
    color: #94a3b8;
}

.last-assessed.stale {
    color: #ef4444;
    font-weight: 600;
}

/* ------------------------------------------------------------
   6. Answer boxes (2-box and 4-box)
   ------------------------------------------------------------ */
.answer-boxes {
    display: flex;
    gap: 6px;
}

.answer-box {
    width: 32px;
    height: 32px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    background: white;
    user-select: none;
}

.answer-box:hover { border-color: #3b82f6; background: #eff6ff; }

.answer-box.selected {
    border-color: #2563eb;
    background: #2563eb;
    color: white;
}

.answer-box.selected-yes { border-color: #22c55e; background: #22c55e; color: white; }
.answer-box.selected-no { border-color: #ef4444; background: #ef4444; color: white; }
.answer-box.selected-partial { border-color: #f97316; background: #f97316; color: white; }

/* 4-box: 0,1,2,3 box styling */
.answer-box.box-0 { }
.answer-box.box-1.selected { border-color: #22c55e; background: #22c55e; color: white; }
.answer-box.box-2.selected { border-color: #f97316; background: #f97316; color: white; }
.answer-box.box-3.selected { border-color: #3b82f6; background: #3b82f6; color: white; }

/* ------------------------------------------------------------
   7. Form elements
   ------------------------------------------------------------ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid #918eb3;
    border-radius: 12px;
    font-size: 0.875rem;
    background: #fbfaff;
    color: #202044;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #8b76f5;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(139, 118, 245, 0.22);
}

/* ------------------------------------------------------------
   8. Utilities
   ------------------------------------------------------------ */
.bg-gray-50 { background-color: #f9fafb; }
.text-gray-500 { color: #6b7280; }
.text-green-500 { color: #22c55e; }
.text-orange-500 { color: #f97316; }
.text-blue-500 { color: #3b82f6; }

.stale-indicator {
    display: inline-block;
    width: 8px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.stale-indicator.fresh { background: #22c55e; }
.stale-indicator.warning { background: #f97316; }
.stale-indicator.stale { background: #ef4444; }

/* ------------------------------------------------------------
   9. Base layout
   ------------------------------------------------------------ */
.full-viewport-height {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.flex-grow { flex-grow: 1; }

.wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ------------------------------------------------------------
   10. Navigation bar
   ------------------------------------------------------------ */
.nav-bar {
    background: #1e40af;
    color: white;
    padding: 0.75rem 0;
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 700;
}

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

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.875rem;
}

.nav-links a:hover { color: white; text-decoration: underline; }



/* ------------------------------------------------------------
   12. ABLLS-R Scoring Radio Styles
   ------------------------------------------------------------ */
.score-label.score-not-yet { background: #eeedf6; color: #55557a; }
.score-label.score-emerging { background: #fff2c9; color: #7d5c06; }
.score-label.score-developing { background: #ffe6d7; color: #9a4a1c; }
.score-label.score-proficient { background: #dbedff; color: #23588f; }
.score-label.score-mastered { background: #d5f6e5; color: #0e6b49; }

/* selected states */
input[type="radio"]:checked + .radio-dot + .radio-text,
.score-label input[type="radio"]:checked ~ .radio-text {
    font-weight: 700;
}
.score-label.score-not-yet input[type="radio"]:checked ~ .radio-dot { background: #55557a; }
.score-label.score-emerging input[type="radio"]:checked ~ .radio-dot { background: #7d5c06; }
.score-label.score-developing input[type="radio"]:checked ~ .radio-dot { background: #9a4a1c; }
.score-label.score-proficient input[type="radio"]:checked ~ .radio-dot { background: #23588f; }
.score-label.score-mastered input[type="radio"]:checked ~ .radio-dot { background: #0e6b49; }

/* ------------------------------------------------------------
   13. Protocol Tab Active Style
   ------------------------------------------------------------ */
.category-tab.tab-active {
    background: #e9e2ff;
    color: #4b35b0;
    font-weight: 700;
    border-bottom: 3px solid #8b76f5;
}

.category-tab {
    cursor: pointer;
    transition: all 0.15s ease;
    color: #63638a;
}

.category-tab:hover {
    background: #f5f1ff;
    color: #4b35b0;
}

/* ------------------------------------------------------------
   14. Progress bar
   ------------------------------------------------------------ */
.progress-bar-track {
    background: #eae8f4;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #1a8a58, #3684cf);  /* >=3:1 vs the #eae8f4 track */
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ------------------------------------------------------------
   15. Radio button styling for score labels
   ------------------------------------------------------------ */
.checklist-item {
    transition: all 0.15s ease;
}

.checklist-item:hover {
    border-color: #d9ccff;
    background: #f5f1ff;
}

.radio-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid currentColor;
    flex-shrink: 0;
}

.score-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.score-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.score-label.score-not-mastered { background: #eeedf6; color: #55557a; }
.score-label.score-prompted { background: #fff2c9; color: #7d5c06; }
.score-label.score-partial { background: #ffe6d7; color: #9a4a1c; }
.score-label.score-independent { background: #dbedff; color: #23588f; }

.score-label input[type="radio"]:checked + .radio-dot,
.score-label input[type="radio"]:checked ~ .radio-dot {
    background: currentColor;
}

.score-label:has(input[type="radio"]:checked) {
    box-shadow: 0 0 0 2px currentColor;
    font-weight: 700;
}

.reassessment-banner {
    background: #fff2c9;
    border: 1px solid #ffe79a;
    border-radius: 0.75rem;
    padding: 8px 14px;
    font-size: 0.8125rem;
    color: #7d5c06;
}

.btn-save-draft {
    transition: all 0.15s ease;
}

.btn-save-draft:hover {
    background: #4338ca;
}



/* ------------------------------------------------------------
   17. Parent Access Styles
   ------------------------------------------------------------ */
.parent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dcfce7;
    color: #166534;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.parent-login-container {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parent-login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

.parent-login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.25rem;
    color: #166534;
}

.parent-login-card .subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.parent-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.parent-dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.parent-logout-btn {
    background: #dc2626;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background 0.15s ease;
}

.parent-logout-btn:hover {
    background: #b91c1c;
}

/* ------------------------------------------------------------
   18. Printable report sheet — one .print-sheet == one A4 page
   ------------------------------------------------------------
   templates/report_print.html loads ONLY this stylesheet (there is no
   Tailwind CDN on that page), so the sheet layout has to be real,
   page-box-aware CSS instead of inert utility classes.

   Everything is scoped to body.report-print / .print-sheet so the
   on-screen report (base.html + Tailwind) is byte-for-byte unchanged.
   One section == one physical A4 landscape sheet; ABLLS-R emits several
   sections that break cleanly with a repeated header and summary.
   ------------------------------------------------------------ */
.report-print {
    --sheet-w: 297mm;
    --sheet-h: 210mm;
    --sheet-pad-x: 8mm;
    --sheet-pad-top: 6mm;
    --sheet-pad-bottom: 5.5mm;
    --item-row-h: 14px;
    --bar-h: 8px;
    --item-font: 7px;
    --grid-gap: 1.3mm;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #202044;
    background: #ffffff;
}

/* ABLLS-R packs 25 domains / 544 items: tighter rows and 5 readable columns
   per sheet, never 25 unreadable strips and never a clipped column. */
.report-print.protocol-ablls_r {
    --item-row-h: 10px;
    --bar-h: 6px;
    --item-font: 6.5px;
}

.print-sheet {
    box-sizing: border-box;
    width: var(--sheet-w);
    height: var(--sheet-h);
    padding: var(--sheet-pad-top) var(--sheet-pad-x) var(--sheet-pad-bottom);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}
/* Break BETWEEN sheets, never after the last one (that would emit a blank
   trailing page). */
.print-sheet + .print-sheet { break-before: page; page-break-before: always; }

/* Header ---------------------------------------------------- */
.print-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4mm;
    border-bottom: 0.6mm solid #e8e5f4;
    padding-bottom: 1.4mm;
    margin-bottom: 1.6mm;
}
.print-head-main { flex: 1 1 auto; min-width: 0; }
.print-brand {
    margin: 0;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8b76f5;
}
.print-title {
    margin: 0.4mm 0 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #202044;
}
.print-subtitle { margin: 0.4mm 0 0; font-size: 8px; color: #63638a; }
.print-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5mm 5mm;
    margin-top: 1.1mm;
    font-size: 8.5px;
    color: #3b3b5c;
}
.print-meta b { font-weight: 700; color: #202044; }
.print-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2mm;
    margin: 0.8mm 0 0;
    font-size: 7.5px;
    color: #63638a;
}
.print-draft {
    display: inline-block;
    padding: 0.3mm 1.6mm;
    border: 0.25mm solid #d99a1f;
    border-radius: 999px;
    background: #fff9ec;
    color: #8a5f00;
    font-size: 6.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.print-notes {
    max-width: 150mm;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.print-page-no {
    flex: 0 0 auto;
    padding-top: 0.6mm;
    font-size: 7.5px;
    font-weight: 700;
    color: #63638a;
    white-space: nowrap;
}

/* Category grid --------------------------------------------- */
.print-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: var(--grid-gap);
    align-items: stretch;
}
.print-grid .category-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border: 0.25mm solid #e8e5f4;
    border-radius: 1.4mm;
    padding: 1.1mm 1.2mm;
    background: #ffffff;
}
.print-col-title {
    flex: 0 0 auto;
    margin-bottom: 1mm;
    padding: 0.6mm 0.8mm;
    border-radius: 1mm;
    background: #f4f1ff;
    text-align: center;
    line-height: 1.1;
}
.print-col-code { display: block; font-size: 8px; font-weight: 800; color: #202044; }
.print-col-name { display: block; margin-top: 0.2mm; font-size: 6.5px; font-weight: 600; color: #63638a; }

.items-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.print-grid .report-item {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.8mm;
    height: var(--item-row-h);
    box-sizing: border-box;
    padding: 0;
    border-bottom: 0.2mm solid #f2f0fa;
}
.print-grid .item-code {
    flex: 0 0 auto;
    min-width: 8.5mm;
    font-size: var(--item-font);
    line-height: 1;
    text-align: right;
    white-space: nowrap;
    color: #6b7280;
}
.print-grid .segmented-bar {
    display: flex;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: var(--bar-h);
    gap: 0.4mm;
}
.print-grid .segment { flex: 1 1 0; height: 100%; border-radius: 0.3mm; }

.print-col-foot {
    flex: 0 0 auto;
    margin-top: 0.8mm;
    padding-top: 0.6mm;
    border-top: 0.2mm solid #e8e5f4;
    text-align: center;
    font-size: 6.5px;
    font-weight: 800;
    color: #3b3b5c;
}

/* Overall summary footer ------------------------------------ */
.print-foot {
    flex: 0 0 auto;
    margin-top: 1.5mm;
    padding-top: 1.3mm;
    border-top: 0.6mm solid #e8e5f4;
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    color: #202044;
}
