:root {
    /* Colors from spec */
    --sage-green: #7BA587;
    --coral: #FF8B7B;
    --teal: #2D5F6F;
    --bg-warm: #FAFAF9;
    --card-bg: #F5F3F0;
    --text-dark: #2C2C2C;
    --success: #6EBF8B;
    --warning: #F5A962;
    --danger: #E57373;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-warm);
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.6;
}

.nav-link:hover {
    background: #F5F3F0;
    color: #2D5F6F;
}

.navbar-brand:hover {
    color: #7BA587;
}

/* Form Controls */
.form-control, .form-select {
    border: 1px solid #E5E5E5 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-size: 16px !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sage-green) !important;
    box-shadow: 0 0 0 3px rgba(123, 165, 135, 0.1) !important;
}

/* Primary Button - Deep Teal */
.btn-primary {
    background: linear-gradient(135deg, #2D5F6F 0%, #3D7F8F 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    box-shadow: 0 4px 12px rgba(45, 95, 111, 0.3) !important;
    transition: all 0.2s !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(45, 95, 111, 0.4) !important;
    background: linear-gradient(135deg, #3D7F8F 0%, #2D5F6F 100%) !important;
}

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

/* Success Button - Sage Green */
.btn-success {
    background: linear-gradient(135deg, #6EBF8B 0%, #7BA587 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    box-shadow: 0 4px 12px rgba(110, 191, 139, 0.3) !important;
    transition: all 0.2s !important;
}

.btn-success:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(110, 191, 139, 0.4) !important;
    background: linear-gradient(135deg, #7BA587 0%, #6EBF8B 100%) !important;
}

.btn-success:active {
    transform: translateY(0) !important;
}

/* Secondary Button - Outlined */
.btn-secondary {
    background: transparent !important;
    border: 2px solid #E5E5E5 !important;
    border-radius: 8px !important;
    color: var(--text-dark) !important;
    font-weight: 500 !important;
    padding: 10px 24px !important;
    font-size: 16px !important;
    transition: all 0.2s !important;
}

.btn-secondary:hover {
    background: var(--card-bg) !important;
    border-color: var(--sage-green) !important;
    color: var(--text-dark) !important;
    transform: translateY(-1px);
}

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

/* Link Button - Minimal */
.btn-link {
    background: transparent !important;
    border: none !important;
    color: #666 !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
}

.btn-link:hover {
    color: var(--sage-green) !important;
    background: rgba(123, 165, 135, 0.08) !important;
    border-radius: 6px;
}

.btn-link:active {
    color: var(--teal) !important;
}

/* Small button variants */
.btn-sm {
    padding: 8px 16px !important;
    font-size: 14px !important;
}

/* Utility */
.btn-nowrap {
    white-space: nowrap;
}

/* Danger Button */
.btn-danger {
    background: var(--danger) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}

.btn-danger:hover {
    background: #D32F2F !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 115, 115, 0.3);
}

/* Info Button */
.btn-info {
    background: var(--teal) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}

.btn-info:hover {
    background: #3D7F8F !important;
    transform: translateY(-2px);
}

/* Warning Button */
.btn-warning {
    background: var(--warning) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}

.btn-warning:hover {
    background: #F57C00 !important;
    transform: translateY(-2px);
}

/* Student Cards */
.student-card {
    perspective: 1000px;
    height: 180px;
}

.student-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.student-card.flipped .student-card-inner {
    transform: rotateY(180deg);
}

.student-card-front,
.student-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.student-card-back {
    transform: rotateY(180deg);
    overflow: hidden;
    box-sizing: border-box;
}

.student-card-front:hover {
    box-shadow: 0 4px 16px rgba(123, 165, 135, 0.2);
    transform: translateY(-2px);
    transition: all 0.2s;
}

.student-card.new-import .student-card-front {
    border-left: 4px solid #6EBF8B;
    background: linear-gradient(90deg, #E8F5E9 0%, white 20%);
    animation: highlight-pulse 5s ease-in-out;
}

/* Student index – new-import badge (corner, slightly outside top-right) */
.student-card-front .student-card-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.student-card-badge--new {
    background: #2D5F6F;
    color: white;
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
    50% { box-shadow: 0 4px 16px rgba(110, 191, 139, 0.4); }
}

@keyframes spin {
     0% { transform: rotate(0deg); }
     100% { transform: rotate(360deg); }
 }

/* Modal styling */
.modal-content {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
}

.modal-header {
    border-bottom: 2px solid #F5F3F0 !important;
    padding: 24px !important;
}

.modal-body {
    padding: 24px !important;
}

.modal-footer {
    border-top: 2px solid #F5F3F0 !important;
    padding: 16px 24px !important;
}

/* Student index – modals ~80% viewport height */
.modal-dialog--tall .modal-content {
    max-height: 80vh;
    height: 80vh;
    display: flex;
    flex-direction: column;
}
.modal-dialog--tall .modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Create diagnosis modal – form flex column, preview fills space and list scrolls */
#createDiagnosisModal .modal-body {
    display: flex;
    flex-direction: column;
}
#createDiagnosisModal .modal-body form.create-diagnosis-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
#createDiagnosisModal .diagnosis-create-preview {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#createDiagnosisModal .diagnosis-create-preview.diagnosis-create-preview--hidden {
    display: none !important;
}
#createDiagnosisModal .diagnosis-create-preview-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Orzeczenie modal – Step 2 & 3 content fill height, no popup scroll */
.orzeczenie-step2-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 1rem;
}
.orzeczenie-step2-content .row {
    flex: 1;
    min-height: 0;
    flex-wrap: nowrap;
}
.orzeczenie-step2-content .orzeczenie-preview-col {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.orzeczenie-step2-content #orzeczeniePreview {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
}
.orzeczenie-step2-content .orzeczenie-text-col {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.orzeczenie-step2-content #orzeczenieText {
    height: calc(80vh - 200px);
    min-height: 120px;
    max-height: calc(80vh - 200px);
    overflow-y: auto;
    resize: vertical;
}
.orzeczenie-step3-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.orzeczenie-step3-content #orzeczenieSummaryText {
    height: calc(80vh - 200px);
    min-height: 120px;
    max-height: calc(80vh - 200px);
    overflow-y: auto;
    resize: vertical;
}

.orzeczenie-step-hidden {
    display: none !important;
}
.orzeczenie-step2-content,
.orzeczenie-step3-content {
    display: flex;
}

/* Student index – card and button classes (replace inline styles) */
.student-card-front {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #7BA587;
    cursor: pointer;
}
.student-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #E8F4F8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: #2D5F6F;
}
.student-card-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.student-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.student-card-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
}
.student-card-meta {
    font-size: 14px;
    color: #666;
}
.student-card-meta strong {
    font-weight: 500;
    color: #2C2C2C;
}
.student-card-cta {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: #999;
}
.student-card-back {
    background: linear-gradient(135deg, #6EBF8B 0%, #7BA587 100%);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.student-card-back-title {
    color: white;
    text-align: center;
}
.student-card-back-title h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
}
.student-card-back-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}
.btn-student-primary {
    background: white;
    color: #2D5F6F;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}
.btn-student-primary-outline {
    background: rgba(255,255,255,0.9);
    color: #2D5F6F;
    border: 1px solid white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
}
.btn-student-flip-back {
    background: transparent;
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.modal-student-name-block {
    background: #E8F4F8;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.modal-student-name-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}
.modal-student-name-value {
    font-size: 18px;
    font-weight: 600;
    color: #2D5F6F;
}
.btn-submit-diagnosis {
    padding: 12px 32px;
    font-weight: 600;
}
.orzeczenie-loading-block {
    display: none;
    text-align: center;
    padding: 48px 24px;
}
.orzeczenie-loading-block img {
    display: block;
    margin: 0 auto 16px;
}
.orzeczenie-preview-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* ========== Home page ========== */
.home-page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
    animation: home-fade-in 0.45s ease-out;
}

@keyframes home-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.home-quick-cards-row > div {
    opacity: 0;
    animation: home-fadeInUp 0.5s ease-out forwards;
}

.home-quick-cards-row > div:nth-child(1) { animation-delay: 0.1s; }
.home-quick-cards-row > div:nth-child(2) { animation-delay: 0.2s; }
.home-quick-cards-row > div:nth-child(3) { animation-delay: 0.3s; }
.home-quick-cards-row > div:nth-child(4) { animation-delay: 0.4s; }

.home-hero {
    background: white;
    border-left: 4px solid var(--sage-green);
    padding: 32px 48px;
    border-radius: 12px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.home-hero-title {
    margin: 0 0 8px 0;
    font-size: 32px;
    color: var(--text-dark);
    font-weight: 600;
}

.home-hero-subtitle {
    margin: 0;
    font-size: 16px;
    color: #6B7280;
}

.home-quick-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.home-quick-card {
    padding: 32px;
    border-radius: 12px;
    transition: all 0.2s;
    height: 100%;
    text-decoration: none;
    display: block;
}

.home-quick-card:hover {
    transform: translateY(-4px);
}

.home-quick-card--primary {
    background: linear-gradient(135deg, #7BA587 0%, #6EBF8B 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(123, 165, 135, 0.3);
}

.home-quick-card--primary:hover {
    box-shadow: 0 8px 20px rgba(123, 165, 135, 0.4);
}

.home-quick-card--primary .home-quick-card-text {
    opacity: 0.9;
}

.home-quick-card--outline-green {
    background: white;
    border: 2px solid #6EBF8B;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.home-quick-card--outline-green:hover {
    box-shadow: 0 6px 16px rgba(110, 191, 139, 0.3);
}

.home-quick-card--outline-gray {
    background: white;
    border: 2px solid #E5E7EB;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.home-quick-card--outline-gray:hover {
    border-color: var(--sage-green);
}

.home-quick-card-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.home-quick-card-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.home-quick-card--primary .home-quick-card-title {
    color: white;
}

.home-quick-card-text {
    margin: 0;
    font-size: 14px;
}

.home-quick-card--outline-green .home-quick-card-text,
.home-quick-card--outline-gray .home-quick-card-text {
    color: #6B7280;
}

.home-features {
    background: linear-gradient(135deg, rgba(110, 191, 139, 0.05) 0%, rgba(123, 165, 135, 0.02) 100%);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 48px;
    margin-bottom: 2.5rem;
}

.home-features-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.5rem;
}

.home-feature-item {
    text-align: center;
}

.home-feature-item .home-feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.home-feature-item h4 {
    color: var(--text-dark);
    margin-bottom: 12px;
    font-size: 1.125rem;
}

.home-feature-item p {
    color: #6B7280;
    margin: 0;
}

.home-quick-start {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 32px;
}

.home-quick-start summary {
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.home-quick-start ol {
    margin-top: 24px;
    color: #6B7280;
    line-height: 1.8;
}

.home-quick-start li strong {
    color: var(--text-dark);
}

/* ========== Diagnosis Create (two-step wizard) ========== */
/* Wrap height = viewport minus header (navbar + container padding + progress/title). List areas scroll inside. */
.diagnosis-create-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px;
    height: calc(100vh - 160px);
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.diagnosis-create-wrap form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.diagnosis-create-card {
    background: white;
    border-left: 4px solid var(--sage-green);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.diagnosis-create-step-title {
    margin: 0 0 24px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    flex-shrink: 0;
}

.diagnosis-create-search {
    height: 48px;
    font-size: 16px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.diagnosis-create-student-list {
    margin-bottom: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.diagnosis-create-student-item {
    display: block;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.diagnosis-create-student-item:hover {
    border-color: var(--sage-green);
    background: var(--bg-warm);
}

.diagnosis-create-student-item input {
    margin-right: 12px;
}

.diagnosis-create-student-item .diagnosis-create-student-meta {
    color: #6B7280;
    margin-left: 12px;
}

.diagnosis-create-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-shrink: 0;
}

.diagnosis-create-progress-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
}

.diagnosis-create-progress-segment--filled {
    background: var(--success);
}

.diagnosis-create-progress-segment--empty {
    background: #E5E7EB;
}

.diagnosis-create-step-subtitle {
    color: #6B7280;
    margin: 0 0 24px 0;
    flex-shrink: 0;
}

.diagnosis-create-difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.diagnosis-create-difficulty-card {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px 24px;
    min-height: 64px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.diagnosis-create-difficulty-card:hover {
    border-color: var(--sage-green);
    transform: translateY(-2px);
}

.diagnosis-create-difficulty-card input {
    margin-bottom: 8px;
}

.diagnosis-create-difficulty-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-dark);
}

.diagnosis-create-difficulty-card-meta {
    font-size: 14px;
    color: #6B7280;
}

.diagnosis-create-preview {
    margin-bottom: 0;
}

/* Step 2: preview area fills remaining space */
.diagnosis-create-card--step2 .diagnosis-create-preview {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diagnosis-create-card--step2 .diagnosis-create-preview.diagnosis-create-preview--hidden {
    display: none !important;
}

.diagnosis-create-preview-list,
.diagnosis-create-preview #questionSetsList {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.diagnosis-create-preview-title {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    flex-shrink: 0;
}

.diagnosis-create-preview-item {
    padding: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.diagnosis-create-preview-item strong {
    color: var(--text-dark);
}

.diagnosis-create-preview-item .diagnosis-create-preview-meta {
    color: #6B7280;
}

.diagnosis-create-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    flex-shrink: 0;
}

.diagnosis-create-actions--fixed {
    margin-top: 24px;
}

/* ========== Student page header ========== */
.student-page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.student-page-header {
    background: white;
    border-left: 4px solid #7BA587;
    padding: 32px 48px;
    border-radius: 12px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.student-page-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-page-header-title {
    margin: 0 0 8px 0;
    font-size: 32px;
    color: #2C2C2C;
    font-weight: 600;
}

.student-page-header-subtitle {
    margin: 0;
    font-size: 16px;
    color: #6B7280;
}

.student-page-header-btn-icon {
    font-size: 20px;
    margin-right: 8px;
}

.student-page-import-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.student-page-import-field {
    max-width: 400px;
}

.student-page-import-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.student-page-import-field .form-control {
    width: 100%;
}

.student-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ========== Diagnosis Summary hero ========== */
.diagnosis-summary-hero {
    background: linear-gradient(135deg, rgba(110, 191, 139, 0.1) 0%, rgba(123, 165, 135, 0.05) 100%);
    border: 2px solid #6EBF8B;
    border-radius: 12px;
    padding: 48px;
    margin-bottom: 32px;
}

.diagnosis-summary-hero-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.diagnosis-summary-hero-icon {
    width: 64px;
    height: 64px;
    background: #6EBF8B;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 4px 12px rgba(110, 191, 139, 0.3);
}

.diagnosis-summary-hero-title {
    margin: 0;
    font-size: 32px;
    font-weight: 600;
    color: #2C2C2C;
}

.diagnosis-summary-hero-subtitle {
    margin: 4px 0 0 0;
    font-size: 18px;
    color: #6B7280;
}

.diagnosis-summary-hero-info {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.diagnosis-summary-hero-info-grid {
    display: grid;
    grid-template-columns: max-content 1fr 1fr 1fr;
    /*grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));*/
    gap: 24px;
}

.diagnosis-summary-hero-info-label {
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 4px;
    font-weight: 500;
}

.diagnosis-summary-hero-info-value {
    font-size: 18px;
    font-weight: 600;
    color: #2C2C2C;
}

/* Diagnosis Summary page wrap and content */
.diagnosis-summary-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.diagnosis-summary-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.diagnosis-summary-main {
    min-width: 0;
}

.diagnosis-summary-sidebar {
    min-width: 0;
}

@media (max-width: 991px) {
    .diagnosis-summary-content {
        grid-template-columns: 1fr;
    }
}

.diagnosis-summary-section-title {
    margin: 0 0 20px 0;
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 600;
}

.diagnosis-summary-result-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.diagnosis-summary-result-card--good {
    border-left: 4px solid #6EBF8B;
}

.diagnosis-summary-result-card--warning {
    border-left: 4px solid #F5A962;
}

.diagnosis-summary-result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.diagnosis-summary-result-card-header-left {
    flex: 1;
}

.diagnosis-summary-result-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.diagnosis-summary-result-card-area-badge--good {
    background: #E8F5E9;
    color: #2E7D32;
}

.diagnosis-summary-result-card-area-badge--warning {
    background: #FFF4E6;
    color: #E65100;
}

.diagnosis-summary-result-card-area-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.diagnosis-summary-result-card-level {
    color: #666;
    font-size: 14px;
}

.diagnosis-summary-result-card-level strong {
    font-size: 18px;
}

.diagnosis-summary-result-card-level--good strong {
    color: #6EBF8B;
}

.diagnosis-summary-result-card-level--warning strong {
    color: #F5A962;
}

.diagnosis-summary-result-card-skill {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.diagnosis-summary-result-card-details-btn {
    background: #F5F3F0;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.diagnosis-summary-result-card-detail-inner {
    border-top: 1px solid #F5F3F0;
    padding-top: 12px;
    margin-top: 12px;
}

.diagnosis-summary-empty {
    background: #FFF4E6;
    border: 1px solid #FFE0B2;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #E65100;
}

.diagnosis-summary-empty p {
    margin: 0;
}

.diagnosis-summary-sidebar-inner {
    position: sticky;
    top: 24px;
}

.diagnosis-summary-pdf-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.diagnosis-summary-pdf-card h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.diagnosis-summary-metadata-card {
    background: #FAFAF9;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #E5E5E5;
}

.diagnosis-summary-metadata-card h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diagnosis-summary-metadata-row {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.8;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.diagnosis-summary-metadata-row span:first-child {
    color: #666;
}

.diagnosis-summary-metadata-row strong:last-child {
    text-align: right;
    max-width: 60%;
}

.diagnosis-summary-invite-mock {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    background: #FAFAF9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9E9E9E;
    cursor: default;
}

.diagnosis-summary-back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    padding: 12px;
    background: transparent;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.diagnosis-summary-back-link:hover {
    color: var(--sage-green);
    background: rgba(123, 165, 135, 0.08);
}

/* ========== Dashboard (compliance) ========== */
.dashboard-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.dashboard-hero {
    background: linear-gradient(180deg, #7BA587 0%, #FAFAF9 100%);
    padding: 48px 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dashboard-hero-title {
    margin: 0 0 24px 0;
    font-size: 28px;
    font-weight: 600;
    color: #2C2C2C;
}

.dashboard-hero-progress-block {
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    max-width: 560px;
}

.dashboard-hero-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dashboard-hero-progress-bar-bg {
    height: 12px;
    background: #E5E7EB;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.dashboard-hero-progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.dashboard-hero-progress-bar-fill--gradient {
    /* color set dynamically via JS — single interpolated color per percentage */
}

.dashboard-hero-progress-text {
    font-size: 14px;
    color: #2C2C2C;
}

.dashboard-hero-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-hero-card {
    flex: 1;
    min-width: 140px;
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dashboard-hero-card-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.dashboard-hero-card-label {
    font-size: 16px;
    font-weight: 600;
    color: #2C2C2C;
    margin-bottom: 4px;
}

.dashboard-hero-card-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
}

.dashboard-hero-card--compliant .dashboard-hero-card-icon { color: #6EBF8B; }
.dashboard-hero-card--compliant .dashboard-hero-card-value { color: #6EBF8B; }

.dashboard-hero-card--pending .dashboard-hero-card-icon { color: #F5A962; }
.dashboard-hero-card--pending .dashboard-hero-card-value { color: #F5A962; }

.dashboard-hero-card--overdue .dashboard-hero-card-icon { color: #E57373; }
.dashboard-hero-card--overdue .dashboard-hero-card-value { color: #E57373; }

.dashboard-filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.dashboard-filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.dashboard-filter-search,
.dashboard-filter-export {
    height: 48px;
    box-sizing: border-box;
}

.dashboard-filter-search {
    flex: 1;
    min-width: 0;
    max-width: 320px;
    padding: 0 16px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 15px;
}

.dashboard-filter-class {
    min-width: 180px;
    width: auto;
    padding: 0 32px 0 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 15px;
}

.dashboard-filter-class.form-select {
    height: 48px;
}

.dashboard-filter-export {
    flex-shrink: 0;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.dashboard-content-area {
    min-height: 420px;
}

.dashboard-table-wrap {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th {
    background-color: #F5F3F0;
    padding: 16px 24px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E5E7EB;
}

.dashboard-table td {
    padding: 20px 24px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 16px;
    vertical-align: middle;
}

.dashboard-table tbody tr:hover {
    background-color: #FAFAF9;
}

.dashboard-table-row-click {
    cursor: pointer;
}

.student-name {
    font-weight: 600;
    color: #2C2C2C;
    font-size: 16px;
}

.student-class {
    color: #6B7280;
    font-size: 14px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.status-completed {
    background-color: #6EBF8B;
    color: white;
}

.status-pending {
    background-color: #F5A962;
    color: #2C2C2C;
}

.status-missing {
    background-color: #E57373;
    color: white;
}

.status-unavailable {
    background-color: #9CA3AF;
    color: white;
    opacity: 0.7;
}

.dashboard-table-empty {
    padding: 48px;
    text-align: center;
    color: #6B7280;
}

/* Mobile: show cards, hide table */
.dashboard-table-wrap--desktop { display: block; }
.dashboard-table-wrap--mobile { display: none; }

.dashboard-student-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
}

.dashboard-student-card-name {
    font-size: 18px;
    margin-bottom: 4px;
}

.dashboard-student-card-class {
    margin-bottom: 12px;
}

.dashboard-student-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #F3F4F6;
}

.dashboard-student-card-label {
    font-size: 14px;
    color: #6B7280;
    min-width: 100px;
}

@media (max-width: 767px) {
    .dashboard-hero-cards {
        flex-direction: column;
    }
    .dashboard-hero-card {
        min-width: 100%;
    }
    .dashboard-filter-bar {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: 56px;
    }
    .dashboard-filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    .dashboard-filter-search {
        max-width: 100%;
        width: 100%;
    }
    .dashboard-filter-class {
        width: 100%;
        min-width: 0;
    }
    .dashboard-filter-export {
        margin-left: 0;
    }
    .dashboard-table-wrap--desktop { display: none; }
    .dashboard-table-wrap--mobile { display: block; }
}

/* ── WOPFU Module ── */

.wopfu-area-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}
.wopfu-area-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.wopfu-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    background: #fafafa;
    user-select: none;
}
.wopfu-area-header:hover {
    background: #f5f3f0;
}
.wopfu-area-chevron {
    font-size: 11px;
    color: #888;
    transition: transform 0.15s ease;
    min-width: 14px;
    text-align: center;
}
.wopfu-area-body {
    border-top: 1px solid #e0e0e0;
    background: #fff;
}
.wopfu-area-remove {
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1;
}
.wopfu-team-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #fafafa;
}

.wopfu-create-team-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wopfu-create-team-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.wopfu-create-team-row .form-control {
    flex: 1;
    min-width: 0;
}
.wopfu-create-team-row .wopfu-create-team-remove {
    flex-shrink: 0;
}

/* WOPFU Editor (single step-2 view) */
.wopfu-editor-wrapper {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.wopfu-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #F5F3F0;
}
.wopfu-editor-title { margin: 0; color: #2C2C2C; font-size: 20px; font-weight: 600; }
.wopfu-editor-subtitle { margin: 4px 0 0 0; color: #666; font-size: 14px; }
.wopfu-editor-badge .badge-completed { background: #d4edda; color: #155724; padding: 6px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.wopfu-editor-badge .badge-draft { background: #7BA587; color: white; padding: 6px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.wopfu-editor-progress { margin-bottom: 20px; }
.wopfu-editor-section-title { font-size: 16px; font-weight: 600; color: #2C2C2C; margin-bottom: 4px; }
.wopfu-editor-section-desc { color: #888; font-size: 13px; margin-bottom: 20px; }
.wopfu-editor-section { margin-top: 32px; padding-top: 24px; border-top: 2px solid #F5F3F0; }
.wopfu-editor-summary-fields .wopfu-editor-field { margin-bottom: 20px; }
.wopfu-editor-field-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.wopfu-editor-field-header .form-label { font-weight: 500; color: #444; margin: 0; }
.wopfu-editor-summary-actions { margin-top: 8px; margin-bottom: 8px; }
.wopfu-editor-status { margin-left: 8px; font-size: 13px; color: #666; }
.wopfu-editor-team-add { display: flex; gap: 12px; align-items: flex-end; margin-top: 12px; margin-bottom: 24px; }
.wopfu-editor-team-add .form-control { flex: 1; min-width: 0; }
.wopfu-editor-divider { border: none; border-top: 2px solid #F5F3F0; margin: 24px 0; }
.wopfu-editor-btn-complete, .wopfu-editor-btn-pdf, .wopfu-editor-btn-preview { width: 100%; padding: 16px; font-size: 16px; font-weight: 600; border-radius: 8px; margin-bottom: 12px; display: block; text-align: center; }
.wopfu-editor-btn-pdf { text-decoration: none; }
.wopfu-editor-add-area { text-align: center; margin-top: 20px; }
.wopfu-preview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wopfu-preview-table th, .wopfu-preview-table td { padding: 10px 12px; text-align: left; border: 1px solid #ddd; }
.wopfu-preview-table th { background: #f8f8f8; font-weight: 600; }
.wopfu-preview-table td { white-space: pre-line; }
.wopfu-preview-desc { font-weight: 400; color: #888; font-size: 12px; }

@media (max-width: 767px) {
    .wopfu-area-body > div {
        grid-template-columns: 1fr !important;
    }
}

/* ── Full-screen app pages (no page scroll) ── */
body.page-fullscreen {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.page-fullscreen .wopfu-editor-layout {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

body.page-fullscreen .wopfu-editor-sidebar,
body.page-fullscreen .wopfu-editor-detail {
    height: 100%;
}