/* ==========================================================================
   REUSABLE UI COMPONENTS
   Uses design tokens from site.css
   ========================================================================== */

/* ==========================================================================
   CARDS (mandatory layout standard)
   ========================================================================== */

.app-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-medium);
    padding: var(--space-20);
    margin-bottom: var(--space-20);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.app-card:hover {
    box-shadow: var(--shadow-md);
}

.app-card-full-width {
    width: 100%;
}

.app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-12);
}

.app-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

/* Body section inside an app-card that has an app-card-header. */
.app-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

/* Generic content wrapper inside card-like containers. */
.app-card-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

/* ── Label ──────────────────────────────────────────────────────────────── */

.app-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ===== Icon Wrapper ===== */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-8);
    line-height: 1;
}

.icon .bi {
    opacity: 0.85;
    transition: color 0.15s ease;
}

button:hover .icon .bi,
button:focus-visible .icon .bi {
    color: var(--color-text-primary);
}

/* Remove lingering focus shadow after a mouse click on MudIconButton / MudMenu triggers.
   :focus-visible fires for keyboard navigation only, so keyboard users keep their ring. */
.mud-button-root:focus:not(:focus-visible) {
    box-shadow: none;
    outline: none;
}

/* ===== Session Actions ===== */
.session-actions {
    margin-left: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
}

.session-actions .icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-small);
}

.session-actions .icon:hover {
    background: var(--color-grey-50);
}

/* Focus */
.app-input:focus {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}


/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-16);
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-8);
    color: var(--color-text-primary);
    font-size: 14px;
}

.app-input {
    display: block;
    width: 100%;
    padding: var(--space-8) var(--space-12);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background: var(--color-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-small);
    transition: border-color 0.15s ease-in-out;
    box-sizing: border-box;
    font-family: inherit;
}

.app-input:focus {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
    border-color: var(--color-brand-primary);
}

.app-input:disabled {
    background-color: var(--color-grey-200);
    cursor: not-allowed;
}

textarea.app-input {
    resize: vertical;
    min-height: 80px;
}

/* Normalise native <select> height so it matches <input> */
select.app-input:not(.app-input-tags) {
    height: 36px;
    padding: var(--space-4) var(--space-8);
}

.app-input-sm {
    padding: var(--space-4) var(--space-8);
    font-size: 13px;
}

.app-input-plaintext {
    display: block;
    width: 100%;
    padding: var(--space-4) 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background: transparent;
    border: solid transparent;
    border-width: 1px 0;
}

/* Tags multi-select — explicitly overrides the select height normalisation above */
select.app-input.app-input-tags {
    height: 80px;
    resize: none;
    padding: var(--space-4) var(--space-8);
}

.form-text {
    display: block;
    margin-top: var(--space-4);
    font-size: 13px;
    color: var(--color-text-muted);
}

.validation-message {
    color: var(--color-error);
}


/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.app-text-muted {
    color: var(--color-text-muted);
    font-size: 13px;
}

.app-text-success {
    color: var(--color-success);
}

.app-text-info {
    color: var(--color-brand-primary-light);
}

.app-text-danger {
    color: var(--color-error);
}

.app-full-width {
    width: 100% !important;
}

.app-text-bold {
    font-weight: 600;
}

.app-flex {
    display: flex;
}

.app-gap-xs {
    gap: var(--space-4);
}

.app-gap-sm {
    gap: var(--space-8);
}

.app-gap-md {
    gap: var(--space-12);
}

.app-flex-wrap {
    flex-wrap: wrap;
}

.app-align-center {
    align-items: center;
}

.app-justify-between {
    justify-content: space-between;
}

.app-mb-xs {
    margin-bottom: var(--space-4);
}

.app-mb-sm {
    margin-bottom: var(--space-8);
}

.app-mb-md {
    margin-bottom: var(--space-12);
}

.app-mb-lg {
    margin-bottom: var(--space-24);
}

.app-mt-xs {
    margin-top: var(--space-4);
}

.app-mt-sm {
    margin-top: var(--space-8);
}

.app-mt-md {
    margin-top: var(--space-12);
}

.app-mt-lg {
    margin-top: var(--space-24);
}

.app-mr-xs {
    margin-right: var(--space-4);
}

.app-mr-sm {
    margin-right: var(--space-8);
}

.app-ml-auto {
    margin-left: auto;
}

.app-py-lg {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
}

.app-text-center {
    text-align: center;
}

.app-p-0 {
    padding: 0 !important;
}

.app-pt-0 {
    padding-top: 0 !important;
}

.app-pb-0 {
    padding-bottom: 0 !important;
}

.app-px-0 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.app-py-0 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}


/* ==========================================================================
   SELECT ELEMENTS
   ========================================================================== */

.form-select {
    padding: var(--space-12);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-small);
    background: var(--color-white);
    width: 100%;
    max-width: 400px;
    cursor: pointer;
}

.form-select:focus {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
    border-color: var(--color-brand-primary);
}

.form-select:disabled {
    background-color: var(--color-grey-200);
    cursor: not-allowed;
}


/* ==========================================================================
   TABLE STYLES
   ========================================================================== */

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

thead {
    background: var(--color-table-header-bg);
}

thead th:hover {
    background: var(--color-table-header-hover-bg);
}

tbody tr:hover {
    background: var(--color-table-row-hover-bg);
}

td, th {
    padding: var(--space-8);
    border-bottom: 1px solid var(--color-grey-300);
}

.app-table-scroll {
    overflow-x: visible;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-24);
}

.app-table thead {
    background-color: var(--color-table-header-bg);
}

.app-table th,
.app-table td {
    padding: var(--space-8);
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}

.app-table td .mud-icon-button {
    vertical-align: middle;
}

table td input,
table td select,
table td textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Shared header base for grid-layout or flex-layout table-like headers.
   Apply alongside the specific header class (e.g. .workflow-definitions-table-header). */
.app-table-grid-header {
    background: var(--color-grey-100);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
}


/* ==========================================================================
   STATUS MESSAGES
   ========================================================================== */

.status-success {
    background: var(--color-success-light);
    color: var(--color-success);
    padding: var(--space-12);
    border-left: 4px solid var(--color-success);
}

.status-error,
.status-danger {
    background: var(--color-error-light);
    color: var(--color-error);
    padding: var(--space-12);
    border-left: 4px solid var(--color-error);
}

.status-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    padding: var(--space-12);
    border-left: 4px solid var(--color-warning);
}

.status-info {
    background: rgba(12, 119, 190, 0.1);
    color: var(--color-brand-primary);
    padding: var(--space-12);
    border-left: 4px solid var(--color-brand-primary);
}


/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.status-badge.status-new {
    background-color: var(--color-grey-200);
    color: var(--color-text-secondary);
}

.status-badge.status-open {
    background: var(--color-grey-100, #f3f5f7);
    color: var(--color-text-secondary, rgba(0,0,0,0.75));
}

.status-badge.status-progress {
    background: rgba(12, 119, 190, 0.1);
    color: var(--color-brand-primary-light, #0c77be);
}

.status-badge.status-review {
    background: var(--color-warning-light, #fff3cd);
    color: #946c00;
}

.status-badge.status-tosign {
    background: var(--color-warning-light);
    color: #946c00;
}

.status-badge.status-complete {
    background: var(--color-success-light, #dff3e6);
    color: var(--color-success, #2E8540);
}

.status-badge.status-cancelled {
    background: var(--color-error-light, #f8d7da);
    color: var(--color-error, #D64545);
}

/* ── Semantic modifiers (U16) — base shape shared with workflow aliases ──── */
/* The workflow-specific badge selectors (.checklist-status-badge,
   .release-status-badge, .task-priority) are grouped here so the shape is
   defined once; workflow.css keeps only unique overrides. */
.status-badge,
.checklist-status-badge,
.release-status-badge,
.task-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-small);
    font-size: 11px;
    font-weight: 600;
}

.status-badge--muted,
.checklist-status-new          { background: var(--color-grey-200);         color: var(--color-text-muted); }

.status-badge--warning,
.checklist-status-inprogress,
.release-status-pending,
.task-priority.priority-mittel { background: var(--color-warning-light);    color: #997300; }

.status-badge--info,
.checklist-status-submitted    { background: rgba(0, 95, 158, 0.12);        color: var(--color-brand-primary); }

.status-badge--success,
.checklist-status-approved,
.release-status-released,
.task-priority.priority-niedrig { background: var(--color-success-light);   color: var(--color-success); }

.status-badge--danger,
.checklist-status-rejected,
.release-status-failed,
.task-priority.priority-hoch   { background: var(--color-error-light);      color: var(--color-error); }

.status-badge--danger-solid,
.task-priority.priority-kritisch { background: var(--color-error);           color: var(--color-white); }

/* ==========================================================================
   BCF STATUS BADGES
   ========================================================================== */
/* Color scheme matches Trimble BCF status indicators
 * These tokens are used to colorize the BCF_status.svg icon via currentColor
 */

:root {
    /* BCF Status Colors */
    --bcf-status-new: #2f80ed; /* Blue */
    --bcf-status-in-progress: #f2b705; /* Yellow / Amber */
    --bcf-status-waiting: #e65f38; /* Orange */
    --bcf-status-done: #27ae60; /* Green */
    --bcf-status-closed: #2bb0c8; /* Cyan / Teal */

    --bcf-status-new-rgb: 47,128,237;
    --bcf-status-in-progress-rgb: 242,183,5;
    --bcf-status-waiting-rgb: 230,95,56;
    --bcf-status-done-rgb: 39,174,96;
    --bcf-status-closed-rgb: 43,176,200;
    /* BCF Priority Colors */
    --bcf-priority-low: #27ae60; /* Green */
    --bcf-priority-normal: #2f80ed; /* Blue */
    --bcf-priority-high: #f2b705; /* Yellow / Amber */
    --bcf-priority-critical: #eb5757; /* Red */

    --bcf-priority-low-rgb: 39,174,96;
    --bcf-priority-normal-rgb: 47,128,237;
    --bcf-priority-high-rgb: 242,183,5;
    --bcf-priority-critical-rgb: 235,87,87;
}

/* BCF Status Classes for Icon Coloring */
.bcf-status-new {
    color: var(--bcf-status-new);
}

.bcf-status-in-progress {
    color: var(--bcf-status-in-progress);
}

.bcf-status-waiting {
    color: var(--bcf-status-waiting);
}

.bcf-status-done {
    color: var(--bcf-status-done);
}

.bcf-status-closed {
    color: var(--bcf-status-closed);
}

/* BCF Child Badge Styles - for Cytoscape diagram badges */
.bcf-child-badge {
    width: 40px !important;
    height: 20px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: bold !important;
    color: white !important;
    text-align: center !important;
    cursor: pointer !important;
    line-height: 20px !important;
    padding: 0 !important;
}

/* BCF Badge Background Colors - using status color variables */
.bcf-child-badge.bcf-status-new {
    background-color: var(--bcf-status-new) !important;
}

.bcf-child-badge.bcf-status-in-progress {
    background-color: var(--bcf-status-in-progress) !important;
}

.bcf-child-badge.bcf-status-waiting {
    background-color: var(--bcf-status-waiting) !important;
}

.bcf-child-badge.bcf-status-done {
    background-color: var(--bcf-status-done) !important;
}

.bcf-child-badge.bcf-status-closed {
    background-color: var(--bcf-status-closed) !important;
}

.bcf-child-badge.bcf-status-default {
    background-color: #6c757d !important; /* Grey fallback */
}

/* Version Child Badge Styles - for Cytoscape diagram version badges */
.version-child-badge {
    min-width: 50px !important;
    height: 20px !important;
    padding: 0 8px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    font-weight: bold !important;
    color: #333 !important;
    background-color: #E0E0E0 !important;
    cursor: pointer !important;
    text-align: center !important;
    line-height: 20px !important;
}

/* Version Badge Approval Status Colors - Phase 7 */
.version-child-badge.status-approved {
    background-color: #4CAF50 !important;
    color: white !important;
}

.version-child-badge.status-pending {
    background-color: #FF9800 !important;
    color: white !important;
}

.version-child-badge.status-rejected {
    background-color: #F44336 !important;
    color: white !important;
}

/* ==========================================================================
   TAG STYLING
   ========================================================================== */

.tag-badge {
    display: inline-block;
    padding: 2px var(--space-8, 8px);
    border-radius: 12px;
    font-size: 11px;
    background: var(--color-grey-100, #f3f5f7);
    color: var(--color-text-secondary, rgba(0,0,0,0.75));
    margin-right: var(--space-4, 4px);
}


/* ==========================================================================
   PRIORITY BADGES
   ========================================================================== */

.priority-badge {
    display: inline-block;
    padding: var(--space-4, 4px) var(--space-8, 8px);
    border-radius: var(--radius-small, 4px);
    font-size: 11px;
    font-weight: 500;
}


    .priority-badge.priority-low {
        background: rgba(39, 174, 96, 0.12); /* var(--bcf-priority-low) @ 12% */
        color: var(--bcf-priority-low);
    }

    .priority-badge.priority-normal {
        background: rgba(47, 128, 237, 0.12); /* var(--bcf-priority-normal) @ 12% */
        color: var(--bcf-priority-normal);
    }

    .priority-badge.priority-high {
        background: rgba(242, 183, 5, 0.15); /* var(--bcf-priority-high) @ 15% (slightly stronger for yellow) */
        color: var(--bcf-priority-high);
    }

    .priority-badge.priority-critical {
        background: rgba(235, 87, 87, 0.15); /* var(--bcf-priority-critical) @ 15% */
        color: var(--bcf-priority-critical);
    }

/* ==========================================================================
   GENERIC BADGE
   ========================================================================== */

/* Solid filled badge — brand-primary background, white text.
   Used for count indicators and labels (e.g. "IDS", model counts). */
.app-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--color-brand-primary);
    color: var(--color-white);
}

/* ==========================================================================
   FILTER BAR � LAYOUT
   ========================================================================== */

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    margin-bottom: var(--space-24);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-16);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 180px;
}

/* ==========================================================================
   LABELS
   ========================================================================== */

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
}

/* ==========================================================================
   SELECT DROPDOWNS
   ========================================================================== */

.filter-select {
    padding: var(--space-8) var(--space-12);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-small);
    background-color: var(--color-input-background);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

    .filter-select:focus {
        outline: none;
        border-color: var(--color-brand-primary);
    }

/* ==========================================================================
   MULTI-SELECT DROPDOWN
   ========================================================================== */

.multi-select {
    position: relative;
    padding: var(--space-8) var(--space-12);
    border-radius: var(--radius-small);
    border: 1px solid var(--color-border-subtle);
    background-color: var(--color-input-background);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
}

    .multi-select .select-text {
        flex-grow: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* ==========================================================================
   SEARCH FIELD
   ========================================================================== */

.search-group {
    min-width: 240px;
    flex-grow: 1;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .search-input-wrapper i {
        position: absolute;
        left: var(--space-8);
        color: var(--color-text-secondary);
    }

.search-input {
    width: 100%;
    padding: var(--space-8) var(--space-12) var(--space-8) var(--space-28);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-small);
    background-color: var(--color-input-background);
    font-size: 0.95rem;
}

    .search-input:focus {
        outline: none;
        border-color: var(--color-brand-primary);
    }

.search-clear {
    position: absolute;
    right: var(--space-8);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
}

    .search-clear:hover {
        color: var(--color-text-primary);
    }

/* ==========================================================================
   FILTER ACTIONS / TOGGLES
   ========================================================================== */

.filter-actions {
    display: flex;
    align-items: center;
    gap: var(--space-24);
    flex-wrap: wrap;
}

.cancelled-toggle,
.planned-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    cursor: pointer;
    font-size: 0.9rem;
}



/* ==========================================================================
   MODAL OVERLAY - MOVED TO App.Web/wwwroot/css/modal.css
   ========================================================================== */
/* Modal styles have been moved to App.Web/wwwroot/css/modal.css
   and are loaded as a plain static asset: css/modal.css
   This ensures consistent modal behavior across all modules. */




/* ============================================================
   SHARED LAYOUT UTILITIES
   Used by both Module.IdsTools and Module.Configuration
   ============================================================ */

/* Empty State — flex column so icon + heading + text stack vertically */
.empty-state {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-32);
    text-align: center;
    color: var(--color-text-secondary);
}

.empty-state, .empty-state-small {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--tc-text-secondary);
}

.empty-state-small {
    padding: 1rem;
}

.empty-state p {
    font-size: 1rem;
    margin: var(--space-8) 0;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-16);
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-8) 0;
}

.empty-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    padding: var(--space-24);
    text-align: center;
    color: var(--color-text-secondary);
}

.empty-panel-icon {
    font-size: 48px;
    margin-bottom: var(--space-16);
    opacity: 0.3;
}

.empty-panel p {
    font-size: 14px;
    max-width: 250px;
    margin: 0;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 80px);
    gap: var(--space-16);
}

.error-message {
    padding: var(--space-16);
    margin: var(--space-16);
    background: var(--color-error-light);
    border: 1px solid var(--color-error);
    border-radius: var(--border-radius);
    color: var(--color-error);
}

/* ==========================================================================
   CONNECT FILE PICKER – shared, reusable across all modules
   Opened via ModalService.ShowComponent(typeof(ConnectFilePickerDialog), …)
   with Size="xlarge" to fill a wide modal.
   ========================================================================== */

/* Wrapper that holds header/body/footer inside the modal-dialog */
.file-picker-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* Refresh button in the modal header */
.file-picker-refresh-btn {
    margin-left: auto;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-text-secondary, #6b7280);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
}

.file-picker-refresh-btn:hover:not(:disabled) {
    color: var(--color-primary, #0057a8);
    background-color: var(--color-grey-100, #f3f4f6);
}

.file-picker-refresh-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.file-picker-refresh-spinner {
    width: 16px !important;
    height: 16px !important;
}

/* Override modal-dialog default max-width for the picker */
.modal-dialog:has(.file-picker-modal) {
    max-width: 1100px;
    width: 90vw;
    height: 80vh;
}

/* Body: fills remaining space between header and footer */
.file-picker-body {
    flex: 1;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}

/* Two-column layout: tree (left) + file list (right) */
.file-picker-container {
    display: flex;
    height: 100%;
}

/* Left panel – folder tree */
.file-picker-tree {
    width: 260px;
    min-width: 180px;
    max-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border-subtle);
    background: var(--color-grey-100);
}

/* Right panel – file list */
.file-picker-files {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
}

/* Panel section header */
.file-picker-panel-header {
    padding: var(--space-8) var(--space-16);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border-subtle);
    flex-shrink: 0;
}

/* Scrollable tree body */
.file-picker-tree-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-8) var(--space-4);
}

/* Loading spinner row */
.file-picker-loading {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-24);
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Empty-state placeholder */
.file-picker-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-32);
    gap: var(--space-12);
    color: var(--color-text-muted);
    font-size: 14px;
    text-align: center;
}

.file-picker-empty-icon {
    font-size: 40px;
    opacity: 0.3;
}

/* Selected row highlight */
.file-picker-row-selected {
    background: #e8f1f8 !important;
}

.file-picker-row-selected:hover {
    background: #dce9f5 !important;
}

/* Checkbox column */
.file-picker-col-check {
    width: 36px;
    text-align: center;
}

/* File type icon */
.file-picker-file-icon {
    margin-right: var(--space-8);
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Selection counter in footer */
.file-picker-selection-count {
    flex: 1;
    font-size: 13px;
    color: var(--color-text-muted);
    align-self: center;
}

/* ==========================================================================
   SIMPLE RICH TEXT EDITOR (shared TipTap component — Shared.UI)
   ========================================================================== */

.simple-rich-text-editor {
    min-height: 120px;
    outline: none;
}

.simple-rich-text-editor .tiptap {
    min-height: 120px;
    padding: var(--space-8) var(--space-12);
    outline: none;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-primary);
    font-family: inherit;
}

.simple-rich-text-editor .tiptap:focus {
    outline: none;
}

.simple-rich-text-editor .tiptap p {
    margin: 0 0 var(--space-8) 0;
}

.simple-rich-text-editor .tiptap p:last-child {
    margin-bottom: 0;
}

.simple-rich-text-editor .tiptap h3,
.simple-rich-text-editor .tiptap h4 {
    margin: var(--space-12) 0 var(--space-4) 0;
    font-weight: 600;
    color: var(--color-text-primary);
}

.simple-rich-text-editor .tiptap h3 {
    font-size: 16px;
}

.simple-rich-text-editor .tiptap h4 {
    font-size: 14px;
}

.simple-rich-text-editor .tiptap ul,
.simple-rich-text-editor .tiptap ol {
    margin: 0 0 var(--space-8) 0;
    padding-left: var(--space-20);
}

.simple-rich-text-editor .tiptap li {
    margin-bottom: 2px;
}

/* ── Table ── */

.simple-rich-text-editor .tiptap table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 var(--space-8) 0;
    font-size: inherit;
}

.simple-rich-text-editor .tiptap table td,
.simple-rich-text-editor .tiptap table th {
    border: 1px solid var(--color-border-subtle, #d1d5db);
    padding: var(--space-4) var(--space-8);
    text-align: left;
    vertical-align: top;
    min-width: 40px;
}

.simple-rich-text-editor .tiptap table th {
    background: var(--color-grey-50, #f9fafb);
    font-weight: 600;
}

/* Selected cell highlight (TipTap table selection) */
.simple-rich-text-editor .tiptap .selectedCell::after {
    background: rgba(0, 95, 158, 0.08);
    content: "";
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    position: absolute;
    z-index: 2;
}

.simple-rich-text-editor .tiptap table td,
.simple-rich-text-editor .tiptap table th {
    position: relative;
}

.simple-rich-text-editor .tiptap a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ==========================================================================
   APP BUTTON PRIMITIVES (shared foundation used by toolbar and other UI)
   ========================================================================== */

.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-12);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.app-btn:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

.app-btn:disabled,
.app-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.app-btn--icon {
    padding: var(--space-4) var(--space-6);
}

.app-btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.app-btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark, var(--color-primary));
    border-color: var(--color-primary-dark, var(--color-primary));
}

.app-btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border-subtle);
}

.app-btn-secondary:hover:not(:disabled) {
    background: var(--color-grey-50);
}

.app-btn-default {
    background: var(--color-grey-50);
    color: var(--color-text-primary);
    border-color: var(--color-border-subtle);
}

.app-btn-default:hover:not(:disabled) {
    background: var(--color-grey-100);
}

/* ==========================================================================
   SRTE TOOLBAR (SimpleRichTextEditor – Shared.UI)
   ========================================================================== */

.srte-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: var(--space-4) var(--space-8);
    background: var(--color-grey-50);
    border: 1px solid var(--color-border-subtle);
    border-bottom: none;
    border-radius: var(--radius-small) var(--radius-small) 0 0;
}

.srte-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    color: var(--color-text-primary);
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    line-height: 1;
}

.srte-toolbar__btn:hover {
    background: var(--color-grey-100);
    border-color: var(--color-border-subtle);
}

.srte-toolbar__btn:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

.srte-toolbar__btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.srte-toolbar__btn.active:hover {
    background: var(--color-primary-dark, var(--color-primary));
    border-color: var(--color-primary-dark, var(--color-primary));
}

.srte-toolbar__btn--danger {
    color: var(--color-danger, #dc2626);
}

.srte-toolbar__btn--danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.srte-toolbar__sep {
    width: 1px;
    height: 20px;
    background: var(--color-border-subtle);
    margin: 0 var(--space-4);
    flex-shrink: 0;
}

.srte-toolbar__select {
    height: 28px;
    padding: 0 var(--space-4);
    font-size: 12px;
    font-family: inherit;
    color: var(--color-text-primary);
    background: var(--color-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-small);
    cursor: pointer;
    outline: none;
}

.srte-toolbar__select:focus {
    border-color: var(--color-primary);
}

/* ── Inline link input row ── */

.srte-link-input {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-8);
    background: var(--color-grey-50);
    border: 1px solid var(--color-border-subtle);
    border-bottom: none;
}

.srte-link-input__field {
    flex: 1;
    min-width: 0;
}

/* ── Table insert panel ── */

.srte-table-input {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-4) var(--space-8);
    background: var(--color-grey-50);
    border: 1px solid var(--color-border-subtle);
    border-top: none;
}

.srte-table-input__label {
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
    white-space: nowrap;
}

.srte-table-input__num {
    width: 52px;
    text-align: center;
}

.srte-table-input__x {
    font-size: 13px;
    color: var(--color-text-secondary, #6b7280);
}

/* Adjust editor border when toolbar is shown */
.srte-toolbar + div.simple-rich-text-editor,
.srte-toolbar + .srte-link-input + div.simple-rich-text-editor,
.srte-toolbar + .srte-table-input + div.simple-rich-text-editor,
.srte-toolbar ~ div.simple-rich-text-editor {
    border-radius: 0 0 var(--radius-small) var(--radius-small);
}

/* ── Generic Dropzone ────────────────────────────────────────────────────── */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-24) var(--space-16);
    border: 2px dashed var(--color-border-subtle);
    border-radius: var(--radius-medium);
    background: var(--color-grey-50);
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}

.dropzone:hover,
.dropzone--active {
    border-color: var(--color-brand-primary);
    background: rgba(0, 95, 158, 0.04);
}

.dropzone-icon {
    font-size: 32px;
    color: var(--color-text-secondary);
}

.dropzone--active .dropzone-icon {
    color: var(--color-brand-primary);
}

.dropzone-label {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* The <InputFile> is visually hidden; the whole .dropzone area is clickable */
.dropzone-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   SECONDARY BLUE BUTTON (shared utility — workflow + any future module)
   ========================================================================== */

/* White background, brand-primary border/text; toggle-active inverts colours */
.btn-secondary-blue {
    background: var(--color-white) !important;
    color: var(--color-brand-primary) !important;
    border: 1px solid var(--color-brand-primary) !important;
}

.btn-secondary-blue:hover {
    background: rgba(0, 95, 158, 0.06) !important;
}

.btn-secondary-blue.toggle-active {
    background: var(--color-brand-primary) !important;
    color: var(--color-white) !important;
}

/* ==========================================================================
   TASK CARDS (kanban board cards — moved from workflow.css, U15)
   ========================================================================== */

.task-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-medium);
    padding: var(--space-12);
    cursor: pointer;
    transition: all 0.2s;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-brand-primary);
}

.task-card.selected {
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 2px rgba(0, 95, 158, 0.1);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-8);
}

.task-card-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    flex: 1;
}

.task-card-icons {
    display: flex;
    gap: var(--space-4);
}

.icon-button {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: var(--radius-small);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:hover {
    background: var(--color-grey-100);
}

.icon-button img {
    width: 20px;
    height: 20px;
    display: block;
}

.task-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.task-description {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.task-assigned {
    font-size: 11px;
    color: var(--color-text-muted);
}

.task-assigned .label {
    font-weight: 600;
}

/* Kanban card: rejected accent */
.task-card--rejected {
    border-left: 3px solid var(--color-error, #d32f2f);
}

/* Kanban card: badge row */
.task-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-small);
    background: var(--color-grey-100);
    color: var(--color-text-secondary);
}

.card-badge--checklist { background: #e8f4fd; color: #1565c0; }
.card-badge--bcf       { background: #fff3e0; color: #e65100; }
.card-badge--files     { background: #f3e5f5; color: #6a1b9a; }
.card-badge--ids       { background: #e8f5e9; color: #2e7d32; }

/* ── Workflow kanban card (compact 3-row layout) ──────────────────────── */
.workflow-card {
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.workflow-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.workflow-card__title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.workflow-card__settings {
    flex-shrink: 0;
}

.workflow-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    min-height: 20px;
}

.workflow-card__badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-small);
    white-space: nowrap;
}

.workflow-card__badge--type {
    background: var(--color-grey-100);
    color: var(--color-text-secondary);
}

.workflow-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
}

.workflow-card__user {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.workflow-card__due {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.workflow-card__due--overdue {
    color: var(--color-error, #d32f2f);
    font-weight: 600;
}

/* BCF status badge colour overrides on task cards — uses canonical BCF status colour tokens */
.card-badge--bcf.bcf-badge--new,
.bcf-overflow-item.bcf-badge--new         { background: rgba(var(--bcf-status-new-rgb), 0.12);         color: var(--bcf-status-new); }
.card-badge--bcf.bcf-badge--in-progress,
.bcf-overflow-item.bcf-badge--in-progress { background: rgba(var(--bcf-status-in-progress-rgb), 0.15); color: #997300; }
.card-badge--bcf.bcf-badge--waiting,
.bcf-overflow-item.bcf-badge--waiting     { background: rgba(var(--bcf-status-waiting-rgb), 0.12);     color: var(--bcf-status-waiting); }
.card-badge--bcf.bcf-badge--done,
.bcf-overflow-item.bcf-badge--done        { background: rgba(var(--bcf-status-done-rgb), 0.12);        color: var(--bcf-status-done); }
.card-badge--bcf.bcf-badge--closed,
.bcf-overflow-item.bcf-badge--closed      { background: rgba(var(--bcf-status-closed-rgb), 0.12);      color: var(--bcf-status-closed); }
.card-badge--bcf.bcf-badge--muted,
.bcf-overflow-item.bcf-badge--muted       { background: var(--color-grey-200);                         color: var(--color-text-muted); }

/* BCF overflow (+N) trigger badge */
.card-badge--bcf-overflow {
    background: var(--color-grey-200);
    color: var(--color-text-muted);
    cursor: pointer;
}

/* BCF overflow dropdown container and items */
.bcf-overflow-container {
    position: relative;
    display: inline-flex;
}

.bcf-overflow-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 200;
    background: var(--color-white, #fff);
    border: 1px solid var(--color-grey-300, #e0e0e0);
    border-radius: var(--radius-small);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 110px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bcf-overflow-item {
    padding: 3px 8px;
    border-radius: var(--radius-small);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.bcf-overflow-item:hover {
    filter: brightness(0.93);
}

/* Rejected-card upload CTA button */
.btn-card-rejected-cta {
    display: block;
    width: 100%;
    margin-top: var(--space-8);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-error, #d32f2f);
    background: var(--color-error-light, #fdecea);
    border: 1px solid var(--color-error, #d32f2f);
    border-radius: var(--radius-small);
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.btn-card-rejected-cta:hover {
    background: var(--color-error, #d32f2f);
    color: var(--color-white, #fff);
}

/* ==========================================================================
   QA PANEL CARDS (checklist card + IDS card — moved from workflow.css, U15)
   ========================================================================== */

/* QA checklist card */
.qa-checklist-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-medium);
    padding: var(--space-8) var(--space-12);
    cursor: pointer;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.qa-checklist-card:hover {
    box-shadow: var(--shadow-md);
}

/* Status left-border variants */
.qa-status-new      { border-left: 3px solid var(--color-grey-400); }
.qa-status-self     { border-left: 3px solid var(--color-warning); }
.qa-status-superior { border-left: 3px solid var(--color-brand-primary); }
.qa-status-approved { border-left: 3px solid var(--color-success); }

/* QA card inner sections */
.qa-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qa-card-status {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.qa-card-counts {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.qa-card-responsible {
    font-size: 11px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.qa-card-steps {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* IDS row and card */
.qa-ids-row {
    display: flex;
    gap: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border-subtle);
}

.qa-ids-card {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-8) var(--space-12);
    background: var(--color-white);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-medium);
    cursor: pointer;
    font-size: 13px;
    transition: box-shadow 0.15s;
}

.qa-ids-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-brand-primary);
}

