/* Validation Plans Styling */

.validation-plan-container {
    min-height: calc(100vh - 3.5rem);
}

.validation-plan-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.0rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.validation-plan-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.validation-plan-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.field-section {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
    background-color: white;
}

.field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 1rem;
    background-color: white;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    user-select: none;
    transition: background-color 0.2s;
    text-align: left;
}

.field-header:focus-visible {
    outline: 2px solid var(--color-primary, var(--bs-primary));
    outline-offset: -2px;
}

    .field-header:hover {
        background-color: #fafafa;
    }

.field-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.field-header-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
    flex-shrink: 0;
}

.field-info {
    flex: 1;
}

.field-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.field-content {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
}

.rules-list {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rule-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rule-type-section + .rule-type-section {
    margin-top: 1rem;
}

.rule-type-section-title {
    margin: 0 0 0.45rem;
    color: var(--bs-secondary-color, #6b7280);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rule-type-option {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--bs-border-color, #d1d5db);
    border-radius: 0.5rem;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #374151);
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.rule-type-option > i:first-child {
    color: var(--color-primary, var(--bs-primary));
}

.rule-type-option:hover {
    border-color: var(--color-primary, var(--bs-primary));
}

.rule-type-option.selected {
    border: 2px solid var(--color-primary, var(--bs-primary));
    background: color-mix(in srgb, var(--color-primary, var(--bs-primary)) 6%, var(--bs-body-bg, #fff));
    color: var(--color-primary, var(--bs-primary));
}

.rule-type-option-selected-icon {
    margin-left: auto;
}

.confidence-settings-card {
    margin-top: 1rem;
    border: 1px solid var(--bs-border-color, #e5e7eb);
    border-radius: 0.75rem;
    overflow: hidden;
}

.confidence-settings-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color, #e5e7eb);
    background: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-body-color, #212529);
    font-size: 0.875rem;
}

.confidence-settings-header > i {
    color: var(--color-primary, var(--bs-primary));
}

.confidence-settings-body {
    padding: 1rem;
}

@media (max-width: 575.98px) {
    .rule-type-grid {
        grid-template-columns: 1fr;
    }
}

.rule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.rule-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.rule-item-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

    .rule-item-icon.error {
        color: #dc2626;
    }

    .rule-item-icon.warning {
        color: #b45309;
    }

.rule-item-text {
    flex: 1;
}

.rule-item-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

.rule-item-severity {
    font-size: 0.75rem;
    color: #6b7280;
}

.rule-item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-icon-small {
    padding: 0.375rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-icon-small:hover {
        background-color: #e5e7eb;
    }

    .btn-icon-small svg {
        width: 1rem;
        height: 1rem;
    }

.acceptance-criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.criteria-input-group {
    display: flex;
    flex-direction: column;
}

.criteria-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.criteria-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

    .criteria-input:focus {
        outline: none;
        ring: 2px;
        ring-color: var(--color-primary);
        border-color: var(--color-primary);
    }

.validation-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-card {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
}

    .preview-card.success {
        background-color: #f0fdf4;
        border-color: #86efac;
    }

        .preview-card.success .preview-header {
            color: #16a34a;
        }

    .preview-card.warning {
        background-color: #fffbeb;
        border-color: #fde68a;
    }

        .preview-card.warning .preview-header {
            color: #b45309;
        }

    .preview-card.error {
        background-color: #fef2f2;
        border-color: #fca5a5;
    }

        .preview-card.error .preview-header {
            color: #dc2626;
        }

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

    .preview-header svg {
        width: 1.25rem;
        height: 1.25rem;
    }

.preview-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: #111827;
}

.json-preview {
    background-color: #111827;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

    .json-preview pre {
        font-size: 0.75rem;
        color: #4ade80;
        font-family: monospace;
        line-height: 1.5;
        margin: 0;
    }

.source-type-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

    .toggle-btn.active {
        background-color: white;
        color: #111827;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }

    .toggle-btn:hover:not(.active) {
        color: #111827;
    }

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    margin-bottom: 1rem;
}

    .back-button:hover {
        color: #111827;
    }

    .back-button svg {
        width: 1rem;
        height: 1rem;
    }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay > .modal-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay > .rule-edit-modal {
    max-width: 880px;
}

.modal-overlay .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header-title {
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    margin: 0;
}

.modal-close-btn {
    padding: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .modal-close-btn:hover {
        background-color: #f3f4f6;
    }

    .modal-close-btn svg {
        width: 1.25rem;
        height: 1.25rem;
        color: #6b7280;
    }

.modal-overlay .modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-overlay .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-select,
.form-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
    font-family: inherit;
}

    .form-select:focus,
    .form-input:focus {
        outline: none;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .form-input[type="textarea"] {
        resize: vertical;
        min-height: 80px;
    }

.search-container {
    max-width: 320px;
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

    .search-input:focus {
        outline: none;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .search-input:disabled {
        background-color: #f9fafb;
        color: #9ca3af;
        cursor: not-allowed;
    }

.table-responsive-custom {
    overflow-x: auto;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
}

    .table-custom thead {
        background-color: #f9fafb;
    }

    .table-custom th {
        padding: 0.75rem;
        font-weight: 600;
        font-size: 0.875rem;
        color: #374151;
        border-bottom: 1px solid #e5e7eb;
        text-align: left;
    }

    .table-custom td {
        padding: 0.75rem;
        border-bottom: 1px solid #e5e7eb;
        font-size: 0.875rem;
    }

    .table-custom tbody tr:hover {
        background-color: #f9fafb;
    }

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

    .btn-small.edit {
        background-color: #dbeafe;
        color: #0c4a6e;
    }

        .btn-small.edit:hover {
            background-color: #bfdbfe;
        }

    .btn-small.delete {
        background-color: #fee2e2;
        color: #991b1b;
    }

        .btn-small.delete:hover {
            background-color: #fecaca;
        }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

.empty-state-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.875rem;
}

/* -- Concept badge -- */
.concept-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    background-color: #dbeafe;
    color: #1d4ed8;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* -- Criteria hint text -- */
.criteria-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* -- Acceptance criteria 3-col grid -- */
.acceptance-criteria-grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

/* -- Source tabs -- */
.source-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: -1px;
}

.source-tab-btn {
    padding: 0.5rem 0.25rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

    .source-tab-btn.active {
        color: var(--color-primary);
        border-bottom-color: var(--color-primary);
    }

    .source-tab-btn:hover:not(.active) {
        color: #111827;
    }

/* -- Validatiebron card sections -- */
.vb-header {
    padding: 1.5rem 1.5rem 0;
}

.vb-body {
    padding: 1.5rem;
}

/* -- Document context card -- */
.document-context-card {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1rem;
    height: 100%;
}

/* -- Field type badge -- */
.field-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
}

/* -- Rule item priority variants -- */
.rule-item--error {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

    .rule-item--error .rule-item-icon {
        color: #dc2626;
    }

.rule-item--warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

    .rule-item--warning .rule-item-icon {
        color: #b45309;
    }

.rule-item--info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

    .rule-item--info .rule-item-icon {
        color: #2563eb;
    }

/* -- Rule type badge (inside rule item) -- */
.rule-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
}

/* -- Dashed add-rule button -- */
.btn-dashed {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.375rem;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

    .btn-dashed:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
    }

/* -- Sticky action bar -- */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.sticky-action-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sticky-action-bar-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

/* -- Modal footer gray variant -- */
.modal-footer--gray {
    background-color: #f9fafb;
}

/* -- Blur overlay -- */
.modal-overlay {
    backdrop-filter: blur(4px);
}

/* -- Extra bottom padding so sticky bar doesn't cover content -- */
.validation-plan-container > .container {
    padding-bottom: 5rem;
}

.bi-info-circle {
    color: var(--color-primary);
}
