/* ============================================================
   Gestion Projet Construction - Frontend Styles
   Prefix: .mpv2-
   ============================================================ */

/* Container — also works with .mpv2 wrapper */
.mpv2-frontend-container,
.mpv2 {
    max-width: 1600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    color: #333;
}

/* Header */
.mpv2-header {
    margin-bottom: 20px;
}

.mpv2-header h2 {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

/* Tabs */
.mpv2-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mpv2-tabs::-webkit-scrollbar {
    display: none;
}

.mpv2-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
}

.mpv2-tab:hover {
    color: #1B3A5C;
    background: #f8fafc;
}

.mpv2-tab.active {
    color: #fff;
    background: #1B3A5C;
    border-bottom-color: #E8A630;
    border-radius: 6px 6px 0 0;
}

/* Content Wrapper — stacked layout (nav bar on top) */
.mpv2-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* Sidebar (now horizontal nav bar) */
.mpv2-sidebar {
    width: 100%;
    flex-shrink: 0;
}

.mpv2-sidebar h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navigation (Month/Project) */
.mpv2-month-nav,
.mpv2-project-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Month/Project Carousel Wrapper (injected by JS) */
.mpv2-carousel-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.mpv2-carousel-wrap .mpv2-month-nav,
.mpv2-carousel-wrap .mpv2-project-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    gap: 0;
}

.mpv2-carousel-wrap .mpv2-month-nav::-webkit-scrollbar,
.mpv2-carousel-wrap .mpv2-project-nav::-webkit-scrollbar {
    display: none;
}

.mpv2-carousel-wrap .mpv2-month-link,
.mpv2-carousel-wrap .mpv2-month-link-validated,
.mpv2-carousel-wrap .mpv2-project-link {
    flex: 0 0 auto;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-right: 1px solid #f0f0f0;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 10px 16px;
    white-space: nowrap;
    scroll-snap-align: start;
}

.mpv2-carousel-wrap .mpv2-month-link:last-child,
.mpv2-carousel-wrap .mpv2-month-link-validated:last-child,
.mpv2-carousel-wrap .mpv2-project-link:last-child {
    border-right: none;
}

.mpv2-carousel-wrap .mpv2-month-link.active,
.mpv2-carousel-wrap .mpv2-month-link-validated.active,
.mpv2-carousel-wrap .mpv2-project-link.active {
    border-left: none;
    border-bottom-color: #E8A630;
}

/* Carousel Arrow Buttons */
.mpv2-carousel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    border: none;
    background: #f7f8fa;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
    padding: 0;
    flex-shrink: 0;
}

.mpv2-carousel-arrow:hover {
    background: #e2e8f0;
    color: #1B3A5C;
}

.mpv2-carousel-arrow:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.mpv2-carousel-arrow svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mpv2-carousel-arrow--left {
    border-right: 1px solid #e2e8f0;
}

.mpv2-carousel-arrow--right {
    border-left: 1px solid #e2e8f0;
}

/* Gradient fade indicators */
.mpv2-carousel-wrap .mpv2-month-nav.can-scroll-right,
.mpv2-carousel-wrap .mpv2-project-nav.can-scroll-right {
    mask-image: linear-gradient(to right, #000 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
}

.mpv2-carousel-wrap .mpv2-month-nav.can-scroll-left,
.mpv2-carousel-wrap .mpv2-project-nav.can-scroll-left {
    mask-image: linear-gradient(to left, #000 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, #000 85%, transparent 100%);
}

.mpv2-carousel-wrap .mpv2-month-nav.can-scroll-both,
.mpv2-carousel-wrap .mpv2-project-nav.can-scroll-both {
    mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.mpv2-month-link,
.mpv2-month-link-validated,
.mpv2-project-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.mpv2-month-link:hover,
.mpv2-month-link-validated:hover,
.mpv2-project-link:hover {
    background: #f4f6f9;
    color: #1B3A5C;
    text-decoration: none;
}

.mpv2-month-link.active,
.mpv2-month-link-validated.active,
.mpv2-project-link.active {
    background: rgba(232, 166, 48, 0.08);
    color: #1B3A5C;
    border-left-color: #E8A630;
    font-weight: 600;
}

/* Count Badge */
.mpv2-month-count,
.mpv2-project-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.mpv2-month-count.has-items,
.mpv2-project-count.has-items {
    background: rgba(232, 166, 48, 0.15);
    color: #b8860b;
}

/* Sidebar loading */
.mpv2-sidebar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
}

/* Folder items in file list */
.mpv2-folder-item {
    background: #f8fafc;
    cursor: pointer;
}
.mpv2-folder-item:hover {
    background: #eff6ff;
}
.mpv2-folder-item .mpv2-file-icon {
    font-size: 20px;
}

/* Submissions breadcrumb */
.mpv2-submissions-breadcrumb {
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
}
.mpv2-submissions-breadcrumb .mpv2-breadcrumb-item {
    color: #2563eb;
    cursor: pointer;
}
.mpv2-submissions-breadcrumb .mpv2-breadcrumb-item:hover {
    text-decoration: underline;
}
.mpv2-submissions-breadcrumb .mpv2-breadcrumb-sep {
    margin: 0 6px;
    color: #9ca3af;
}
.mpv2-submissions-breadcrumb .mpv2-breadcrumb-current {
    color: #374151;
    font-weight: 600;
}

/* Loading dot */
.mpv2-loading-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    display: inline-block;
    animation: gpc-pulse 1.4s infinite;
}

@keyframes gpc-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Main Content */
.mpv2-main {
    flex: 1;
    min-width: 0;
}

/* Empty State */
.mpv2-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 15px;
}

/* Loading */
.mpv2-loading {
    text-align: center;
    padding: 60px 20px;
}

.mpv2-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: gpc-spin 0.8s linear infinite;
    margin: 0 auto 15px;
}
.mpv2-spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gpc-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes gpc-spin {
    to { transform: rotate(360deg); }
}

/* File List */
.mpv2-file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mpv2-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.mpv2-file-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mpv2-file-icon {
    font-size: 24px;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.mpv2-file-details {
    flex: 1;
    min-width: 0;
}

.mpv2-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpv2-file-meta {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.mpv2-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Buttons */
.mpv2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    min-height: 40px;
}

.mpv2-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    text-decoration: none;
    color: #374151;
}

.mpv2-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.mpv2-btn-xs {
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 4px;
}

/* Multi-file display in submissions table */
.mpv2-multi-files {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mpv2-multi-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.mpv2-multi-file-name {
    word-break: break-all;
}

.mpv2-btn-primary {
    background: #E8A630;
    border-color: #E8A630;
    color: #1B3A5C;
    font-weight: 600;
}

.mpv2-btn-primary:hover {
    background: #D4921C;
    border-color: #D4921C;
    color: #1B3A5C;
}

.mpv2-btn-primary:disabled {
    background: #f0d68a;
    border-color: #f0d68a;
    cursor: not-allowed;
    color: #8a7340;
}

.mpv2-btn-link {
    background: none;
    border: none;
    color: #2563eb;
    padding: 5px 8px;
}

.mpv2-btn-link:hover {
    color: #1d4ed8;
    background: #eff6ff;
    text-decoration: none;
}

.mpv2-btn-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 14px;
}

.mpv2-btn-close:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Viewer */
.mpv2-viewer {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.mpv2-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.mpv2-viewer-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mpv2-viewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.mpv2-viewer-info span {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PDF Container */
.mpv2-pdf-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    max-height: 90vh;
    background: #525659;
    border: 1px solid #ddd;
    padding: 20px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mpv2-pdf-container canvas {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: white;
}

/* PDF Controls */
.mpv2-pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-top: none;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
}

/* Viewer Actions */
.mpv2-viewer-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Archives */
.mpv2-archives-wrapper {
    margin-top: 20px;
}

/* Breadcrumb */
.mpv2-breadcrumb {
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.mpv2-breadcrumb-item {
    color: #2563eb;
    cursor: pointer;
    font-weight: 500;
}

.mpv2-breadcrumb-item:hover {
    text-decoration: underline;
}

.mpv2-breadcrumb-sep {
    color: #94a3b8;
    margin: 0 4px;
}

/* Archive Folder Grid */
.mpv2-archives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.mpv2-archive-folder {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}

.mpv2-archive-folder:hover {
    background: #f0f6ff;
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.mpv2-archive-folder-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.mpv2-archive-folder-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.mpv2-archive-folder-count {
    font-size: 12px;
    color: #94a3b8;
}

/* Modal */
.mpv2-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpv2-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.mpv2-modal-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: gpc-modal-in 0.2s ease-out;
}

@keyframes gpc-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.mpv2-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.mpv2-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.mpv2-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mpv2-modal-close:hover {
    color: #ef4444;
    background: #fef2f2;
}

.mpv2-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.mpv2-modal-body p {
    margin: 0 0 10px;
    font-size: 14px;
    color: #475569;
}

.mpv2-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

/* Form Elements */
.mpv2-form-group {
    margin-top: 15px;
}

.mpv2-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 5px;
}

.mpv2-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.mpv2-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Toast Notifications */
#gpc-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mpv2-toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 400px;
}

.mpv2-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.mpv2-toast-success {
    background: #16a34a;
}

.mpv2-toast-error {
    background: #dc2626;
}

.mpv2-toast-info {
    background: #2563eb;
}

.mpv2-toast-warning {
    background: #d97706;
}

/* Inline spinner for buttons */
.mpv2-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mpv2-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes mpv2-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Soumissions Recues (n8n) Tab
   ============================================================ */

/* Tab Badge */
.mpv2-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

.mpv2-tab-badge:empty {
    display: none;
}

/* Received Wrapper */
.mpv2-received-wrapper {
    margin-top: 20px;
}

/* Filters Bar */
.mpv2-received-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mpv2-status-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.mpv2-status-filter {
    padding: 6px 14px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}

.mpv2-status-filter:hover {
    border-color: #E8A630;
    color: #1B3A5C;
    background: rgba(232, 166, 48, 0.06);
}

.mpv2-status-filter.active {
    background: #1B3A5C;
    border-color: #1B3A5C;
    color: #fff;
}

.mpv2-status-filter .mpv2-filter-count {
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.8;
}

.mpv2-received-search {
    margin-left: auto;
}

.mpv2-received-search input {
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    width: 220px;
    transition: border-color 0.15s;
}

.mpv2-received-search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Submission List */
.mpv2-received-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mpv2-received-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.mpv2-received-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mpv2-received-item.status-EN_ATTENTE {
    border-left-color: #f59e0b;
}

.mpv2-received-item.status-VALIDEE {
    border-left-color: #22c55e;
}

.mpv2-received-item.status-REJETEE {
    border-left-color: #ef4444;
}

.mpv2-received-item.status-BC_GENERE {
    border-left-color: #3b82f6;
}

.mpv2-received-item-main {
    flex: 1;
    min-width: 0;
}

.mpv2-received-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpv2-received-item-meta {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mpv2-received-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mpv2-received-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.mpv2-received-item-total {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.mpv2-received-item-alert {
    color: #f59e0b;
    font-size: 18px;
    cursor: help;
}

/* Badges */
.mpv2-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.mpv2-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.mpv2-badge-success {
    background: #dcfce7;
    color: #166534;
}

.mpv2-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.mpv2-badge-info {
    background: #dbeafe;
    color: #1e40af;
}
.mpv2-badge-archive {
    background: #e0e7ff;
    color: #3730a3;
}

.mpv2-btn-archive {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}
.mpv2-btn-archive:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
}
.mpv2-btn-archive:disabled {
    background: #a5b4fc;
    border-color: #a5b4fc;
    color: white;
}

/* Pagination */
.mpv2-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
    padding: 12px 0;
}

.mpv2-pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.mpv2-pagination button:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.mpv2-pagination button.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.mpv2-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Detail View */
.mpv2-received-detail {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
}

.mpv2-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.mpv2-detail-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* Detail Cards Grid */
.mpv2-detail-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.mpv2-detail-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.mpv2-detail-card h4 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpv2-detail-card p {
    margin: 0 0 6px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.mpv2-detail-card p strong {
    color: #1e293b;
    font-weight: 600;
}

.mpv2-detail-card .mpv2-confidence {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.mpv2-confidence-high {
    background: #dcfce7;
    color: #166534;
}

.mpv2-confidence-medium {
    background: #fef3c7;
    color: #92400e;
}

.mpv2-confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

/* Alert Box */
.mpv2-detail-alertes {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.mpv2-detail-alertes h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.mpv2-detail-alertes ul {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

.mpv2-detail-alertes li {
    font-size: 13px;
    color: #78350f;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* Lines Table */
.mpv2-lines-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 13px;
}

.mpv2-lines-table thead th {
    background: #f1f5f9;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e2e8f0;
}

.mpv2-lines-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.mpv2-lines-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.mpv2-lines-table tbody tr:hover {
    background: #eff6ff;
}

.mpv2-lines-table tbody td {
    padding: 10px 12px;
    color: #374151;
    vertical-align: top;
}

.mpv2-lines-table .mpv2-col-num {
    width: 40px;
    text-align: center;
    color: #94a3b8;
    font-weight: 600;
}

.mpv2-lines-table .mpv2-col-money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Totals Box */
.mpv2-totaux-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.mpv2-totaux-box {
    min-width: 280px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.mpv2-totaux-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
}

.mpv2-totaux-row.mpv2-totaux-total {
    border-top: 2px solid #e2e8f0;
    margin-top: 6px;
    padding-top: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.mpv2-totaux-row .mpv2-totaux-label {
    font-weight: 500;
}

.mpv2-totaux-row .mpv2-totaux-value {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Maestro Info */
.mpv2-maestro-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.mpv2-maestro-info h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #166534;
}

.mpv2-maestro-info p {
    margin: 0 0 4px;
    font-size: 13px;
    color: #15803d;
}

.mpv2-maestro-info .mpv2-missing-fields {
    color: #dc2626;
    font-weight: 500;
}

/* Validation Actions */
.mpv2-validation-actions {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.mpv2-validation-actions h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.mpv2-validation-actions .mpv2-textarea {
    margin-bottom: 14px;
}

.mpv2-validation-buttons {
    display: flex;
    gap: 10px;
}

.mpv2-btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.mpv2-btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.mpv2-btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.mpv2-btn-success:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

.mpv2-bc-pending {
    font-style: italic;
    font-size: 12px;
}

/* Validation Info (for already validated/rejected) */
.mpv2-validation-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.mpv2-validation-info p {
    margin: 0 0 4px;
    font-size: 13px;
    color: #475569;
}

.mpv2-validation-info strong {
    color: #1e293b;
}

/* Validation Progress Steps */
.mpv2-progress-steps {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.mpv2-progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: #94a3b8;
}

.mpv2-progress-step + .mpv2-progress-step {
    border-top: 1px solid #f1f5f9;
}

.mpv2-progress-step .mpv2-step-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 14px;
}

.mpv2-progress-step.pending .mpv2-step-icon {
    background: #f1f5f9;
    color: #94a3b8;
}

.mpv2-progress-step.active .mpv2-step-icon {
    background: #dbeafe;
    color: #2563eb;
}

.mpv2-progress-step.done .mpv2-step-icon {
    background: #dcfce7;
    color: #16a34a;
}

.mpv2-progress-step.error .mpv2-step-icon {
    background: #fee2e2;
    color: #dc2626;
}

.mpv2-progress-step.active {
    color: #2563eb;
    font-weight: 500;
}

.mpv2-progress-step.done {
    color: #16a34a;
}

.mpv2-progress-step.error {
    color: #dc2626;
}

.mpv2-step-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #93c5fd;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: gpc-spin 0.8s linear infinite;
}

/* BC PDF Viewer */
.mpv2-bc-viewer {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.mpv2-bc-viewer h4 {
    margin: 0;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.mpv2-bc-pdf-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    max-height: 70vh;
    background: #525659;
    padding: 20px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mpv2-bc-pdf-container canvas {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: white;
}

.mpv2-bc-pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
}

/* Utility Classes */
.mpv2-text-right {
    text-align: right;
}

.mpv2-text-muted {
    color: #94a3b8;
}

.mpv2-text-danger {
    color: #ef4444;
}

.mpv2-text-success {
    color: #16a34a;
}

.mpv2-mt-0 { margin-top: 0; }
.mpv2-mb-0 { margin-bottom: 0; }

/* Responsive — Tablet */
@media (max-width: 992px) {
    /* Carousel arrows compact on tablet */
    .mpv2-carousel-arrow {
        width: 28px;
        min-width: 28px;
    }

    .mpv2-detail-cards {
        grid-template-columns: 1fr;
    }
}

/* Responsive — Mobile */
@media (max-width: 600px) {
    .mpv2-tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .mpv2-tabs::-webkit-scrollbar {
        display: none;
    }

    .mpv2-tab {
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 44px;
    }

    .mpv2-viewer-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mpv2-archives-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mpv2-file-item {
        flex-wrap: wrap;
    }

    .mpv2-file-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .mpv2-received-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .mpv2-received-search {
        margin-left: 0;
    }

    .mpv2-received-search input {
        width: 100%;
    }

    .mpv2-received-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .mpv2-received-item-right {
        width: 100%;
        justify-content: space-between;
    }

    .mpv2-lines-table {
        display: block;
        overflow-x: auto;
    }

    .mpv2-validation-buttons {
        flex-direction: column;
    }

    .mpv2-totaux-box {
        min-width: 100%;
    }
}

/* =========================================================================
   SUPPLIERS MODULE - Design epure
   ========================================================================= */

.mpv2-suppliers-wrapper {
    padding: 8px 0;
}

/* Header */
.mpv2-suppliers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mpv2-suppliers-title {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mpv2-suppliers-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.mpv2-suppliers-stats {
    display: flex;
    gap: 8px;
}

.mpv2-stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #f1f5f9;
    color: #64748b;
}

.mpv2-stat-active {
    background: #dcfce7;
    color: #166534;
}

.mpv2-stat-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Filter bar */
.mpv2-suppliers-filterbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mpv2-search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.mpv2-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.mpv2-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.mpv2-search-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mpv2-search-input::placeholder {
    color: #94a3b8;
}

/* Toggle switch */
.mpv2-suppliers-toggle-wrapper {
    flex-shrink: 0;
}

.mpv2-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    user-select: none;
}

.mpv2-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.mpv2-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.mpv2-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s;
}

.mpv2-switch-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.mpv2-switch input:checked + .mpv2-switch-slider {
    background: #2563eb;
}

.mpv2-switch input:checked + .mpv2-switch-slider::before {
    transform: translateX(20px);
}

/* Empty state */
.mpv2-empty-hint {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Suppliers grid */
.mpv2-suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Supplier card */
.mpv2-supplier-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.mpv2-supplier-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.mpv2-supplier-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 0;
    gap: 10px;
}

.mpv2-supplier-code {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.mpv2-supplier-card-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
}

.mpv2-supplier-card-status.active {
    color: #16a34a;
}

.mpv2-supplier-card-status.active::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

.mpv2-supplier-card-status.inactive {
    color: #94a3b8;
}

.mpv2-supplier-card-status.inactive::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
}

.mpv2-supplier-card-body {
    padding: 12px 18px 14px;
}

.mpv2-supplier-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    line-height: 1.3;
}

.mpv2-supplier-info-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.4;
}

.mpv2-supplier-info-line svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.mpv2-supplier-info-line a {
    color: #2563eb;
    text-decoration: none;
}

.mpv2-supplier-info-line a:hover {
    text-decoration: underline;
}

.mpv2-supplier-specialites {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}

.mpv2-supplier-specialite-tag {
    display: inline-flex;
    padding: 2px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.mpv2-supplier-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 18px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.mpv2-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    color: #64748b;
}

.mpv2-btn-icon:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.mpv2-btn-icon-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Input fields */
.mpv2-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.mpv2-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mpv2-input::placeholder {
    color: #94a3b8;
}

select.mpv2-input {
    min-height: 44px;
    padding: 10px 12px;
    line-height: 1.4;
    cursor: pointer;
}

select.mpv2-input option {
    padding: 8px 12px;
    font-size: 14px;
}

/* Form grid 2 columns */
.mpv2-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mpv2-required {
    color: #dc2626;
}

/* Modal wide variant */
.mpv2-modal-wide {
    max-width: 900px;
}

/* Text danger */
.mpv2-text-danger {
    color: #dc2626;
    font-size: 13px;
}

/* Button danger */
.mpv2-btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.mpv2-btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Pagination */
.mpv2-suppliers-wrapper .mpv2-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.mpv2-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.mpv2-page-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.mpv2-page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.mpv2-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mpv2-page-info {
    font-size: 13px;
    color: #94a3b8;
    padding: 0 8px;
}

/* Responsive suppliers */
@media (max-width: 1024px) {
    .mpv2-suppliers-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 640px) {
    .mpv2-suppliers-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mpv2-suppliers-filterbar {
        flex-direction: column;
    }

    .mpv2-suppliers-grid {
        grid-template-columns: 1fr;
    }

    .mpv2-form-grid {
        grid-template-columns: 1fr;
    }

    .mpv2-modal-wide {
        max-width: calc(100vw - 32px);
    }
}

/* =========================================================================
   PROJECTS TAB
   ========================================================================= */

.mpv2-projects-wrapper {
    padding: 8px 0;
}

.mpv2-projects-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mpv2-projects-title {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mpv2-projects-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.mpv2-projects-stats {
    display: flex;
    gap: 8px;
}

.mpv2-projects-filterbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mpv2-projects-toggle-wrapper {
    flex-shrink: 0;
}

.mpv2-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.mpv2-project-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.mpv2-project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.mpv2-project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 0;
    gap: 10px;
}

.mpv2-project-code {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.mpv2-project-card-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
}

.mpv2-project-card-status.active {
    color: #16a34a;
}

.mpv2-project-card-status.active::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}

.mpv2-project-card-status.inactive {
    color: #94a3b8;
}

.mpv2-project-card-status.inactive::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
}

.mpv2-project-card-body {
    padding: 12px 18px 14px;
}

.mpv2-project-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    line-height: 1.3;
}

.mpv2-project-info-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.4;
}

.mpv2-project-info-line svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.mpv2-project-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px 18px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.mpv2-projects-wrapper .mpv2-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Responsive projects */
@media (max-width: 1024px) {
    .mpv2-projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 640px) {
    .mpv2-projects-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mpv2-projects-filterbar {
        flex-direction: column;
    }

    .mpv2-projects-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   TENDERS (APPELS D'OFFRES) TAB
   ========================================================================= */

.mpv2-tenders-wrapper {
    padding: 8px 0;
}

.mpv2-tenders-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mpv2-tenders-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mpv2-tenders-status-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.mpv2-tenders-search {
    flex: 1;
    min-width: 200px;
}

.mpv2-toggle-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.15s;
    user-select: none;
}
.mpv2-toggle-filter:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.mpv2-toggle-filter input:checked + span {
    color: #1d4ed8;
    font-weight: 600;
}
.mpv2-toggle-filter:has(input:checked) {
    border-color: #93c5fd;
    background: #eff6ff;
}

.mpv2-tenders-search input {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.mpv2-tenders-search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Badge default */
.mpv2-badge-default {
    background: #f1f5f9;
    color: #475569;
}

/* ---- Tenders list (row-based layout) ---- */
.mpv2-tenders-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mpv2-tender-row {
    display: grid;
    grid-template-columns: 100px 110px 90px 1fr 140px 150px 150px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-size: 13px;
}

.mpv2-tender-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mpv2-tender-row-status {
    display: flex;
    align-items: center;
}

.mpv2-tender-row-ref {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpv2-tender-row-project {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.mpv2-tender-row-title {
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.mpv2-tender-row-counts {
    display: flex;
    gap: 10px;
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
}

.mpv2-tender-row-date {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
}

.mpv2-tender-row-author {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive tenders list */
@media (max-width: 1200px) {
    .mpv2-tender-row {
        grid-template-columns: 90px 100px 80px 1fr 120px 130px;
    }
    .mpv2-tender-row-author {
        display: none;
    }
}

@media (max-width: 900px) {
    .mpv2-tender-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .mpv2-tender-row-status {
        order: -1;
    }
    .mpv2-tender-row-author {
        display: block;
        text-align: left;
    }
}

/* ── Soumissions Accordion (V2) ── */
.mpv2-tenders-accordion { display:flex; flex-direction:column; gap:8px; }

.mpv2-accordion-section { border:1px solid #e2e8f0; border-radius:10px; overflow:hidden; background:#fff; transition:border-color .15s; }
.mpv2-accordion-section.mpv2-accordion-open { border-color:#cbd5e1; }

.mpv2-accordion-header { display:flex; align-items:center; gap:12px; padding:14px 18px; background:#f8fafc; cursor:pointer; user-select:none; transition:background .15s; }
.mpv2-accordion-header:hover { background:#f1f5f9; }

.mpv2-accordion-arrow { font-size:12px; color:#64748b; transition:transform .2s; width:16px; text-align:center; flex-shrink:0; }
.mpv2-accordion-open .mpv2-accordion-arrow { transform:rotate(90deg); }

.mpv2-accordion-code { font-weight:700; font-size:14px; color:#1e293b; }
.mpv2-accordion-desc { font-size:13px; color:#64748b; flex:1; }

.mpv2-accordion-badges { display:flex; gap:8px; font-size:11px; flex-shrink:0; }
.mpv2-accordion-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:12px; font-weight:500; }
.mpv2-accordion-badge.ab-suppliers { background:#EFF6FF; color:#1D4ED8; }
.mpv2-accordion-badge.ab-submissions { background:#FFF7ED; color:#C2410C; }
.mpv2-accordion-badge.ab-signed { background:#F0FDF4; color:#166534; }

.mpv2-accordion-body { padding:0; border-top:1px solid #e2e8f0; display:none; }
.mpv2-accordion-open .mpv2-accordion-body { display:block; }

/* Supplier rows inside accordion */
.mpv2-acc-table { width:100%; border-collapse:collapse; }
.mpv2-acc-table th { text-align:left; padding:10px 16px; font-size:11px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:.3px; border-bottom:1px solid #e2e8f0; background:#fafbfc; }
.mpv2-acc-table td { padding:10px 16px; font-size:13px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.mpv2-acc-table tr:last-child td { border-bottom:none; }
.mpv2-acc-table tr:hover { background:#fefce8; }

.mpv2-acc-status { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:500; }
.mpv2-acc-status .dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.mpv2-acc-status .dot.green { background:#10B981; }
.mpv2-acc-status .dot.orange { background:#F59E0B; }
.mpv2-acc-status .dot.red { background:#EF4444; }
.mpv2-acc-status .dot.gray { background:#94A3B8; }
.mpv2-acc-status .dot.blue { background:#3B82F6; }

.mpv2-accordion-actions { display:flex; gap:8px; padding:12px 16px; background:#f8fafc; border-top:1px solid #f1f5f9; }

/* Generate CTA */
.mpv2-generate-cta { text-align:center; padding:40px 24px; }
.mpv2-generate-cta p { font-size:14px; color:#64748b; margin:0 0 20px; }

@media (max-width:768px) {
    .mpv2-accordion-header { flex-wrap:wrap; padding:12px 14px; }
    .mpv2-accordion-badges { width:100%; margin-top:6px; }
    .mpv2-acc-table th, .mpv2-acc-table td { padding:8px 12px; font-size:12px; }
}

/* Search box component */
.mpv2-searchbox {
    position: relative;
}
.mpv2-searchbox input[readonly] {
    cursor: pointer !important;
}

.mpv2-searchbox-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 260px;
    overflow-y: auto;
}

.mpv2-searchbox-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

.mpv2-searchbox-item:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.mpv2-searchbox-item:last-child {
    border-bottom: none;
}

.mpv2-searchbox-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
}

.mpv2-searchbox-selected {
    margin-top: 6px;
}

/* Tags */
.mpv2-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin: 3px 4px 3px 0;
    white-space: nowrap;
}

.mpv2-tag-remove {
    background: none;
    border: none;
    color: #60a5fa;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    transition: color 0.15s;
}

.mpv2-tag-remove:hover {
    color: #dc2626;
}

.mpv2-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 6px;
    min-height: 0;
}

/* Table responsive */
.mpv2-table-responsive {
    overflow-x: auto;
    margin-bottom: 16px;
}

/* Detail actions */
.mpv2-detail-actions {
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid #e2e8f0;
}

.mpv2-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Detail lines section heading */
.mpv2-detail-lines {
    margin-bottom: 20px;
}

.mpv2-detail-lines h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

/* Tender-specific detail styling reuses .mpv2-received-detail */

/* ── GPC V1 styles used by BC Express V2 ── */
.gpc-bc-express-wrapper { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:24px; margin-bottom:24px; }
.gpc-form-group { margin-bottom:16px; }
.gpc-form-group label { display:block; font-size:13px; font-weight:600; color:#374151; margin-bottom:6px; }
.gpc-required { color:#ef4444; }
.gpc-text-muted { font-size:14px; color:#64748b; }
.gpc-form-grid { display:grid; gap:16px; margin-bottom:16px; }
.gpc-input { width:100%; padding:10px 12px; border:1px solid #d1d5db; border-radius:8px; font-size:13px; font-family:inherit; transition:border-color .15s, box-shadow .15s; }
.gpc-input:focus { border-color:#2E75B6; outline:none; box-shadow:0 0 0 3px rgba(46,117,182,.12); }
.gpc-input-sm { padding:6px 10px; font-size:12px; }
.gpc-btn { display:inline-flex; align-items:center; justify-content:center; padding:10px 20px; font-size:14px; font-weight:600; border-radius:8px; border:1px solid #d1d5db; background:#fff; color:#374151; cursor:pointer; font-family:inherit; transition:all .15s; }
.gpc-btn:hover { background:#f8fafc; border-color:#94a3b8; }
.gpc-btn-sm { padding:6px 14px; font-size:12px; }
.gpc-btn-primary { background:#E8A630; color:#1B3A5C; border-color:#E8A630; }
.gpc-btn-primary:hover { background:#D4921C; }
.gpc-btn-danger { color:#ef4444; border-color:#fecaca; }
.gpc-btn-remove-item { background:none; border:none; color:#ef4444; cursor:pointer; font-size:18px; font-weight:700; padding:2px 6px; }
.gpc-btn-remove-item:hover { color:#dc2626; }

/* Searchbox (V1 pattern) */
.gpc-searchbox { position:relative; }
.gpc-searchbox-inline { position:relative; }
.gpc-searchbox-results { position:absolute; top:100%; left:0; right:0; z-index:100; background:#fff; border:1px solid #e2e8f0; border-top:none; border-radius:0 0 8px 8px; box-shadow:0 4px 12px rgba(0,0,0,.1); max-height:260px; overflow-y:auto; }
.gpc-searchbox-item { padding:10px 14px; cursor:pointer; font-size:13px; color:#374151; border-bottom:1px solid #f1f5f9; transition:background .1s; }
.gpc-searchbox-item:hover { background:#eff6ff; color:#1d4ed8; }
.gpc-searchbox-item:last-child { border-bottom:none; }
.gpc-searchbox-empty { padding:12px 14px; font-size:13px; color:#94a3b8; text-align:center; }
.gpc-searchbox-inline .gpc-activity-results { position:fixed; z-index:999999; background:#fff; border:1px solid #d1d5db; border-radius:6px; box-shadow:0 6px 20px rgba(0,0,0,.18); max-height:350px; min-width:320px; overflow-y:auto; }
.gpc-activity-results .gpc-searchbox-item { padding:6px 10px; font-size:12px; cursor:pointer; }
.gpc-activity-results .gpc-searchbox-item:hover { background:#eff6ff; }
.gpc-activity-results .gpc-searchbox-empty { padding:8px 10px; font-size:12px; color:#94a3b8; text-align:center; }

/* Tender items table (V1 pattern) */
.gpc-tender-items-wrapper { border:1px solid #e2e8f0; border-radius:8px; overflow:visible; }
.gpc-tender-items-table-scroll { overflow-x:auto; }
.gpc-tender-items-table { width:100%; border-collapse:collapse; font-size:13px; }
.gpc-tender-items-table th { text-align:left; padding:8px 10px; font-size:11px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:.3px; border-bottom:1px solid #e2e8f0; background:#f8fafc; }
.gpc-tender-items-table td { padding:6px 8px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.gpc-ti-col-num { width:35px; text-align:center; }
.gpc-ti-col-code { min-width:200px; }
.gpc-ti-col-desc { min-width:180px; }
.gpc-ti-col-qty { width:80px; }
.gpc-ti-col-unit { width:70px; }
.gpc-ti-col-actions { width:40px; text-align:center; }
.gpc-item-line-num { font-size:12px; color:#94a3b8; font-weight:600; }

/* Dropzone (V1 pattern) */
.gpc-dropzone { border:2px dashed #CBD5E1; border-radius:12px; padding:28px 20px; text-align:center; background:#FAFBFC; transition:all .2s ease; cursor:pointer; }
.gpc-dropzone:hover { border-color:#2E75B6; background:#F0F7FF; }
.gpc-dropzone.gpc-dropzone-active { border-color:#2E75B6; background:#E8F0FE; border-style:solid; box-shadow:0 0 0 3px rgba(46,117,182,.15); }
.gpc-dropzone-content { display:flex; flex-direction:column; align-items:center; gap:4px; }
.gpc-dropzone-text { font-size:14px; font-weight:600; color:#475569; }
.gpc-dropzone-or { font-size:12px; color:#94A3B8; margin:2px 0; }
.gpc-dropzone-hint { font-size:11px; color:#94A3B8; margin-top:6px; }
.gpc-dropzone-file { display:flex; align-items:center; justify-content:center; gap:10px; }

/* Alert + Spinner (V1 pattern) */
.gpc-alert { padding:14px 18px; border-radius:8px; font-size:14px; }
.gpc-alert-info { background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af; }
.gpc-alert-success { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }
.gpc-spinner { width:36px; height:36px; border:3px solid #e2e8f0; border-top-color:#2563eb; border-radius:50%; animation:gpc-spin .8s linear infinite; margin:0 auto 15px; }
@keyframes gpc-spin { to { transform:rotate(360deg); } }

/* Tender items table (modal) */
.mpv2-tender-items-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.mpv2-tender-items-table-scroll {
    overflow-x: auto;
}

.mpv2-tender-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mpv2-tender-items-table thead th {
    background: #f8fafc;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.mpv2-tender-items-table tbody td {
    padding: 4px 4px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.mpv2-ti-col-num { width: 35px; text-align: center; }
.mpv2-ti-col-code { width: 220px; }
.mpv2-ti-col-desc { min-width: 200px; }
.mpv2-ti-col-qty { width: 80px; }
.mpv2-ti-col-unit { width: 80px; }
.mpv2-ti-col-actions { width: 30px; text-align: center; }

.mpv2-item-line-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
}

.mpv2-input-sm {
    padding: 5px 8px !important;
    font-size: 13px !important;
    min-height: auto !important;
}

.mpv2-tender-items-table .mpv2-item-description {
    width: 100%;
    resize: vertical;
    min-height: 32px;
}

.mpv2-tender-items-table .mpv2-item-qty,
.mpv2-tender-items-table .mpv2-item-unit {
    width: 100%;
}

.mpv2-btn-remove-item {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
}

.mpv2-btn-remove-item:hover {
    color: #ef4444;
    background: #fef2f2;
}

.mpv2-searchbox-inline {
    position: relative;
}

.mpv2-searchbox-inline .mpv2-activity-results {
    position: fixed;
    z-index: 999999;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    max-height: 350px;
    min-width: 320px;
    overflow-y: auto;
}

.mpv2-activity-results .mpv2-searchbox-item {
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.mpv2-activity-results .mpv2-searchbox-item:hover {
    background: #eff6ff;
}

.mpv2-activity-results .mpv2-searchbox-empty {
    padding: 8px 10px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

#btn-add-tender-item {
    margin: 8px 12px;
    font-size: 13px;
}

/* Tender items in detail view */
#tender-items-section {
    margin-bottom: 24px;
}

#tender-items-section h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

/* Responsive tenders */
@media (max-width: 768px) {
    .mpv2-tenders-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .mpv2-tenders-search {
        min-width: 100%;
    }

    .mpv2-action-buttons {
        flex-direction: column;
    }

    .mpv2-ti-col-code { width: 160px; }
}

/* =========================================================================
   SUPPLIER PORTAL (integrated tab)
   ========================================================================= */

/* Portal mode: centered, clean layout - hide all normal tabs */
.mpv2-portal-mode {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Override OceanWP wide container for portal landing page */
body .mpv2-portal-mode .container,
.mpv2-portal-mode .container {
    width: 100% !important;
    max-width: 900px !important;
}

.mpv2-portal-mode .mpv2-tab-content:not(#tab-portal) {
    display: none !important;
}

.mpv2-portal-mode #tab-portal {
    display: block !important;
}

.mpv2-portal-wrapper {
    padding: 20px 0;
}

.mpv2-portal-header {
    text-align: center;
    margin-bottom: 32px;
}

.mpv2-portal-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}

.mpv2-portal-subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* Portal states */
.mpv2-portal-error,
.mpv2-portal-expired {
    text-align: center;
    padding: 40px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
}

.mpv2-portal-error h2,
.mpv2-portal-expired h2 {
    color: #991b1b;
    font-size: 20px;
    margin: 0 0 12px;
}

.mpv2-portal-error p,
.mpv2-portal-expired p {
    color: #7f1d1d;
    font-size: 14px;
    margin: 0 0 8px;
}

.mpv2-portal-submitted {
    text-align: center;
    padding: 40px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    margin-bottom: 24px;
}

.mpv2-portal-submitted h2 {
    color: #1e40af;
    font-size: 20px;
    margin: 0 0 16px;
}

.mpv2-portal-submission-info {
    text-align: left;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.mpv2-portal-submission-info p {
    margin: 0 0 6px;
    font-size: 14px;
    color: #374151;
}

/* Portal info cards */
.mpv2-portal-info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.mpv2-portal-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.mpv2-portal-card h3 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpv2-portal-card p {
    margin: 0 0 6px;
    font-size: 14px;
    color: #374151;
}

.mpv2-portal-card p strong {
    color: #1e293b;
    font-weight: 600;
}

.mpv2-portal-card-deadline {
    background: #fffbeb;
    border-color: #fde68a;
}

.mpv2-portal-deadline-date {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}

.mpv2-portal-days-left {
    font-size: 14px;
    color: #92400e !important;
    font-weight: 500;
}

.mpv2-portal-days-left.mpv2-portal-urgent {
    color: #dc2626 !important;
}

/* Portal items section */
.mpv2-portal-items-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.mpv2-portal-items-section h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* Upload section */
.mpv2-portal-upload-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
}

.mpv2-portal-upload-section h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* Dropzone - uses <label> for native file picker on all devices */
.mpv2-portal-dropzone {
    display: block;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 20px;
    -webkit-tap-highlight-color: transparent;
}

.mpv2-portal-dropzone:hover,
.mpv2-portal-dropzone-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.mpv2-portal-dropzone-content p {
    margin: 8px 0 0;
    font-size: 14px;
    color: #64748b;
}

.mpv2-portal-browse {
    color: #2563eb;
    font-weight: 500;
    cursor: pointer;
}

.mpv2-portal-dropzone-hint {
    font-size: 12px !important;
    color: #94a3b8 !important;
}

/* Selected file */
.mpv2-portal-file-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 20px;
}

#portal-file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #166534;
}

#portal-file-size {
    font-size: 12px;
    color: #64748b;
}

.mpv2-portal-btn-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
}

.mpv2-portal-btn-remove:hover {
    color: #ef4444;
}

/* Portal form fields */
.mpv2-portal-form-fields {
    margin-bottom: 24px;
}

/* Progress bar */
.mpv2-portal-progress {
    margin-bottom: 20px;
}

.mpv2-portal-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.mpv2-portal-progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}

#portal-progress-text {
    font-size: 13px;
    color: #64748b;
}

/* Submit button full width */
.mpv2-portal-btn-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
}

/* Success state */
.mpv2-portal-success {
    text-align: center;
    padding: 60px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}

.mpv2-portal-success h2 {
    color: #166534;
    font-size: 22px;
    margin: 16px 0 12px;
}

.mpv2-portal-success p {
    color: #15803d;
    font-size: 14px;
    margin: 0 0 8px;
}

/* Portal responsive */
@media (max-width: 768px) {
    .mpv2-portal-info-cards {
        grid-template-columns: 1fr;
    }

    .mpv2-portal-upload-section {
        padding: 20px;
    }
}

/* ========================================
   PORTAL BC SIGNING
   ======================================== */

.mpv2-portal-signing {
    max-width: 900px;
    margin: 0 auto;
}

/* PDF Viewer */
.mpv2-signing-pdf-viewer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.mpv2-signing-pdf-container {
    text-align: center;
    padding: 16px;
    min-height: 400px;
    overflow-x: auto;
    background: #e5e7eb;
}

.mpv2-signing-pdf-container canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mpv2-signing-pdf-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

/* Signature section */
.mpv2-signing-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.mpv2-signing-section h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #1e293b;
}

/* Signer fields */
.mpv2-signing-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 20px 0;
}

/* Submit button */
.mpv2-signing-submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.mpv2-signing-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress */
.mpv2-signing-progress {
    text-align: center;
    padding: 40px;
}

.mpv2-signing-progress p {
    margin-top: 12px;
    color: #475569;
}

/* Already signed */
.mpv2-portal-already-signed {
    text-align: center;
    padding: 60px 30px;
}

.mpv2-portal-already-signed h2 {
    color: #2196F3;
    margin: 16px 0 8px;
}

.mpv2-portal-already-signed p {
    color: #475569;
    font-size: 14px;
    margin: 0 0 8px;
}

/* ---- Tender Attachments ---- */
.mpv2-tender-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 10px;
}
.mpv2-tender-dropzone:hover {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.04);
}
.mpv2-tender-dropzone.dragover {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.08);
    border-style: solid;
}
.mpv2-tender-dropzone .mpv2-dropzone-content {
    pointer-events: none;
}
.mpv2-tender-dropzone .mpv2-dropzone-content a {
    pointer-events: auto;
}

.mpv2-tender-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mpv2-attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    flex-wrap: wrap;
}

.mpv2-attachment-item.mpv2-attachment-new {
    border-color: #93c5fd;
    background: #eff6ff;
}

.mpv2-attachment-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 0;
}

.mpv2-attachment-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.mpv2-attachment-name {
    font-weight: 500;
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.mpv2-attachment-size {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

.mpv2-attachment-desc {
    flex: 1;
    min-width: 0;
}

.mpv2-attachment-desc span {
    font-size: 13px;
}

.mpv2-attachment-desc-input {
    flex: 1;
    min-width: 150px;
}

.mpv2-attachment-desc-input .mpv2-input {
    font-size: 13px;
    padding: 4px 8px;
    width: 100%;
}

.mpv2-attachment-remove {
    flex-shrink: 0;
    padding: 2px 8px !important;
    font-size: 16px;
    line-height: 1;
}

.mpv2-attachment-upload-section {
    margin-top: 10px;
}

.mpv2-attachment-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    background: #f1f5f9;
    border: 1px dashed #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
}

.mpv2-attachment-upload-btn:hover {
    background: #e2e8f0;
    border-color: #64748b;
    color: #1e293b;
}

/* Responsive */
@media (max-width: 768px) {
    .mpv2-signing-fields {
        grid-template-columns: 1fr;
    }

    .mpv2-signing-section {
        padding: 16px;
    }

    .mpv2-attachment-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .mpv2-attachment-name {
        max-width: 100%;
    }

    .mpv2-attachment-desc-input {
        width: 100%;
    }
}

/* ============================================================
   BC Express Tab
   ============================================================ */

.mpv2-bc-express-wrapper {
    max-width: 100%;
    padding: 20px 0;
}

/* BC Express history — compact layout */
#bce-history-table {
    font-size: 12.5px;
}

#bce-history-table th {
    padding: 8px 10px;
    white-space: nowrap;
}

#bce-history-table td {
    padding: 7px 10px;
}

#bce-history-table .bce-actions-cell .mpv2-btn-sm {
    padding: 3px 7px;
    font-size: 11px;
}

#bce-supplier-selected .mpv2-tag {
    display: inline-flex;
    align-items: center;
}

.mpv2-file-upload-zone {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* Drag & Drop zone */
.mpv2-dropzone {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    background: #FAFBFC;
    transition: all 0.2s ease;
    cursor: pointer;
}
.mpv2-dropzone:hover {
    border-color: #2E75B6;
    background: #F0F7FF;
}
.mpv2-dropzone.mpv2-dropzone-active {
    border-color: #2E75B6;
    background: #E8F0FE;
    border-style: solid;
    box-shadow: 0 0 0 3px rgba(46, 117, 182, 0.15);
}
.mpv2-dropzone.mpv2-dropzone-reject {
    border-color: #E74C3C;
    background: #FFF5F5;
}
.mpv2-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.mpv2-dropzone-text {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}
.mpv2-dropzone-or {
    font-size: 12px;
    color: #94A3B8;
    margin: 2px 0;
}
.mpv2-dropzone-hint {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 6px;
}
.mpv2-dropzone-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.mpv2-dropzone-file #btn-bce-file-remove {
    padding: 2px 8px;
    font-size: 14px;
    line-height: 1;
    min-width: auto;
}

#bce-result .mpv2-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
}

#bce-result .mpv2-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

#bce-result .mpv2-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.mpv2-alert-warning {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    margin-bottom: 12px;
}


.bce-history-section {
    margin-top: 10px;
}

#bce-history-table .bce-actions-cell {
    white-space: nowrap;
}

#bce-history-table .bce-actions-cell .mpv2-btn-sm {
    margin-right: 4px;
    margin-bottom: 2px;
}

/* =========================================================================
   PURCHASE ORDERS TAB (Bons de Commande)
   ========================================================================= */

.mpv2-po-wrapper {
    padding: 0;
}

.mpv2-po-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.mpv2-po-title {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mpv2-po-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mpv2-po-montant-total {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.mpv2-po-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mpv2-po-status-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.mpv2-po-table-header,
.mpv2-po-row {
    display: grid;
    grid-template-columns: 120px 130px 1fr 100px 100px 100px auto;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
}

.mpv2-po-table-header {
    font-weight: 700;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.mpv2-po-row {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 4px;
}

.mpv2-po-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mpv2-po-row-deleted {
    opacity: 0.5;
    background: #FEF2F2 !important;
}
.mpv2-po-row-deleted .mpv2-po-cell-numero,
.mpv2-po-row-deleted .mpv2-po-cell-supplier,
.mpv2-po-row-deleted .mpv2-po-cell-montant {
    text-decoration: line-through;
}

.mpv2-po-cell-numero {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpv2-po-cell-supplier {
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpv2-po-cell-project code {
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.mpv2-po-cell-montant {
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.mpv2-po-cell-created-by {
    color: #475569;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpv2-po-cell-source {
    text-align: center;
}

.mpv2-po-cell-status {
    min-width: 0;
}
.mpv2-po-cell-status .mpv2-badge {
    font-size: 11px;
    white-space: nowrap;
}
.mpv2-po-cell-date {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
}
.mpv2-po-cell-actions {
    min-width: 0;
}
.mpv2-po-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

/* Detail grid */
.mpv2-po-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.mpv2-po-detail-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

.mpv2-po-detail-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mpv2-po-detail-value {
    display: block;
    font-size: 14px;
    color: #1e293b;
    word-break: break-word;
}

.mpv2-po-detail-value a {
    color: #2563eb;
    text-decoration: none;
}

.mpv2-po-detail-value a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1100px) {
    .mpv2-po-table-header,
    .mpv2-po-row {
        grid-template-columns: 110px 120px 1fr 90px auto;
    }
    .mpv2-po-cell-source,
    .mpv2-po-cell-date {
        display: none;
    }
}

@media (max-width: 768px) {
    .mpv2-po-table-header {
        display: none;
    }
    .mpv2-po-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px;
    }
    .mpv2-po-cell-status { order: 1; }
    .mpv2-po-cell-numero { order: 2; }
    .mpv2-po-cell-supplier { order: 3; white-space: normal; }
    .mpv2-po-cell-montant { order: 4; text-align: left; }
    .mpv2-po-cell-actions { order: 5; }
    .mpv2-po-cell-source,
    .mpv2-po-cell-date,
    .mpv2-po-cell-created-by {
        display: none;
    }
    .mpv2-po-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =========================================================================
   COST TRACKING TAB (Suivi des coûts)
   ========================================================================= */

.mpv2-ct-wrapper {
    padding: 0;
}

.mpv2-ct-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.mpv2-ct-project-selector {
    min-width: 320px;
}

.mpv2-ct-project-selector select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

/* Cards grid */
.mpv2-ct-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.mpv2-text-success {
    color: #10b981;
}

.mpv2-text-danger {
    color: #ef4444;
}

.mpv2-ct-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    min-width: 0;
    overflow: hidden;
}

.mpv2-ct-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 10px;
}

.mpv2-ct-card-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mpv2-ct-card-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Charts grid */
.mpv2-ct-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.mpv2-ct-chart-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.mpv2-ct-chart-box h4 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.mpv2-ct-chart-box canvas {
    max-height: 300px;
}

.mpv2-ct-chart-full {
    grid-column: 1 / -1;
}

.mpv2-ct-chart-full canvas {
    max-height: 350px;
}

/* Table section */
.mpv2-ct-table-section {
    margin-bottom: 28px;
}

.mpv2-ct-table-section h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.mpv2-ct-table-section .mpv2-text-muted {
    font-size: 12px;
    font-weight: 400;
}

/* Reuse existing .mpv2-table styles */
.mpv2-ct-table-section .mpv2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mpv2-ct-table-section .mpv2-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.mpv2-ct-table-section .mpv2-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.mpv2-ct-table-section .mpv2-table tr:hover td {
    background: #f8fafc;
}

/* Project info header */
.mpv2-ct-project-info {
    margin: 16px 0 20px;
}

.mpv2-ct-project-info h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* Responsive — Tablette */
@media (max-width: 1024px) {
    .mpv2-ct-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .mpv2-ct-card {
        padding: 12px 10px;
        gap: 8px;
    }
    .mpv2-ct-card-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .mpv2-ct-card-icon svg {
        width: 18px;
        height: 18px;
    }
    .mpv2-ct-card-value {
        font-size: 16px;
    }
    .mpv2-ct-card-label {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .mpv2-ct-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .mpv2-ct-card {
        padding: 12px;
        gap: 10px;
    }
    .mpv2-ct-card-icon {
        width: 40px;
        height: 40px;
    }
    .mpv2-ct-card-value {
        font-size: 16px;
    }
    .mpv2-ct-charts {
        grid-template-columns: 1fr;
    }
    .mpv2-ct-project-selector {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .mpv2-ct-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .mpv2-ct-card {
        flex-direction: column;
        text-align: center;
        padding: 10px 8px;
        gap: 6px;
    }
    .mpv2-ct-card-icon {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }
    .mpv2-ct-card-icon svg {
        width: 16px;
        height: 16px;
    }
    .mpv2-ct-card-value {
        font-size: 14px;
    }
    .mpv2-ct-card-label {
        font-size: 9px;
    }
}

/* ============================================================
   Linked Projects (Projets jumelés)
   ============================================================ */
.mpv2-linked-project-panel {
    transition: border-color 0.2s;
}
.mpv2-linked-project-panel:hover {
    border-color: #cbd5e1 !important;
}
.mpv2-linked-project-panel .mpv2-tender-items-table {
    font-size: 13px;
}
.mpv2-linked-project-panel .mpv2-tender-items-table-scroll {
    max-height: 300px;
    overflow-y: auto;
}

/* ============================================================
   Budget Import Tab
   ============================================================ */
.mpv2-budget-table-header {
    display: grid;
    grid-template-columns: 90px 90px 1fr 60px 120px 130px 140px 120px;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    color: #64748b;
}
.mpv2-budget-row {
    display: grid;
    grid-template-columns: 90px 90px 1fr 60px 120px 130px 140px 120px;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-top: none;
    font-size: 0.9em;
    align-items: center;
    transition: background 0.15s;
}
.mpv2-budget-row:hover {
    background: #f1f5f9;
}
.mpv2-budget-row:last-child {
    border-radius: 0 0 8px 8px;
}
.mpv2-text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mpv2-budget-import-form {
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}


/* ==================== NOTES ==================== */

/* Toolbar */
.mpv2-notes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.mpv2-notes-new-btn { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.mpv2-notes-filter {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
}
.mpv2-notes-filter-option { cursor: pointer; }
.mpv2-notes-filter-option input { display: none; }
.mpv2-notes-filter-option span {
    display: block;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.15s;
}
.mpv2-notes-filter-option input:checked + span {
    background: #fff;
    color: #1e293b;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Empty */
.mpv2-notes-empty { text-align: center; padding: 48px 20px; color: #94a3b8; }
.mpv2-notes-empty svg { margin: 0 auto 12px; display: block; }
.mpv2-notes-empty p { margin: 0; font-size: 14px; }
.mpv2-notes-empty-sub { font-size: 12px !important; margin-top: 4px !important; }

/* ---- Thread list (style forum) ---- */
.mpv2-thread-list {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.mpv2-thread-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.12s;
}
.mpv2-thread-item:last-child { border-bottom: none; }
.mpv2-thread-item:hover { background: #fafbfc; }
.mpv2-thread-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-top: 2px;
}
.mpv2-thread-body { flex: 1; min-width: 0; }
.mpv2-thread-author {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 2px;
}
.mpv2-thread-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}
.mpv2-thread-title:hover { color: #1B3A5C; }
.mpv2-thread-desc {
    margin: 0 0 8px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}
.mpv2-thread-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}
.mpv2-thread-comments {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
}
.mpv2-thread-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
}
.mpv2-thread-date { color: #94a3b8; }

/* ---- Note detail ---- */
.mpv2-note-detail-header {
    background: #1B3A5C;
    color: #fff;
    border-radius: 10px 10px 0 0;
    padding: 14px 18px;
}
.mpv2-note-detail-nav { display: flex; align-items: center; gap: 12px; }
.mpv2-note-back-btn {
    background: rgba(255,255,255,0.1);
    border: none; color: #fff;
    width: 34px; height: 34px; border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.mpv2-note-back-btn:hover { background: rgba(255,255,255,0.2); }
.mpv2-note-detail-title-wrap h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
.mpv2-note-detail-title-wrap span { font-size: 12px; color: rgba(255,255,255,0.6); }
.mpv2-note-description {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    padding: 16px 18px;
}
.mpv2-note-description p { margin: 0; font-size: 14px; color: #334155; line-height: 1.6; white-space: pre-wrap; }

/* ---- Chat area ---- */
.mpv2-chat-area {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-top: none;
    padding: 16px;
    min-height: 80px;
    max-height: 460px;
    overflow-y: auto;
}
.mpv2-chat-empty { text-align: center; padding: 28px 16px; color: #94a3b8; }
.mpv2-chat-empty svg { margin: 0 auto 8px; display: block; }
.mpv2-chat-empty p { margin: 0; font-size: 13px; }

.mpv2-chat-msg { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.mpv2-chat-avatar {
    width: 30px; height: 30px; min-width: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700; margin-top: 2px;
}
.mpv2-chat-bubble {
    flex: 1; min-width: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 2px 12px 12px 12px;
    padding: 10px 14px;
}
.mpv2-chat-msg-me .mpv2-chat-bubble {
    background: #EFF6FF;
    border-color: #DBEAFE;
    border-radius: 12px 2px 12px 12px;
}
.mpv2-chat-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 12px; }
.mpv2-chat-meta strong { color: #1e293b; font-size: 13px; }
.mpv2-chat-meta span { color: #94a3b8; }
.mpv2-chat-delete {
    background: none; border: none; color: #cbd5e1; cursor: pointer;
    padding: 2px; border-radius: 4px; margin-left: auto;
    display: flex; align-items: center; transition: color 0.15s;
}
.mpv2-chat-delete:hover { color: #ef4444; }
.mpv2-chat-text { font-size: 14px; color: #334155; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.mpv2-comment-images { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mpv2-comment-img {
    max-width: 200px; max-height: 150px;
    border-radius: 8px; border: 1px solid #e2e8f0;
    cursor: pointer; transition: box-shadow 0.15s;
}
.mpv2-comment-img:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.mpv2-mention-tag { color: #2563eb; font-weight: 600; background: #eff6ff; padding: 1px 4px; border-radius: 3px; font-size: 13px; }
.mpv2-mention-dropdown {
    position: absolute; bottom: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 10px; max-height: 200px; overflow-y: auto;
    z-index: 10; box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.mpv2-mention-option { padding: 10px 16px; font-size: 13px; cursor: pointer; transition: background 0.1s; }
.mpv2-mention-option:hover { background: #f1f5f9; }

/* ---- Compose bar ---- */
.mpv2-chat-compose {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 12px 16px;
}
.mpv2-chat-compose-inner { display: flex; align-items: flex-end; gap: 8px; }
.mpv2-chat-compose textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px; font-family: inherit;
    padding: 10px 14px;
    resize: none;
    min-height: 42px; max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.15s;
}
.mpv2-chat-compose textarea:focus {
    outline: none;
    border-color: #E8A630;
    box-shadow: 0 0 0 3px rgba(232,166,48,0.1);
}
.mpv2-chat-attach, .mpv2-chat-send {
    background: none; border: none; cursor: pointer;
    padding: 8px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; min-height: 36px;
    transition: all 0.15s;
}
.mpv2-chat-attach { color: #64748b; }
.mpv2-chat-attach:hover { background: #f1f5f9; color: #1e293b; }
.mpv2-chat-send { background: #E8A630; color: #1B3A5C; border-radius: 50%; }
.mpv2-chat-send:hover { background: #D4921C; }
.mpv2-chat-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .mpv2-notes-toolbar { flex-direction: column; align-items: stretch; }
    .mpv2-notes-filter { align-self: center; }
    .mpv2-thread-item { padding: 14px 14px; gap: 10px; }
    .mpv2-thread-avatar { width: 34px; height: 34px; min-width: 34px; font-size: 13px; }
    .mpv2-thread-title { font-size: 14px; }
    .mpv2-thread-desc { font-size: 13px; }
    .mpv2-note-detail-header { padding: 12px 14px; }
    .mpv2-note-detail-title-wrap h3 { font-size: 14px; }
    .mpv2-chat-avatar { width: 26px; height: 26px; min-width: 26px; font-size: 10px; }
    .mpv2-chat-bubble { padding: 8px 10px; }
    .mpv2-chat-text { font-size: 13px; }
    .mpv2-comment-img { max-width: 140px; max-height: 100px; }
    .mpv2-chat-compose { padding: 10px 12px; }
    .mpv2-chat-compose textarea { font-size: 13px; padding: 8px 10px; }
}
@media (max-width: 480px) {
    .mpv2-thread-item { padding: 12px; gap: 8px; }
    .mpv2-thread-avatar { width: 30px; height: 30px; min-width: 30px; font-size: 11px; }
    .mpv2-comment-img { max-width: 100%; max-height: 200px; }
    .mpv2-comment-images { flex-direction: column; }
}
