body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #1f2937;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
    font-family: 'Roboto Slab', serif;
    color: #1e293b;
}

/* Ensure headers on dark/colored backgrounds inherit white color when specified on parent */
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4 {
    color: white !important;
}

/* Custom Scrollbar for Learning Goals */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Heatmap Hover Effect */
.hover\:scale-110:hover {
    transform: scale(1.1);
    z-index: 30;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card {
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    border: 1px solid #e2e8f0;
}

.tab-button {
    transition: all 0.2s ease-in-out;
    padding: 0.625rem 1rem;
    /* Smaller padding */
    border-bottom: 3px solid transparent;
    color: #475569;
    border-radius: 0.5rem 0.5rem 0 0;
    transform: translateY(0);
}

.tab-button:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
    /* Lift effect */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.tab-button.active {
    border-color: #4f46e5;
    color: #4f46e5;
    font-weight: 700;
    background-color: white;
}

.tab-button.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 672px;
    /* max-w-2xl equivalent */
    max-width: 90vw;
    /* Prevents overflow on small screens */
    background-color: #334155;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 1rem;
    position: absolute;
    z-index: 100;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    /* Better for centering */
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: normal;
    font-size: 0.8rem;
    /* SMALLER FONT */
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip .tooltiptext .tooltip-header {
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 0.9rem;
    /* SMALLER HEADER FONT */
    margin-bottom: 0.75rem;
}

.tooltip .tooltiptext ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tooltip .tooltiptext li {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #475569;
    /* slate-600 */
}

.tooltip .tooltiptext li:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.tooltip .tooltiptext li p {
    margin-top: 0.25rem;
    color: #cbd5e1;
    /* slate-300 */
}

.tooltip:hover .tooltiptext {
    display: none;
}

/* Hide default tooltip, will be handled by JS */

.dynamic-tooltip {
    position: absolute;
    background-color: #334155;
    /* slate-700 */
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 1rem;
    z-index: 10000;
    /* Ensure it's on top of everything */
    width: 672px;
    /* max-w-2xl equivalent */
    max-width: 90vw;
    /* Prevents overflow on small screens */
    font-weight: normal;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    /* SMALLER FONT */
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    /* Prevents the tooltip from blocking mouse events */
}

.dynamic-tooltip .tooltip-header {
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 0.9rem;
    /* SMALLER HEADER FONT */
    margin-bottom: 0.75rem;
}

.dynamic-tooltip ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dynamic-tooltip li {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #475569;
}

.dynamic-tooltip li:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.dynamic-tooltip li p {
    margin-top: 0.25rem;
    color: #cbd5e1;
}


#toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s;
    color: white;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background-color: #16a34a;
}

.toast-error {
    background-color: #dc2626;
}

.toast-info {
    background-color: #2563eb;
}

.toast-warning {
    background-color: #f59e0b; /* Amber 500 */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background-color: white;
    padding: 1.5rem;
    border-radius: 1.25rem;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
    border: 1px solid #e2e8f0;
}

.modal-content.modal-wide {
    max-width: 950px;
}

.modal-content.modal-full {
    max-width: 95vw;
    width: 95vw;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-full .modal-body {
    flex-grow: 1;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-tab-button {
    padding: 0.5rem 1.25rem;
    font-weight: 800;
    font-size: 0.875rem;
    color: #64748b; /* slate-500 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.75rem;
}

.modal-tab-button.active {
    background-color: white;
    color: #4f46e5; /* indigo-600 */
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

.tm-tab-button {
    color: #64748b;
    transition: all 0.3s ease;
}

.tm-tab-button.active {
    background-color: white;
    color: #4f46e5;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

.val-good {
    color: #15803d;
}

.val-moderate {
    color: #c2410c;
}

.val-poor {
    color: #b91c1c;
}

.row-weak {
    background-color: #fef9c3 !important;
}

.styled-table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.styled-table th {
    position: sticky;
    top: 0;
    background-color: #f1f5f9;
    z-index: 10;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.styled-table th,
.styled-table td {
    vertical-align: middle;
}

.styled-table th.sortable {
    cursor: pointer;
    white-space: nowrap;
}

.styled-table th.sortable:hover {
    background-color: #e2e8f0;
}

.styled-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* Hover-effect voor datatabellen voor betere leesbaarheid */
.styled-table tbody tr:hover {
    background-color: #f8f9fa;
    /* Een hele lichte, neutrale highlight */
}

.styled-table tbody tr:last-child td {
    border-bottom: 0;
}

.styled-table .existing-item-score-row {
    background-color: #f8fafc;
}

.styled-table .new-item-score-row {
    background-color: #fef9c3;
}

.new-student-badge {
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #a16207;
    background-color: #fde68a;
    border-radius: 9999px;
    vertical-align: middle;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.4s, margin-top 0.4s;
    visibility: hidden;
    opacity: 0;
}

.collapsible-content.open {
    max-height: 500px;
    visibility: visible;
    opacity: 1;
    margin-top: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #334155;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-success {
    background-color: #16a34a;
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-icon {
    padding: 0.625rem;
}

.btn-subtle {
    background-color: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.btn-subtle:hover {
    background-color: #e0e7ff;
    border-color: #a5b4fc;
}

.btn-outline {
    border-color: #cbd5e1;
    color: #334155;
}

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

.placeholder-gray::placeholder {
    color: #9ca3af;
}

.compare-slot {
    transition: all 0.3s ease-in-out;
}

.compare-slot.loaded {
    border-color: #4f46e5;
}

.compare-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.compare-table td,
.compare-table th {
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.compare-table thead th {
    background-color: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1;
}

.compare-table .category-row td {
    background-color: #f8fafc;
    font-weight: 700;
    color: #334155;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    border-top: 2px solid #e2e8f0;
}

/* PERFORMANCE OPTIMIZATIONS */
#student-results-table-container,
#item-analysis-results-section {
    contain: content;
}

.no-data-cell {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

.input-error {
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
}

.input-locked {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    border-color: #e2e8f0 !important;
    opacity: 0.8;
}

.sort-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.2s;
    vertical-align: -0.15em;
}

.sort-icon.active {
    opacity: 1;
    color: #4f46e5;
}

.score-input-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 0;
}

.line-numbers,
.score-input-grid textarea {
    font-family: monospace;
    font-size: 0.875rem;
    /* 14px */
    line-height: 1.5;
    padding: 0.75rem;
    /* 12px */
    border: 1px solid #d1d5db;
    /* gray-300 */
    box-sizing: border-box;
    overflow-y: scroll;
    /* Show scrollbar to prevent layout shift */
}

.line-numbers {
    text-align: right;
    background-color: #f8fafc;
    /* slate-50 */
    color: #94a3b8;
    /* slate-400 */
    user-select: none;
    border-right: none;
    border-radius: 0.375rem 0 0 0.375rem;
    /* rounded-l-md */
    padding-right: 0.5rem;
}

.score-input-grid textarea {
    resize: vertical;
    white-space: pre;
    overflow-x: scroll;
    border-left: none;
    border-radius: 0;
}

/* Style the rightmost textarea */
.score-input-grid textarea:last-of-type {
    border-radius: 0 0.375rem 0.375rem 0;
    /* rounded-r-md */
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
}

.pulse-hint {
    animation: pulse-glow 2s infinite;
    border-color: #4f46e5;
}

.dropdown-menu.open {
    display: block;
    animation: fadeIn 0.1s ease-out;
}

.auth-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    width: 16rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
    z-index: 50;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}

#help-tour-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#help-tour-menu>div>* {
    transition: background-color 0.2s;
}

.auth-dropdown-menu.open {
    display: block;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    font-weight: 600;
    color: #374151;
    transition: background-color 0.2s;
}

.google-btn:hover {
    background-color: #f9fafb;
}

#floating-action-bar.hidden {
    transform: translate(-50%, 150%);
    opacity: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 28px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked+.slider {
    background-color: #4f46e5;
}

.toggle-switch input:focus+.slider {
    box-shadow: 0 0 1px #4f46e5;
}

.toggle-switch input:checked+.slider:before {
    transform: translateX(22px);
}

/* NIEUWE STIJLEN VOOR DETAILS ACCORDION */
.details-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.4s, margin-top 0.4s;
    opacity: 0;
    margin-top: 0;
}

.details-accordion-content.open {
    max-height: 500px;
    /* Ruime waarde */
    opacity: 1;
    margin-top: 1rem;
}

.details-accordion-icon.rotate-180 {
    transform: rotate(180deg);
}

/* Styling for the class linker dropdown when a class is linked */
#class-linker.class-linked {
    background-color: #f0fdf4;
    /* Tailwind green-50 */
    border-color: #22c55e;
    /* Tailwind green-500 */
    border-width: 2px;
    font-weight: 600;
}

/* --- STIJLEN VOOR VOORTGANGSANALYSE --- */

/* Sorteerbare tabelkoppen */
.styled-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    padding-right: 1.5rem;
    /* Extra ruimte voor het icoon */
}

.styled-table th.sortable:hover {
    background-color: #eef2ff;
    /* indigo-50 */
    color: #4338ca;
    /* indigo-700 */
}

.styled-table th.sortable svg {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    transition: color 0.2s;
}

/* Visuele indicatoren voor trend in de tabel */
.trend-icon.up {
    color: #16a34a;
    /* green-600 */
}

.trend-icon.down {
    color: #dc2626;
    /* red-600 */
}

/* Fix voor de layout van de vergelijkingstabel voor leerdoelen */
.fixed-layout-table {
    table-layout: fixed;
    width: 100%;
}

@keyframes highlight-fade {
    from {
        background-color: #fef9c3;
        /* yellow-100 */
    }

    to {
        background-color: transparent;
    }
}

.setting-section.highlight {
    animation: highlight-fade 2s ease-out;
}

/* Stijl voor de wrapper in simulatiemodus */
#simulation-wrapper.simulation-active {
    border: 2px solid #4f46e5;
    /* indigo-600 */
    border-radius: 0.75rem;
    padding: 1rem;
    background-color: #f8fafc;
    /* slate-50 */
}

/* Stijl voor uitgesloten tabelrijen */
.styled-table tr.item-excluded {
    background-color: #e2e8f0 !important;
    /* slate-200 */
    opacity: 0.6;
    text-decoration: line-through;
}

/* Stijlen voor de weergave van het verschil */
.diff-positive {
    color: #16a34a;
    font-weight: 600;
}

.diff-negative {
    color: #dc2626;
    font-weight: 600;
}

.diff-neutral {
    color: #64748b;
}

/* --- FIX: Robuuste animatie voor score-invoer --- */
.score-input-animator {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.4s ease-in-out, margin-top 0.4s ease-in-out;
    margin-top: 1.5rem;
    /* mt-6 */
}

.score-input-animator.scores-hidden {
    grid-template-rows: 0fr;
    margin-top: 0;
}

.score-input-content-wrapper {
    overflow: hidden;
}

/* --- Dashboard Vernieuwing Stijlen --- */
.dashboard-card-item {
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    /* p-5 */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    border: 1px solid #e2e8f0;
    /* slate-200 */
}

.dashboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    /* p-3 p-4 */
    border-radius: 0.5rem;
    /* rounded-lg */
    transition: background-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.dashboard-item:hover {
    background-color: #f8fafc;
    /* slate-50 */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.class-item-actions {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.dashboard-item:hover .class-item-actions {
    opacity: 1;
}

.premium-locked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
    /* Nodig voor het pseudo-element */
}

/* Optioneel: Voeg een slot-icoon toe */
.premium-locked::after {
    content: '🔒';
    /* Slot emoji */
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: #94a3b8;
    /* slate-400 */
}

.premium-locked.has-premium-label::after {
    content: none;
}

/* Specifieke styling voor tabs */
.tab-button.premium-locked {
    /* Minder opvallend maken */
    color: #94a3b8;
    /* slate-400 */
}

.tab-button.premium-locked:hover {
    /* Voorkom hover effect */
    background-color: transparent;
    color: #94a3b8;
}

.tab-button.premium-locked::after {
    /* Icoon iets anders positioneren voor tabs */
    right: 0.25rem;
}

#action-hub-container>p {
    font-size: 1.125rem;
    color: #475569;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

#action-hub-container>p a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: underline;
}


@media (max-width: 1024px) {
    #login-arrow {
        display: none;
    }
}

#help-tour-button {
    position: relative;
}

#help-tour-menu {
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    width: 14rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
    z-index: 50;
    animation: fadeIn 0.1s ease-out;
}

#action-hub-container {
    text-align: center;
    padding: 2rem;
    background-color: #f1f5f9;
    /* slate-100 */
}

#action-hub-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: #1e293b;
    /* slate-800 */
}

#action-hub-container>div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

#action-hub-container>div>div {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#action-hub-container>div>div:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #4f46e5;
}

#action-hub-container svg {
    width: 3rem;
    height: 3rem;
    color: #4f46e5;
    margin-bottom: 1rem;
}

#action-hub-container h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

#action-hub-container p {
    color: #475569;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

#user-menu-button:hover {
    background-color: #f8fafc;
    /* slate-50 */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.grade-cell input:focus {
    border-color: #4f46e5;
    background-color: #f5f3ff;
    /* indigo-50 */
    outline: 2px solid #4f46e5;
    outline-offset: -2px;
    z-index: 10;
    position: relative;
}

/* --- Sticky Table Styles --- */

/* 1. Sticky Header */
.styled-table thead th {
    position: sticky;
    top: 0;
    /* Een achtergrondkleur is ESSENTIEEL, anders schijnt de tabel erdoorheen. */
    background-color: #f1f5f9;
    /* slate-100, matcht de 'styled-table' stijl */
    z-index: 20;
    /* Zorgt dat de header boven de rijen blijft */
}

/* 2. Sticky Eerste Kolom */
.styled-table tbody td:first-child,
.styled-table thead th:first-child {
    position: sticky;
    left: 0;
    /* Geef de body-cellen een witte achtergrond, en de header-cel de header-kleur */
    background-color: white;
    z-index: 10;
    /* Lager dan de header, zodat de header eroverheen kan */
}

/* 3. Zorg dat de sticky header-cel ook de header-kleur heeft */
.styled-table thead th:first-child {
    background-color: #f1f5f9;
    /* slate-100 */
    z-index: 30;
    /* Hoogste z-index voor de hoek linksboven */
}

/* 4. Visuele verbetering: Een subtiele schaduw om de scheiding aan te geven */
.styled-table td:first-child,
.styled-table th:first-child {
    box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.1);
}

/* 5. Sticky Rechter Zone (Validatie Zone) */
.sticky-right-col-1,
.sticky-right-col-2 {
    position: sticky !important;
    background-color: white;
    z-index: 15;
}

/* De uiterst rechtse kolom (Orig. Totaal) */
.sticky-right-col-1 {
    right: 0;
}

/* De kolom daarnaast (Live Totaal) */
.sticky-right-col-2 {
    right: 90px;
    /* Moet gelijk zijn aan de breedte van col-1 */
}

/* Header varianten met hogere z-index */
.styled-table thead th.sticky-right-col-1,
.styled-table thead th.sticky-right-col-2 {
    background-color: #f1f5f9;
    z-index: 35;
}

/* Kolombreedtes vastzetten voor betere uitlijning */
.col-w-name {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-w-90 {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

.col-w-80 {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

/* Schaduw voor de 'ingang' van de sticky zone */
.sticky-right-col-2 {
    box-shadow: -2px 0 5px -2px rgba(0, 0, 0, 0.1);
}

#email-verification-banner.hidden {
    display: none;
}

.premium-label {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    /* Add some space */
}

.premium-label::before {
    content: '🔒';
    /* Lock emoji */
    font-size: 0.875rem;
    /* 14px */
    color: #94a3b8;
    /* slate-400 */
}

.quick-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

/* --- Stijlen voor Actieve Analyse Indicator --- */
#active-analysis-indicator {
    display: inline-flex;
    align-items: center;
    background-color: #eef2ff;
    /* indigo-100 */
    color: #3730a3;
    /* indigo-800 */
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 600;
    /* font-semibold */
    padding: 0.375rem 0.75rem;
    /* py-1.5 px-3 */
    border-radius: 9999px;
    /* rounded-full */
    border: 1px solid #c7d2fe;
    /* indigo-200 */

    /* Important for long names */
    max-width: 350px;
    /* Max width before ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Animation */
    opacity: 0;
    transform: scale(0.95) translateY(5px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

#active-analysis-indicator.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.class-item-actions {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.dashboard-item:hover .class-item-actions {
    opacity: 1;
}

/* --- PRIVACY MODE --- */
.privacy-mode-active .privacy-blur {
    filter: blur(6px);
    transition: filter 0.3s ease;
}

.privacy-mode-active .privacy-mask {
    background-color: #e2e8f0;
    color: transparent !important;
    border-radius: 4px;
    user-select: none;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* App Shell Header Styling */
.app-shell-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.schoolyear-selector-wrapper select {
    appearance: none;
    padding-right: 1.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.15rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
}

/* --- ANALYSIS WORKSPACE STEPPER (PREMIUM) --- */
.analysis-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem 2.5rem;
    border-radius: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2.5rem;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 10;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-number {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background-color: #f8fafc;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    border: 2px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item:hover .step-number {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.step-item.active .step-number {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    transform: scale(1.1);
}

.step-item.completed .step-number {
    background: #ecfdf5;
    color: #10b981;
    border-color: #10b981;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.step-item.active .step-label {
    color: #4f46e5;
}

.step-item.completed .step-label {
    color: #10b981;
}

.stepper-connector {
    height: 4px;
    background-color: #f1f5f9;
    position: absolute;
    top: 3.25rem;
    left: 10%;
    right: 10%;
    z-index: 5;
    border-radius: 2px;
}

.stepper-progress {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #10b981);
    transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    border-radius: 2px;
}

/* --- NON-LINEAR / LOADED STATE IMPROVEMENTS --- */

/* Step 4 (Afronden) neutral/clickable state when an analysis is loaded */
.analysis-stepper.is-loaded .step-item[data-step="4"]:not(.active):not(.completed) .step-number {
    background-color: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
    cursor: pointer;
}

.analysis-stepper.is-loaded .step-item[data-step="4"]:not(.active):not(.completed):hover .step-number {
    background-color: #e2e8f0;
    color: #4f46e5;
    border-color: #4f46e5;
}

/* Optional step styling (Step 3b) */
.step-item.optional .step-number {
    border-style: dashed;
    border-color: #cbd5e1; /* Subtle gray by default */
    background-color: white; 
    color: #94a3b8; /* Subtle text by default */
    z-index: 2;
}

.step-item.optional.active .step-number {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white !important; /* Ensure white remains on hover */
    border-color: white !important;
    border-style: dashed;
}

.step-item.optional.completed .step-number {
    background: #ecfdf5;
    color: #10b981 !important;
    border-color: #10b981 !important;
    border-style: dashed;
}

.step-item.optional:hover .step-number {
    border-color: #cbd5e1; /* Match the rest of unreached steps by default */
    color: #94a3b8;
    transform: translateY(-2px);
}

.analysis-stepper.is-loaded .step-item.optional:hover .step-number {
    border-color: #4f46e5;
    color: #4f46e5;
}

/* Specificity fix: ensure active/completed colors win even during hover */
.step-item.optional.active:hover .step-number {
    color: white;
    border-color: white;
}

/* On-page Navigation CTA's (Shown only in loaded mode) */
.loaded-only-nav {
    display: none;
    gap: 1.5rem;
    padding: 2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    margin-top: 2rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.is-loaded + #step-content-container .loaded-only-nav,
.analysis-stepper.is-loaded ~ #step-content-container .loaded-only-nav {
    display: flex;
}

/* Hide original navigation when in loaded mode to prevent double buttons */
.analysis-stepper.is-loaded ~ #step-content-container .step-content .step-navigation,
.analysis-stepper.is-loaded ~ #step-content-container #step-content-4 .mt-12.flex.justify-center {
    display: none !important;
}

/* Sub-step styling */
.step-with-substeps .step-number {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 0.875rem;
}

.substep-indicator {
    position: absolute;
    top: -1.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #6366f1;
    background-color: #eef2ff;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0.9;
}

.step-with-substeps.active .substep-indicator {
    background-color: #4f46e5;
    color: white;
    opacity: 1;
}

.step-with-substeps.completed .substep-indicator {
    background-color: #10b981;
    color: white;
    opacity: 1;
}

.step-content {
    display: none;
    animation: stepFadeIn 0.5s ease;
}

.step-content.active {
    display: block;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stepper Navigation Buttons */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}
/* Dashboard Quick Calculator Mobile Fix */
@media (max-width: 768px) {
    #quick-calculator-modal .modal-content,
    #klassenbeheer-modal .modal-content {
        width: calc(100% - 1rem) !important;
        max-height: calc(100vh - 1rem) !important;
        border-radius: 1.5rem !important;
        margin: 0.5rem auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    }

    /* Reduce vertical padding in the modal body on mobile to save space */
    #klassenbeheer-modal .p-8 {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        padding-top: 1.5rem !important;
    }

    /* Ensure student list containers don't dwarf the rest of the form on small screens */
    #class-students-readonly-container,
    #class-students-editable-container {
        max-height: 200px !important;
    }
}

/* Range Slider Enhancements */
input[type="range"].accent-purple-600 {
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    height: 6px;
    border-radius: 10px;
}

input[type="range"].accent-purple-600::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
    transition: all 0.1s ease;
}

input[type="range"].accent-purple-600::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #6d28d9;
}

input[type="range"].accent-purple-600::-moz-range-thumb {
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #7c3aed;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

/* Formula Tooltip Styles - Refined for Subtle SaaS Appearance */
.formula-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.formula-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.formula-tooltip:hover .formula-tooltip-icon {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
}

.formula-tooltip-content {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    width: 280px; /* Breder voor betere leesbaarheid */
    max-width: 80vw; /* Voorkom overflow op mobiel */
    padding: 0.875rem;
    background: #1e293b;
    color: white;
    border-radius: 1rem;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.6;
    text-align: left;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.4), 0 10px 10px -5px rgba(0,0,0,0.1);
    z-index: 9999;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1); /* Subtiele border voor diepte */
}

/* Rechtsuitlijning voor labels in de rechterkolom (voorkomt afsnijden) */
.formula-tooltip-content.at-right {
    left: auto;
    right: -10px;
    transform: translateX(0) translateY(5px);
}

.formula-tooltip-content.at-right::after {
    left: auto;
    right: 15px;
    margin-left: 0;
}

/* Tooltip opent naar beneden (voorkomt afsnijden bij de header) */
.formula-tooltip-content.at-bottom {
    top: 140%;
    bottom: auto;
    transform: translateX(-50%) translateY(-5px);
}

.formula-tooltip-content.at-bottom::after {
    bottom: 100%;
    top: auto;
    border-color: transparent transparent #1e293b transparent;
}

/* Combinatie: naar beneden en rechts uitgelijnd */
.formula-tooltip-content.at-bottom.at-right {
    transform: translateX(0) translateY(-5px);
}

.formula-tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.formula-tooltip:hover .formula-tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.formula-tooltip:hover .formula-tooltip-content.at-right {
    transform: translateX(0) translateY(0);
}

.formula-tooltip-item {
    margin-bottom: 8px; /* Iets meer ademruimte */
}

.formula-tooltip-item:last-child {
    margin-bottom: 0;
}

.formula-tooltip-title {
    font-weight: 800;
    color: #a5b4fc; /* Iets lichtere kleur voor betere leesbaarheid op donkergrijs */
    display: block;
    margin-bottom: 1px;
    font-style: italic;
    opacity: 0.9;
}

/* --- RESPONSIVE STEPPER (SCENARIO C: ICONS ONLY) --- */
@media (max-width: 992px) {
    .analysis-stepper {
        padding: 1.25rem 1rem;
        margin-bottom: 3.5rem; /* Space for the absolute active label */
        justify-content: space-between;
    }

    .stepper-connector {
        left: 5%;
        right: 5%;
        top: 2.85rem;
    }

    .step-item {
        flex: none; /* Don't grow to fill space, use spacing */
        gap: 0;
    }

    .step-number {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1rem;
        border-radius: 0.85rem;
    }

    /* Hide all labels and indicators by default on mobile */
    .step-label,
    .substep-indicator {
        display: none !important;
    }

    /* Show only the active label, centered under the step */
    .step-item.active .step-label {
        display: block !important;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        text-align: center;
        margin-top: 12px;
        font-size: 0.65rem;
        letter-spacing: 0.05em;
        padding: 0.25rem 0.5rem;
    }

    /* Sub-step item circles matching number size */
    .step-with-substeps .step-number {
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* Extra small screens scaling */
@media (max-width: 480px) {
    .step-number {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
        border-radius: 0.75rem;
    }
    
    .stepper-connector {
        top: 2.45rem;
    }
}

/* --- RESPONSIVE HEADER (WORKSPACE MODUS) --- */

/* Fase 1: Kleine Laptops & Tablets (< 1024px) */
@media (max-width: 1024px) {
    /* Verberg tekst in de jaarfilter-label */
    .schoolyear-selector-wrapper label {
        display: none !important;
    }
    
    /* Maak schooljaar select compacter */
    .schoolyear-selector-wrapper {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Verberg 'Cloud' tekst in save status voor compactere weergave */
    #save-status-text {
        display: none !important;
    }
    
    /* Verwijder border/padding van de resterende cloud-status info */
    #header-save-status .border-l {
        border-left: none !important;
        padding-left: 0 !important;
    }
}

/* Fase 2: Mobiel Landscape & Sub-header (< 768px) */
@media (max-width: 768px) {
    #app-shell-header {
        height: auto !important;
        min-height: 4rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    #app-shell-header > .max-w-7xl {
        flex-wrap: wrap;
    }

    /* Forceer de titel naar een eigen regel (sub-header) */
    #breadcrumb-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-left: 0 !important;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #f1f5f9;
    }

    /* NIEUW: Garandeer dat hidden altijd wint over de desktop styles */
    #breadcrumb-nav.hidden {
        display: none !important;
    }

    /* Behandel weergave dashboard icoon en tekst op mobiel */
    #breadcrumb-dashboard-link {
        display: flex !important;
        align-items: center !important;
    }
    #breadcrumb-dashboard-link .breadcrumb-text {
        display: none !important;
    }
    #breadcrumb-dashboard-link svg {
        display: block !important;
        width: 1.125rem !important; /* Iets groter op mobiel voor touch */
        height: 1.125rem !important;
        color: #64748b !important;
    }
    #breadcrumb-nav .mx-2 {
        display: inline !important;
    }

    #breadcrumb-analysis-name {
        max-width: none !important;
        text-align: center;
        font-size: 0.8125rem;
    }
}

/* Fase 3: Mobiel Portrait (< 480px) */
@media (max-width: 480px) {
    /* Zorg dat deze elementen zichtbaar blijven op kleine schermen */
    .schoolyear-selector-wrapper,
    #open-help-modal-button {
        display: flex !important;
    }

    /* Versmallen van de padding in de header voor meer ruimte */
    #app-shell-header > .max-w-7xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        gap: 0.5rem !important;
    }
}
