/* BDC card design — mirrors marchespublics.gov.ma .entreprise__card */

.entreprise__card {
    display: flex;
    align-items: center;
    border: 1px solid var(--ct-border);
    border-radius: 18px;
    padding: 18px 22px;
    margin-bottom: 14px;
    gap: 28px;
    background: #fff;
    transition: all 0.25s;
}
.entreprise__card:hover {
    border-color: var(--ct-primary);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.entreprise__leftSubCard {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 80px;
}
.entreprise__leftSubCard--icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--ct-primary), var(--ct-purple));
    border-radius: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 6px;
}
.entreprise__leftSubCard--text {
    font-weight: 800;
    color: var(--ct-primary);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.entreprise__middleSubCard {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.entreprise__middleSubCard a, .entreprise__middleSubCard .e-link {
    color: var(--ct-text);
    text-decoration: none;
    transition: color 0.2s;
}
.entreprise__middleSubCard:hover .e-link { color: var(--ct-primary); }

.font-bold { font-weight: 700; }
.text-small { font-size: 0.85rem; }

.truncate_fullWidth {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entreprise__rightSubCard {
    flex-shrink: 0;
    min-width: 200px;
    text-align: center;
    color: var(--ct-text);
    text-decoration: none;
    cursor: pointer;
    border-left: 1px solid var(--ct-border);
    padding-left: 24px;
}
.entreprise__rightSubCard span {
    display: block;
    font-size: 0.85rem;
    color: var(--ct-muted);
    line-height: 1.4;
}
.entreprise__rightSubCard span.font-bold {
    color: var(--ct-text);
    font-size: 0.95rem;
    margin: 2px 0;
}
.entreprise__rightSubCard i { color: var(--ct-primary); margin-right: 4px; }

.bdc-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bdc-status-badge.bg-danger    { background: #fee2e2; color: #991b1b; }
.bdc-status-badge.bg-warning   { background: #fef3c7; color: #92400e; }
.bdc-status-badge.bg-success   { background: #d1fae5; color: #065f46; }
.bdc-status-badge.bg-primary   { background: #dbeafe; color: #1e40af; }
.bdc-status-badge.bg-secondary { background: #f1f5f9; color: #475569; }

/* Card actions on hover */
.bdc-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 8px;
}

/* ============================================================== */
/* DETAIL VIEW — mirrors content__subBox */
/* ============================================================== */

.bdc-detail-modal .modal-dialog { max-width: 960px; }
.bdc-detail-modal .modal-content { border-radius: 18px; }

.content__subBox {
    padding: 8px 4px;
}
.content__subBox h4 { font-weight: 800; }

.bdc-detail-section {
    border: 1px solid var(--ct-border);
    border-radius: 16px;
    padding: 18px 22px;
    margin-bottom: 16px;
    background: #fff;
}
.bdc-detail-section .section-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--ct-primary);
    display: block;
    margin-bottom: 10px;
}
.bdc-detail-section.cancellation { background: #fef2f2; border-color: #fecaca; }
.bdc-detail-section.cancellation .section-label { color: #991b1b; }

.content__icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    padding: 6px 0;
}
.content__icons > div {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.content__icons > div > span:first-child {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--ct-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.content__icons .flex-column .fw-bold,
.content__icons .flex-column .font-bold {
    color: var(--ct-text);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
}
.content__icons .flex-column span:not(.fw-bold):not(.font-bold) {
    color: var(--ct-muted);
    font-size: 0.9rem;
}

/* Articles accordion */
.content__article--card {
    background: #fff !important;
    color: var(--ct-text) !important;
    box-shadow: none !important;
    border-radius: 10px !important;
    font-weight: 500;
    padding: 14px 16px !important;
}
.content__article--card:not(.collapsed) {
    background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(139,92,246,0.03)) !important;
    color: var(--ct-primary) !important;
}
.accordion-item { border: 1px solid var(--ct-border); margin-bottom: 8px; border-radius: 10px; overflow: hidden; }
.accordion-item:last-child { margin-bottom: 0; }

.accordion-body__flex { padding: 18px; }
.text-gray { color: var(--ct-muted); font-size: 0.85rem; }
.text-gray .text-black { color: var(--ct-text); font-size: 0.95rem; display: block; margin-top: 6px; line-height: 1.55; }
.spec-pre { white-space: pre-wrap; }

/* Language toggle */
.lang-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--ct-soft);
    border-radius: 12px;
    border: 1px solid var(--ct-border);
}
.lang-bar-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--ct-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lang-bar-source {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--ct-muted);
    font-style: italic;
}
.lang-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--ct-border);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ct-text);
    cursor: pointer;
    transition: all 0.2s;
}
.lang-btn:hover { border-color: var(--ct-primary); color: var(--ct-primary); }
.lang-btn.active {
    background: var(--ct-primary);
    color: #fff;
    border-color: var(--ct-primary);
}
[dir="rtl"] .spec-pre,
[dir="rtl"] .text-gray .text-black { text-align: right; }
[dir="rtl"] .lang-bar-source { margin-left: 0; margin-right: auto; }

/* Attachments */
.attachment-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ct-soft);
    border: 1px solid var(--ct-border);
    border-radius: 12px;
    color: var(--ct-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.attachment-link:hover {
    border-color: var(--ct-primary);
    background: rgba(37, 99, 235, 0.05);
    color: var(--ct-primary);
    transform: translateX(2px);
}
.attachment-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--ct-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.attachment-name {
    flex: 1;
    word-break: break-word;
}

.content__article__miniCard {
    background: var(--ct-soft);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.content__article__miniCard > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}
.content__article__miniCard > div:last-child { border-bottom: none; }
.content__article--subMiniCard {
    background: #fff;
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    padding: 4px 12px;
    font-weight: 600;
    color: var(--ct-primary);
    font-size: 0.85rem;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .entreprise__card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .entreprise__rightSubCard {
        border-left: none;
        border-top: 1px solid var(--ct-border);
        padding-left: 0;
        padding-top: 14px;
        width: 100%;
        text-align: left;
    }
    .content__article__miniCard { width: 100%; }
}
