/* custom-style.css (client/custom/src/css - chargé par Custom.json) */

/* Timesheet edit : grisage ciblé période / jours travaillés / astreintes (sans overlay global) */
.timesheet-section-blocked {
    position: relative;
}
.timesheet-section-blocked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.72);
    border-radius: 4px;
    pointer-events: auto;
    z-index: 5;
}

/* Désactiver explicitement les boutons Remplir/Vider le CRA quand restriction */
.timesheet-form-blocked .sd-actions,
.timesheet-form-blocked .sd-actions .btn {
    pointer-events: none !important;
    opacity: 0.7;
    cursor: not-allowed;
}

.custom-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    cursor: pointer;
}

.custom-badge:hover {
    background-color: #45a049;
}

/* Style pour les préfactures fusionnées - exclure le champ info */
.prepa-row-fusionne td[data-name="info"],
.prepa-row-fusionne td[data-name="info"] *,
.prepa-row-fusionne .cell[data-name="info"],
.prepa-row-fusionne .cell[data-name="info"] * {
    text-decoration: none !important;
    opacity: 1 !important;
}

/* Listes avec barre « Filtrer » custom : masquer le panneau Espo natif (ne pas forcer son affichage) */
body:has(.custom-filter-bar) .advanced-filters,
body:has(.custom-filter-bar) .advanced-filters-apply-container,
.list-has-custom-filter-bar .advanced-filters,
.list-has-custom-filter-bar .advanced-filters-apply-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

/* FORCER la barre custom-filter-bar à rester visible TOUJOURS */
.custom-filter-bar,
.custom-filter-bar.hidden,
.custom-filter-bar[class*="hidden"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Empêcher tout masquage de la barre custom */
.row.custom-filter-bar {
    display: block !important;
    visibility: visible !important;
}

/* Bouton trois points : masqué par hide-add-filter-button.js (script global) */

/* Modal "Accès refusé" (suppression refusée) : header rouge */
.modal.validated-delete-blocked-modal .modal-content .modal-header,
.modal.validated-delete-blocked-modal header.modal-header {
    background-color: #dc3545 !important;
    background: #dc3545 !important;
    border-bottom-color: #dc3545 !important;
    color: #fff !important;
}
.modal.validated-delete-blocked-modal .modal-header .close,
.modal.validated-delete-blocked-modal .modal-header .modal-title,
.modal.validated-delete-blocked-modal .modal-header .modal-title-text {
    color: #fff !important;
    opacity: 1 !important;
}
.modal.validated-delete-blocked-modal .modal-header a.close:hover {
    color: #fff !important;
    opacity: 0.9 !important;
}

/* Expenses list: type de frais = icône en haut centrée, type en dessous centré, non cliquable */
.types-frais-list-cell {
    cursor: default;
    text-decoration: none;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}
.types-frais-list-cell .types-frais-list-icon {
    display: block !important;
    font-size: 1.1em;
    margin-bottom: 4px;
    line-height: 1.2;
    flex-shrink: 0;
}
.types-frais-list-cell .types-frais-list-label {
    color: inherit;
    cursor: default;
    display: block !important;
    line-height: 1.2;
    text-align: center !important;
}

/* Expenses list: Client et Mission / Projet non cliquables */
.expenses-list-link-text {
    cursor: default;
    text-decoration: none;
    color: inherit;
}


/* ── Achat : lignes avec alerte CRA modifié ─────────────────────────── */
tr.achat-row-alerte-danger td,
tr.achat-row-alerte-danger .cell {
    background-color: #fff3f3 !important;
}
tr.achat-row-alerte-warning td,
tr.achat-row-alerte-warning .cell {
    background-color: #fff8e1 !important;
}

/* Badge alerte dans la liste Achat */
.achat-alerte-badge {
    font-size: 11px;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

/* Case : statut plateforme — styles injectés aussi via case-statut-plateforme.js */
.case-statut-plateforme-badge {
    display: inline-block;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: unset;
    vertical-align: middle;
    text-align: left;
    color: #fff;
    background-color: #6366f1;
    border: 1px solid #4f46e5;
    cursor: default;
}

.case-statut-plateforme-badge[data-toggle="tooltip"] {
    cursor: help;
}

.case-statut-plateforme-tooltip .tooltip-inner {
    max-width: 420px;
    text-align: left;
}

