/* =====================================================
   Parent System Styles
   Giao diện phụ huynh - tươi sáng, thân thiện
   ===================================================== */

/* ---- Layout ---- */
.parent-body {
    font-family: 'Quicksand', 'Baloo 2', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #1a1a2e;
}

.parent-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
}

/* ---- Flash Messages ---- */
.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 15px;
    animation: flashSlide 0.4s ease-out;
}

@keyframes flashSlide {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.flash-success {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-icon {
    font-size: 18px;
}

/* ---- Auth Pages (Register/Login) ---- */
.parent-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px 0;
}

.parent-auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 36px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
                0 4px 16px rgba(0, 0, 0, 0.1);
}

.parent-auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.parent-auth-logo {
    font-size: 52px;
    margin-bottom: 10px;
    animation: logoBounce 2s ease-in-out infinite;
}

@keyframes logoBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.parent-auth-title {
    font-family: 'Baloo 2', cursive;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 6px;
}

.parent-auth-title .accent {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.parent-auth-subtitle {
    color: #6b7280;
    font-size: 15px;
    margin: 0;
}

/* ---- Form Elements ---- */
.parent-auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group-parent {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label-parent {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.form-label-parent .required {
    color: #ef4444;
}

.form-label-parent .optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 12px;
}

.form-input-parent {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #f9fafb;
    color: #1f2937;
}

.form-input-parent:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.form-input-parent::placeholder {
    color: #b0b8c4;
}

.form-input-lg {
    font-size: 22px;
    padding: 18px 20px;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 700;
}

.form-row-parent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-row-parent {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Kid-first parent home + custom questions
   Mobile is the primary layout.
   ===================================================== */
.parent-body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.parent-eyebrow {
    margin: 0 0 2px;
    color: #756ee5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.parent-header-compact {
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 18px;
}

.parent-header-compact .parent-avatar-emoji {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #f0efff;
    font-size: 26px;
}

.parent-header-compact .parent-greeting {
    font-size: 19px;
    line-height: 1.1;
}

.parent-header-compact .btn-parent-logout {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.children-grid.kid-children-grid {
    gap: 14px;
}

.child-card.kid-home-card {
    padding: 0;
    overflow: hidden;
    border-radius: 24px;
    transform: none !important;
}

.kid-card-main {
    padding: 18px;
    background:
        radial-gradient(circle at 92% 10%, rgba(255,255,255,.75) 0 7%, transparent 8%),
        linear-gradient(145deg, #fdfdff 0%, #f3f1ff 100%);
}

.kid-profile {
    position: relative;
    margin-bottom: 16px;
}

.kid-profile .child-avatar {
    width: 58px;
    height: 58px;
    border-radius: 19px;
    font-size: 28px;
    box-shadow: 0 6px 16px rgba(102, 126, 234, .28);
}

.kid-ready-label {
    margin: 0;
    color: #8b91a1;
    font-size: 12px;
    font-weight: 700;
}

.kid-profile .child-name {
    font-size: 25px;
    line-height: 1.1;
}

.kid-profile .child-class {
    margin-top: 2px;
}

.kid-card-stars {
    margin-left: auto;
    align-self: flex-start;
    font-size: 22px;
}

.kid-primary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 82px;
    padding: 14px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, #6c63e8, #8a5ee8);
    color: white;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(102, 89, 226, .32);
    -webkit-tap-highlight-color: transparent;
}

.kid-primary-action:active {
    transform: scale(.98);
}

.kid-primary-continue {
    background: linear-gradient(135deg, #f59e0b, #ec7f13);
    box-shadow: 0 8px 20px rgba(236, 127, 19, .28);
}

.kid-action-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 15px;
    background: rgba(255,255,255,.18);
    font-size: 25px;
}

.kid-primary-action strong,
.kid-primary-action small {
    display: block;
}

.kid-primary-action strong {
    font-family: 'Baloo 2', cursive;
    font-size: 23px;
    line-height: 1.1;
}

.kid-primary-action small {
    margin-top: 2px;
    color: rgba(255,255,255,.82);
    font-size: 12px;
    font-weight: 600;
}

.parent-zone {
    padding: 14px 16px 16px;
    border-top: 1px solid #ececf4;
    background: #fff;
}

.parent-zone-title {
    margin: 0 0 9px;
    color: #9095a4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.parent-zone-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.parent-zone-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 58px;
    padding: 9px 10px;
    border-radius: 13px;
    background: #f6f6fb;
    color: #303245;
    text-decoration: none;
}

.parent-zone-item.is-disabled {
    opacity: .55;
}

.parent-zone-icon {
    font-size: 20px;
}

.parent-zone-item strong,
.parent-zone-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.parent-zone-item strong {
    font-size: 14px;
}

.parent-zone-item small {
    color: #858a99;
    font-size: 10px;
}

.parent-quick-tools {
    margin-top: 12px;
    text-align: center;
}

.parent-tools-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    color: rgba(255,255,255,.92);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(8px);
}

.parent-tools-trigger::-webkit-details-marker {
    display: none;
}

.parent-tools-trigger:focus-visible {
    outline: 3px solid rgba(255,255,255,.5);
    outline-offset: 3px;
}

.parent-tools-chevron {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    transition: transform .2s ease;
}

.parent-quick-tools[open] .parent-tools-chevron {
    transform: rotate(180deg);
}

.parent-tools-panel {
    margin-top: 9px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 10px 30px rgba(45,35,104,.18);
    text-align: left;
}

.parent-quick-links {
    display: grid;
    gap: 8px;
}

.parent-quick-link {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 8px 10px;
    border-radius: 15px;
    background: #f1efff;
    color: #34304d;
    text-decoration: none;
}

.parent-quick-link-muted {
    background: #f5f6f8;
}

.quick-link-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: white;
    font-size: 20px;
}

.parent-quick-link strong,
.parent-quick-link small {
    display: block;
}

.parent-quick-link strong {
    font-size: 14px;
}

.parent-quick-link small {
    color: #858a99;
    font-size: 11px;
}

.quick-link-arrow {
    color: #7771df;
    font-size: 28px;
}

.kid-empty-state {
    padding: 30px 20px;
}

.kid-empty-state > span {
    font-size: 48px;
}

.kid-empty-state h2 {
    margin: 8px 0 4px;
    color: #25273a;
    font-family: 'Baloo 2', cursive;
}

.kid-empty-state p {
    margin: 0 0 18px;
}

/* Parent question form */
.parent-questions-page {
    padding-bottom: 28px;
}

.parent-form-card,
.parent-custom-questions {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.parent-form-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.parent-form-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 15px;
    background: #f0efff;
    font-size: 23px;
}

.parent-form-heading h2,
.parent-list-heading h2 {
    margin: 0;
    color: #25273a;
    font-family: 'Baloo 2', cursive;
    font-size: 20px;
    line-height: 1.15;
}

.parent-form-heading p {
    margin: 3px 0 0;
    color: #747989;
    font-size: 12px;
}

.parent-question-form {
    display: grid;
    gap: 15px;
}

.parent-question-textarea {
    min-height: 92px;
    resize: vertical;
    box-sizing: border-box;
}

.parent-options-fieldset {
    display: grid;
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.parent-options-fieldset legend {
    margin-bottom: 9px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.parent-options-fieldset legend span {
    display: block;
    margin-top: 2px;
    color: #9297a6;
    font-size: 11px;
    font-weight: 500;
}

.parent-option-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.parent-option-row > input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-radio-ui {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid #d5d7df;
    border-radius: 50%;
    color: transparent;
    font-weight: 900;
    transition: .2s ease;
}

.parent-option-row > input[type="radio"]:checked + .option-radio-ui {
    border-color: #22a06b;
    background: #22a06b;
    color: white;
}

.parent-option-row > input[type="radio"]:focus-visible + .option-radio-ui {
    outline: 3px solid rgba(102,126,234,.25);
    outline-offset: 2px;
}

.parent-option-row .form-input-parent {
    min-width: 0;
    padding: 12px 13px;
}

.parent-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.parent-list-heading > span {
    padding: 5px 10px;
    border-radius: 999px;
    background: #f0efff;
    color: #625bd4;
    font-size: 12px;
    font-weight: 800;
}

.parent-question-list {
    display: grid;
    gap: 10px;
}

.parent-question-item {
    padding: 14px;
    border: 1px solid #ececf2;
    border-radius: 16px;
    background: #fafaff;
}

.parent-question-category {
    margin-bottom: 5px;
    color: #7069d8;
    font-size: 11px;
    font-weight: 800;
}

.parent-question-item h3 {
    margin: 0 0 10px;
    color: #303245;
    font-size: 15px;
    line-height: 1.4;
}

.parent-question-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.parent-question-options span {
    padding: 5px 9px;
    border-radius: 9px;
    background: #eff0f4;
    color: #616574;
    font-size: 11px;
}

.parent-question-options .is-correct {
    background: #ddf7e9;
    color: #147a4f;
    font-weight: 800;
}

.parent-empty.parent-empty-compact {
    padding: 18px 14px;
    background: #f7f7fb;
}

.parent-empty-compact p {
    margin: 0;
    font-size: 13px;
}

@media (min-width: 600px) {
    .parent-quick-links {
        grid-template-columns: 1fr 1fr;
    }

    .parent-form-card,
    .parent-custom-questions {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .parent-header.parent-header-compact {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .parent-header-compact .btn-parent-logout {
        align-self: center;
        margin-left: auto;
    }

    .parent-page-header {
        align-items: flex-start;
        gap: 10px;
    }

    .parent-page-title {
        font-size: 20px;
    }

    .parent-page-subtitle {
        font-size: 12px;
    }

    .btn-parent-back {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.form-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0;
}

.form-separator::before,
.form-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.form-separator span {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Buttons ---- */
.btn-parent-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-parent-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-parent-primary:active {
    transform: translateY(0);
}

.btn-parent-ghost {
    display: block;
    padding: 12px 20px;
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-parent-ghost:hover {
    border-color: #667eea;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.btn-full-width {
    width: 100%;
    box-sizing: border-box;
}

/* ---- Auth Footer & Divider ---- */
.parent-auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
}

.parent-link {
    color: #667eea;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.parent-link:hover {
    color: #764ba2;
}

.parent-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.parent-auth-divider::before,
.parent-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.parent-auth-divider span {
    color: #9ca3af;
    font-size: 13px;
}

.parent-errors {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.parent-errors p {
    color: #b91c1c;
    font-size: 14px;
    margin: 4px 0;
    font-weight: 500;
}

/* ---- Dashboard ---- */
.parent-dashboard {
    padding-bottom: 40px;
}

.parent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.parent-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.parent-avatar-emoji {
    font-size: 36px;
}

.parent-greeting {
    font-family: 'Baloo 2', cursive;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
}

.parent-phone {
    color: #6b7280;
    font-size: 13px;
    margin: 2px 0 0;
}

.btn-parent-logout {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-parent-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

.parent-section {
    margin-bottom: 24px;
}

.parent-section-title {
    font-family: 'Baloo 2', cursive;
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin: 0 0 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.parent-empty {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    color: #6b7280;
    font-size: 16px;
}

.parent-empty .empty-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

/* ---- Children Grid ---- */
.children-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .children-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.child-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.child-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.child-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.child-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: white;
    font-family: 'Baloo 2', cursive;
}

.child-name {
    font-family: 'Baloo 2', cursive;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
}

.child-class,
.child-school {
    display: block;
    color: #6b7280;
    font-size: 13px;
}

.child-card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 12px;
}

.child-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: 'Baloo 2', cursive;
    font-size: 24px;
    font-weight: 800;
    color: #667eea;
    line-height: 1;
}

.stat-score {
    color: #22c55e;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.child-in-progress {
    padding: 8px 14px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
    text-align: center;
}

.child-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-child-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-start {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.35);
}

.btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(102, 126, 234, 0.45);
}

.btn-continue {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.35);
}

.btn-continue:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(245, 158, 11, 0.45);
}

.btn-history {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.btn-history:hover {
    background: rgba(102, 126, 234, 0.2);
}

.btn-report {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.btn-report:hover {
    background: rgba(34, 197, 94, 0.2);
}

/* Add child card */
.child-card-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 160px;
    border: 3px dashed rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    text-decoration: none;
}

.child-card-add:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.8);
}

.add-child-icon {
    font-size: 36px;
    opacity: 0.6;
}

.add-child-text {
    font-weight: 600;
    color: #667eea;
    font-size: 15px;
    margin: 0;
}

/* ---- Tips ---- */
.parent-tips {
    margin-top: 20px;
}

.tip-card {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.tip-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* ---- Page Headers (History, Report) ---- */
.parent-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-parent-back {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-parent-back:hover {
    background: rgba(255, 255, 255, 1);
}

.parent-page-title {
    font-family: 'Baloo 2', cursive;
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.parent-page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 2px 0 0;
}

/* ---- History ---- */
.parent-history {
    padding-bottom: 40px;
}

.history-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.history-stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.history-stat-num {
    display: block;
    font-family: 'Baloo 2', cursive;
    font-size: 28px;
    font-weight: 800;
    color: #667eea;
    line-height: 1;
}

.history-stat-lbl {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.history-new-exam {
    margin-bottom: 24px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
}

.history-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.history-attempt {
    display: flex;
    align-items: center;
    gap: 12px;
}

.attempt-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    font-family: 'Baloo 2', cursive;
}

.history-attempt h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.history-date {
    font-size: 12px;
    color: #6b7280;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.status-done {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.status-progress {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.history-card-scores {
    margin-bottom: 14px;
}

.history-total-score {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.total-pct {
    font-family: 'Baloo 2', cursive;
    font-size: 26px;
    font-weight: 800;
    color: #667eea;
}

.total-label {
    color: #6b7280;
    font-size: 13px;
}

.history-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.history-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.fill-green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.fill-yellow { background: linear-gradient(90deg, #f59e0b, #d97706); }
.fill-red { background: linear-gradient(90deg, #ef4444, #dc2626); }

.history-category-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.category-mini-score {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 13px;
}

.cat-icon {
    font-size: 16px;
}

.cat-name {
    flex: 1;
    color: #374151;
    font-weight: 500;
}

.cat-pct {
    font-weight: 700;
    color: #667eea;
}

.history-card-actions {
    margin-top: 14px;
}

/* ---- Parent Report ---- */
.parent-report {
    padding-bottom: 40px;
}

.report-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 30px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.report-hero-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 16px;
}

.score-ring {
    width: 100%;
    height: 100%;
}

.score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-family: 'Baloo 2', cursive;
    font-size: 42px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.score-percent {
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
}

.report-hero-label {
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}

.hero-excellent {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 163, 74, 0.15));
    color: #15803d;
}

.hero-good {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
    color: #b45309;
}

.hero-support {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    color: #b91c1c;
}

.report-hero-label p {
    color: #6b7280;
    font-size: 14px;
    margin: 4px 0 0;
}

.report-section-title {
    font-family: 'Baloo 2', cursive;
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0 0 14px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.report-categories {
    margin-bottom: 24px;
}

.report-cat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--cat-color, #667eea);
}

.report-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.report-cat-header h3 {
    font-family: 'Baloo 2', cursive;
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
}

.report-cat-result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cat-pct-big {
    font-family: 'Baloo 2', cursive;
    font-size: 24px;
    font-weight: 800;
    color: var(--cat-color, #667eea);
    line-height: 1;
}

.cat-stars {
    display: flex;
    gap: 1px;
    font-size: 14px;
}

.star-empty {
    opacity: 0.2;
    filter: grayscale(1);
}

.report-cat-skills {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-name {
    flex: 0 0 120px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .skill-name {
        flex: 0 0 90px;
        font-size: 12px;
    }
}

.skill-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-bar-bg {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.skill-pct {
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    min-width: 36px;
    text-align: right;
}

/* Report Comment */
.report-comment-card {
    margin-bottom: 24px;
}

.report-comment-body {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
}

.report-comment-body p {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    margin: 6px 0;
}

/* Report Actions */
.report-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .parent-container {
        padding: 12px 10px;
    }

    .parent-auth-card {
        padding: 28px 20px;
        border-radius: 22px;
    }

    .parent-auth-title {
        font-size: 24px;
    }

    .parent-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-parent-logout {
        align-self: flex-end;
    }

    .parent-greeting {
        font-size: 18px;
    }

    .history-summary {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .history-stat-num {
        font-size: 22px;
    }
}

/* ---- Parent question bank management ---- */
.question-category-picker {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 4px 18px rgba(0,0,0,.07);
}

.question-category-picker > label {
    display: block;
    margin-bottom: 7px;
    color: #606474;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.question-category-form {
    display: grid;
    gap: 8px;
}

.parent-add-question {
    margin-bottom: 14px;
}

.parent-add-question > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 14px;
    background: rgba(255,255,255,.17);
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.parent-add-question > summary::-webkit-details-marker { display: none; }
.parent-add-question[open] > summary { margin-bottom: 9px; }
.parent-add-question .parent-form-card { margin-bottom: 0; }

.question-level-fieldset {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.question-level-fieldset legend {
    grid-column: 1 / -1;
    margin-bottom: 7px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.question-level-fieldset label { cursor: pointer; }
.question-level-fieldset input { position: absolute; opacity: 0; }

.question-level-fieldset label span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 9px;
    border: 2px solid #e4e5eb;
    border-radius: 13px;
    background: #fafafa;
    color: #616574;
    font-size: 13px;
    font-weight: 800;
    transition: .2s ease;
}

.question-level-fieldset input:checked + span {
    border-color: #6c63e8;
    background: #f0efff;
    color: #554ec7;
}

.question-level-fieldset input:focus-visible + span {
    outline: 3px solid rgba(102,126,234,.25);
    outline-offset: 2px;
}

.question-bank-section .parent-list-heading {
    align-items: flex-start;
}

.parent-list-heading p {
    margin: 3px 0 0;
    color: #858a99;
    font-size: 11px;
}

.question-level-group + .question-level-group {
    margin-top: 20px;
    padding-top: 17px;
    border-top: 1px solid #e9e9f0;
}

.question-level-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.question-level-heading h3 {
    margin: 0;
    color: #353749;
    font-size: 15px;
}

.question-level-heading span {
    color: #8a8e9c;
    font-size: 11px;
    font-weight: 700;
}

.parent-question-item {
    transition: opacity .2s ease, filter .2s ease;
}

.parent-question-item.is-question-hidden {
    opacity: .62;
    filter: grayscale(.35);
}

.question-item-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.question-item-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.question-order-number,
.question-source,
.question-hidden-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.question-order-number {
    justify-content: center;
    min-width: 23px;
    padding-inline: 5px;
    background: #ebe9ff;
    color: #5d55d4;
}

.question-source { background: #edf0f4; color: #6c7180; }
.question-source.is-custom { background: #fff0d8; color: #a15c00; }
.question-hidden-badge { background: #feeceb; color: #b42318; }

.question-item-topline form,
.question-sort-actions form { margin: 0; }

.question-visibility-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 31px;
    padding: 4px 8px;
    border: 0;
    border-radius: 999px;
    background: #eceef2;
    color: #6f7380;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.question-visibility-btn > span {
    position: relative;
    width: 27px;
    height: 16px;
    border-radius: 999px;
    background: #aeb2bd;
}

.question-visibility-btn > span::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    transition: transform .2s ease;
}

.question-visibility-btn.is-on { background: #e4f7ec; color: #147a4f; }
.question-visibility-btn.is-on > span { background: #22a06b; }
.question-visibility-btn.is-on > span::after { transform: translateX(11px); }

.question-sort-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid #ececf2;
}

.question-sort-actions > span {
    margin-right: auto;
    color: #9296a4;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.question-sort-actions button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 1px solid #dedfe7;
    border-radius: 9px;
    background: white;
    color: #5f59cd;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
}

.question-sort-actions button:disabled {
    color: #c4c6ce;
    background: #f5f5f7;
    cursor: default;
}

.managed-question-title {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.managed-question-icon {
    display: inline-grid;
    flex: 0 0 34px;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-top: -4px;
    border-radius: 11px;
    background: #f0efff;
    font-size: 19px;
    line-height: 1;
}

.parent-question-icon-input {
    max-width: 130px;
    font-size: 24px;
}

.parent-form-hint {
    display: block;
    margin-top: 5px;
    color: #858997;
    font-size: 11px;
}

@media (min-width: 600px) {
    .question-category-picker { padding: 17px 20px; }
    .parent-question-list { grid-template-columns: 1fr 1fr; }
}
