/* css/toetsmatrijs.css */

/* Styling voor de Toetsmatrijs Beheer Modal */
#toetsmatrijs-beheer-modal .modal-content {
    max-width: 90rem;
    width: 95%;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

#toetsmatrijs-beheer-modal .tm-main-content {
    overflow-y: auto;
    padding-top: 1rem;
}

/* Tab navigatie binnen de modal */
.tm-tab-button {
    padding: 0.75rem 1.25rem;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.2s;
}

.tm-tab-button:hover {
    color: #4f46e5;
    background-color: #f8fafc;
}

.tm-tab-button.active {
    color: #4f46e5;
    border-color: #4f46e5;
    background-color: #f5f3ff;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Grid layout voor de 'ontwerpen' tab */
.matrijs-grid-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    height: 100%;
}

#tm-ontwerp-kolom, #tm-overzicht-kolom {
    display: flex;
    flex-direction: column;
    height: calc(100% - 1rem);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

#tm-onderdelen-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    min-height: 10rem;
}

/* Styling voor Leerdoelen en Sjablonen lijsten */
.tm-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.tm-list-item:hover {
    background-color: #f1f5f9;
}

/* Ensure action containers don't shrink icons */
.tm-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tm-list-item .edit-name-btn {
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    color: #64748b;
}

.tm-list-item:hover .edit-name-btn {
    opacity: 1;
}

.tm-list-item .edit-name-btn:hover {
    color: #4f46e5;
}

.tm-list-item input.edit-name-input {
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #4f46e5;
}

.no-wrap {
    white-space: nowrap;
}

#tm-leerdoelen-linenumbers,
#tm-leerdoelen-textarea {
    line-height: 1.5;
    font-size: 0.875rem;
}

#tm-leerdoelen-textarea {
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* Nieuwe Powertool Layout Stijlen */
.tm-powertool-layout {
    display: flex;
    height: 70vh;
    position: relative;
    transition: padding-right 0.3s ease-in-out;
}

.tm-main-content-area {
    display: flex;
    flex-grow: 1;
    min-width: 0; /* Belangrijk voor flexbox krimp */
}

.tm-dashboard-paneel {
    flex: 0 0 320px;
    position: sticky;
    top: 0;
    height: 100%;
    overflow-y: auto;
    padding-right: 1rem;
}

.tm-editor-paneel {
    flex: 1 1 auto;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
}

.tm-editor-header {
    position: sticky;
    top: 0;
    background-color: white;
    padding-bottom: 1rem;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#tm-item-cards-container {
    padding-top: 0.5rem;
}

/* Item Card Styling - Final Version */
.tm-item-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem; /* More rounded like analyses cards */
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    transition: border-color 0.2s, shadow 0.2s;
    counter-increment: item-counter;
}

.tm-item-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

.tm-item-row-1, .tm-item-row-2 {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tm-item-name {
    flex-grow: 1;
}


/* Styling for the item number */
.tm-card-number::before {
    content: counter(item-counter);
    font-weight: 800;
    color: #64748b;
    font-size: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Container for tags and dropdown */
.tm-leerdoel-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tm-leerdoel-selector-wrapper .choices {
    flex-grow: 1;
}

/* Styling for the tags */
.tm-leerdoel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tm-leerdoel-tag {
    display: inline-flex;
    align-items: center;
    background-color: #f5f3ff; /* indigo-50 equivalent */
    color: #4f46e5; /* indigo-600 */
    border: 1px solid #e0e7ff;
    border-radius: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.tm-leerdoel-tag span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.tm-leerdoel-tag button {
    margin-left: 0.5rem;
    background: none;
    border: none;
    color: #4f46e5; /* indigo-600 */
    cursor: pointer;
    padding: 0;
}
.tm-leerdoel-tag button:hover {
    color: #c7d2fe; /* indigo-200 */
}

.tm-leerdoel-tag.tag-verweesd {
    background-color: #fee2e2; /* light red */
    color: #b91c1c; /* dark red */
    border: 1px dashed #ef4444; /* red border */
    cursor: help;
}

.tm-leerdoel-tag.tag-verweesd .remove-tag-btn {
    color: #b91c1c;
}

.tm-item-card.dragging {
    opacity: 0.5;
    background-color: #c7d2fe;
}

.tm-item-drag-handle {
    cursor: grab;
    color: #94a3b8;
}

.tm-item-card input, .tm-item-card select {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #1e293b;
    font-size: 0.875rem;
    min-width: 0;
    transition: all 0.2s;
}

.tm-item-card input:focus, .tm-item-card select:focus {
    background-color: white;
    border-color: #4f46e5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.tm-item-card .tm-item-name {
    font-weight: 600;
}

.tm-item-card .tm-item-points {
    width: 70px;
}

.tm-item-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.25rem;
    border-radius: 99px;
}
.tm-item-delete-btn:hover {
    color: #ef4444;
    background-color: #fee2e2;
}


/* Collapsible Widget Styling */
.tm-widget-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.tm-widget-toggle-icon {
    transition: transform 0.3s ease-out;
}

.tm-widget-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-top 0.3s ease-out;
    opacity: 1;
}

.tm-dashboard-widget.collapsed .tm-widget-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.tm-dashboard-widget.collapsed .tm-widget-toggle-icon {
    transform: rotate(180deg);
}

/* Choices.js/Tag styling */
.tm-item-card .choices__inner {
    background-color: white;
    padding: 0.3rem; /* Reduced padding */
}

.choices__item--choice[data-custom-properties*="isUsed:true"] {
    background-color: #fef9c3 !important; /* yellow-100 */
    color: #ca8a04 !important; /* yellow-600 */
}

.choices__item--choice[data-custom-properties*="isUsed:true"]:hover {
    background-color: #fde047 !important; /* yellow-400 */
}

.choices__item--choice:hover {
    background-color: #e0e7ff !important; /* indigo-100 */
}

.choices__list--multiple .choices__item {
    background-color: #e0e7ff;
    color: #3730a3;
    border: 0;
    border-radius: 99px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.choices__list--multiple .choices__item .choices__button {
    border-left: 1px solid #c7d2fe;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
}

.tm-wizard-step {
    padding: 1.25rem;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.tm-item-card.active {
    outline: 2px solid #4f46e5;
    box-shadow: 0 0 0 4px #c7d2fe;
}


/* Koppelpaneel Styling */
.tm-leerdoelen-koppel-panel {
    flex: 0 0 350px;
    background-color: #f8fafc;
    border-left: 1px solid #e2e8f0;
    transition: flex-basis 0.3s ease-in-out, opacity 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 1;
}

.panel-collapsed .tm-leerdoelen-koppel-panel {
    flex-basis: 0;
    opacity: 0;
    border-left: none;
}

.tm-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0; /* Voorkomt dat header krimpt */
}

.tm-panel-header h4 {
    font-weight: 600;
}

.tm-panel-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.25rem;
    border-radius: 99px;
}
.tm-panel-close-btn:hover {
    color: #1e293b;
    background-color: #e2e8f0;
}

#tm-panel-leerdoelen-lijst {
    overflow-y: auto;
    flex-grow: 1;
    padding: 0 1rem 1rem;
}

#tm-panel-leerdoelen-lijst li {
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0.25rem;
    border: 1px solid transparent;
}
#tm-panel-leerdoelen-lijst li:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

#tm-panel-leerdoelen-lijst li.is-selected {
    background-color: #e0e7ff; /* indigo-100 */
    font-weight: 600;
    color: #3730a3; /* indigo-800 */
}

#tm-panel-leerdoelen-lijst li.is-used {
    background-color: #fef9c3; /* yellow-100 */
    color: #a16207; /* yellow-700 */
}

.tm-panel-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 20;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 1rem 0.5rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    transition: all 0.3s ease-in-out;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tm-panel-toggle-btn:hover {
    background-color: #e2e8f0;
}

.tm-panel-toggle-btn .icon-arrow-left {
    transform: rotate(90deg);
}

.tm-panel-toggle-btn.panel-open {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.panel-collapsed .tm-panel-toggle-btn {
    right: 0;
}

.tm-powertool-layout:not(.panel-collapsed) {
    padding-right: 40px; /* Space for the button */
}

/* ============================================================
   CANVAS 2.0 - Fullscreen Matrix Builder
   ============================================================ */

/* --- Fullscreen Overlay --- */
.matrix-canvas-view {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    transition: opacity 0.25s ease;
}

.matrix-canvas-view.hidden {
    display: none;
}

/* --- Canvas Top Bar --- */
.canvas-top-bar {
    flex-shrink: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.canvas-top-bar .canvas-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.canvas-top-bar .canvas-back-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.canvas-title-area {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.canvas-title-text {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}
.canvas-title-text:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.canvas-title-input {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid #6366f1;
    outline: none;
    background: white;
    max-width: 300px;
}

.canvas-autosave-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}
.canvas-autosave-indicator.saved { color: #10b981; }
.canvas-autosave-indicator.saving { color: #f59e0b; }

.canvas-top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.canvas-save-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: 700;
    font-size: 0.8125rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}
.canvas-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.canvas-save-btn:active {
    transform: translateY(0);
}

/* --- Canvas Body Layout --- */
.canvas-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    gap: 0;
}

/* --- Matrix Work Area --- */
.canvas-matrix-area {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
    min-width: 0;
}

/* --- Classic Matrix Table (Leerdoelen × Taxonomie) --- */
.matrix-table-wrapper {
    min-width: max-content;
    background: white;
    border-radius: 1.5rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

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

/* Sticky corner cell */
.matrix-table .matrix-corner-cell {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 30;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    min-width: 280px;
    padding: 1rem 1.25rem;
}

/* Sticky column headers (taxonomie niveaus) */
.matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.875rem 1rem;
    text-align: center;
    min-width: 120px;
}

.matrix-tax-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.matrix-tax-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6366f1;
}

.matrix-tax-total {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.1rem 0.4rem;
    border-radius: 0.5rem;
}

/* --- Item Editor Area (The List) --- */
.canvas-items-area {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    overflow-y: auto;
    flex: 1;
}

.items-list-header {
    display: grid;
    grid-template-columns: 40px 48px 1fr 280px 180px 100px 48px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 1rem 1rem 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    align-items: center;
}

.items-list-header div {
    font-size: 0.6875rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.canvas-items-list {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 1rem 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.matrix-item-row {
    display: grid;
    grid-template-columns: 40px 48px 1fr 280px 180px 100px 48px;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    align-items: center;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.matrix-item-row.is-complete {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.matrix-item-row:last-child { border-bottom: none; }
.matrix-item-row:hover { background: #f8fafc; }
.matrix-item-row.is-complete:hover { background: #dcfce7; }

.item-drag-handle {
    cursor: grab;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-drag-handle:hover { color: #94a3b8; }

.item-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
}

.item-name-input {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    transition: all 0.15s ease;
}
.item-name-input:hover { background: white; border-color: #e2e8f0; }
.item-name-input:focus { background: white; border-color: #6366f1; outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

.item-goal-select, 
.item-tax-select {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}
.item-goal-select:hover, .item-tax-select:hover { background: #e2e8f0; }

.item-points-input {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9375rem;
    font-weight: 800;
    color: #4f46e5;
    text-align: center;
}
.item-points-input:focus { border-color: #4f46e5; background: white; outline: none; }

.item-delete-btn {
    opacity: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.matrix-item-row:hover .item-delete-btn { opacity: 1; }
.item-delete-btn:hover { background: #fee2e2; color: #ef4444; }

.canvas-add-item-inline {
    margin-top: 1rem;
    width: 100%;
    padding: 1rem;
    border: 2px dashed #e2e8f0;
    border-radius: 1rem;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.canvas-add-item-inline:hover {
    background: white;
    border-color: #cbd5e1;
    color: #64748b;
}

/* --- Matrix Heatmap (Sidebar) --- */
.insight-matrix-heatmap {
    width: 100%;
}

.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
}

.heatmap-table th {
    font-size: 9px;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    text-align: center;
    padding-bottom: 4px;
}

.heatmap-table td {
    height: 24px;
    background: #f8fafc;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 800;
    color: #cbd5e1;
    text-align: center;
    transition: all 0.2s ease;
}

.heatmap-table td.has-value {
    background: #eef2ff;
    color: #6366f1;
    border: 1px solid #c7d2fe;
}

.heatmap-row-header {
    width: 30px;
    font-size: 10px;
    font-weight: 900;
    color: #64748b;
    text-align: left !important;
}

/* Sortable state */
.sortable-ghost {
    opacity: 0.4;
    background: #eef2ff !important;
}
.sortable-drag {
    background: white !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    border-radius: 0.5rem !important;
}

/* --- Insight Panel (Right Sidebar) --- */
.canvas-insight-panel {
    flex: 0 0 300px;
    border-left: 1px solid #e2e8f0;
    background: white;
    overflow-y: auto;
    padding: 1.25rem;
    transition: flex-basis 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.canvas-insight-panel.collapsed {
    flex-basis: 48px;
    overflow: hidden;
    padding: 1rem 0;
    align-items: center;
}

.insight-panel-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    padding: 0.5rem;
    border-radius: 0.5rem;
    width: 100%;
    transition: all 0.15s ease;
}
.insight-panel-toggle:hover { background: #f1f5f9; }

.canvas-insight-panel.collapsed .insight-panel-content {
    display: none;
}

.insight-panel-title {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.insight-metric-card {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    padding: 0.875rem;
}

.insight-metric-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

.insight-metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.insight-bar-item {
    margin-bottom: 0.625rem;
}

.insight-bar-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}

.insight-bar-track {
    height: 6px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}

.insight-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* --- 2-Step Wizard Overlay --- */
.matrix-wizard-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: opacity 0.2s ease;
}

.matrix-wizard-overlay.hidden {
    display: none;
}

.matrix-wizard-card {
    background: white;
    border-radius: 2rem;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.wizard-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    padding: 2rem 2rem 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.wizard-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.wizard-step-pills {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wizard-step-pill {
    width: 32px;
    height: 4px;
    border-radius: 99px;
    background: rgba(255,255,255,0.3);
    transition: background 0.3s ease;
}
.wizard-step-pill.active {
    background: white;
}

.wizard-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.wizard-header p {
    font-size: 0.875rem;
    color: #ffffffd0;
    font-weight: 500;
}

.wizard-body {
    padding: 2rem;
}

.wizard-field {
    margin-bottom: 1.25rem;
}

.wizard-field label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.wizard-field input,
.wizard-field select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.15s ease;
    outline: none;
}

.wizard-field input:focus,
.wizard-field select:focus {
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Taxonomy card selection */
.wizard-taxonomy-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.wizard-tax-card {
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.875rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s ease;
    background: white;
    position: relative;
    overflow: hidden;
}

.wizard-tax-card:hover {
    border-color: #a5b4fc;
    background: #fafaf9;
}

.wizard-tax-card.selected {
    border-color: #6366f1;
    background: #eef2ff;
}

.wizard-tax-card .tax-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.625rem;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.wizard-tax-card .tax-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
}

.wizard-tax-card .tax-desc {
    font-size: 0.6875rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 0.2rem;
}

.wizard-tax-card.selected .tax-name { color: #4f46e5; }
.wizard-tax-card.selected .tax-desc { color: #818cf8; }

.wizard-tax-card .tax-check {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.65rem;
}
.wizard-tax-card.selected .tax-check { display: flex; }

/* Wizard footer with navigation */
.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem 2rem;
    border-top: 1px solid #f1f5f9;
    gap: 0.75rem;
}

.wizard-btn-secondary {
    padding: 0.75rem 1.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.875rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: #64748b;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
}
.wizard-btn-secondary:hover { background: #f8fafc; }

.wizard-btn-primary {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 0.875rem;
    font-weight: 800;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.wizard-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* --- Ontwerpen Tab Launch View --- */
.canvas-launch-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 3rem;
    text-align: center;
}

.canvas-launch-card {
    max-width: 440px;
    width: 100%;
}

.canvas-launch-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #6366f1;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
}

.canvas-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: 800;
    font-size: 0.9375rem;
    border-radius: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    margin-top: 1.5rem;
}
.canvas-launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

/* --- Mobile block --- */
.canvas-mobile-block {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9200;
    background: white;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

@media (max-width: 767px) {
    .matrix-canvas-view:not(.hidden) .canvas-mobile-block {
        display: flex;
    }
    .matrix-canvas-view:not(.hidden) .canvas-top-bar,
    .matrix-canvas-view:not(.hidden) .canvas-body {
        display: none;
    }
}
/* Sidebar Collapsible */
.insight-panel-section {
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.insight-panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.insight-panel-title .toggle-icon {
    transition: transform 0.2s ease;
}

.insight-panel-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.insight-panel-section.collapsed .section-content {
    display: none;
}

.set-edit-btn {
    padding: 0.35rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.625rem;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.set-edit-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}
