/* ========================================
   CONTRACT BENTO GRID DETAILS - PREMIUM REDESIGN
   ======================================== */

.contract-bento-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 43, 38, 0.15); /* Light tinted backdrop */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal, 0.3s) ease;
}

.contract-bento-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.contract-bento-container {
    background: var(--resca-bg-light, #f4f7f6);
    width: 95%;
    max-width: 900px;
    height: 90vh;
    max-height: 850px;
    border-radius: var(--radius-lg, 24px);
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-smooth, 0.4s), opacity var(--transition-normal, 0.3s);
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,0.1));
    position: relative;
    opacity: 0;
    scrollbar-width: none; /* Firefox */
}

.contract-bento-container::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.contract-bento-overlay.active .contract-bento-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.bento-close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background: var(--resca-white);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 100;
    color: var(--resca-dark);
}

.bento-close-btn:hover {
    background: var(--resca-error, #dc3545);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
}

/* Bento Grid Structure */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: auto;
    gap: 20px;
}

.bento-item {
    background: var(--resca-white, #fff);
    border-radius: var(--radius-md, 16px);
    padding: 24px;
    box-shadow: var(--shadow-soft, 0 2px 12px rgba(0,0,0,0.06));
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header Span All */
.bento-header {
    grid-column: span 6;
    background: transparent;
    padding: 0 0 10px 0;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bento-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--resca-dark);
    letter-spacing: -0.5px;
}

/* Grid Sizing */
.bento-item--main { grid-column: span 4; }
.bento-item--side { grid-column: span 2; }
.bento-item--half { grid-column: span 3; }
.bento-item--full { grid-column: span 6; }

@media (max-width: 768px) {
    .bento-item--main, .bento-item--side, .bento-item--half, .bento-item--full {
        grid-column: span 6;
    }
    .contract-bento-container {
        padding: 25px;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
}

/* Elements Inside Bento */
.bento-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--resca-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.bento-label .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--resca-primary);
}

.bento-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--resca-text-main, #333);
    line-height: 1.4;
}

.bento-value--large {
    font-size: 24px;
    font-weight: 900;
    color: var(--resca-dark);
}

/* Specific Blocks */
.bento-status-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-signe { background: #E6FFFA; color: #008B7A; }
.status-attente { background: #FFFBEB; color: #B45309; }
.status-default { background: #F3F4F6; color: #4B5563; }

/* Donut Chart Redesign */
.bento-donut-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.bento-donut-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.bento-donut-bg {
    fill: none;
    stroke: var(--resca-border-light, #f0f0f0);
    stroke-width: 4.5;
}

.bento-donut-fill {
    fill: none;
    stroke-width: 4.5;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s var(--transition-smooth), stroke 0.5s ease;
}

.bento-donut-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bento-donut-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--resca-dark);
    line-height: 1;
}

.bento-donut-day-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--resca-text-muted);
}

/* Actions Section */
.bento-actions-block {
    grid-column: span 6;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.bento-actions-block .resca-btn {
    flex: 1;
    max-width: 300px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border-radius: 50px;
}

/* Utilities */
.hidden-block { display: none !important; }

/* Skeleton Loader High-End */
.bento-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}

@keyframes shimmer {
    to { background-position: -200% 0; }
}

.bento-skeleton-text { height: 18px; margin-bottom: 12px; width: 60%; }
.bento-skeleton-text.full { width: 100%; }
.bento-skeleton-circle { width: 120px; height: 120px; border-radius: 50%; margin: 10px auto; }