/* project_monitoring.css — Styles pour le module de Suivi de Projet */

/* ==========================================================================
   1. Tableau des Tickets (Version Desktop & Adaptations)
   ========================================================================== */

#table-tickets-inline {
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    margin-top: -10px !important;
}

#table-tickets-inline>thead>tr>th {
    border-bottom: none !important;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: #a0a5aa;
    font-weight: 600;
    padding-bottom: 0px;
    letter-spacing: 0.5px;
}

#table-tickets-inline>tbody>tr:nth-child(odd) {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: #f8f9fa;
    transition: all 0.2s ease-in-out;
}

#table-tickets-inline>tbody>tr:nth-child(even) {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: #f1f3f5;
    transition: all 0.2s ease-in-out;
}

#table-tickets-inline>tbody>tr.sp-dropdown-open,
#table-tickets-inline>tbody>tr:has(.show) {
    z-index: 60 !important;
    position: relative;
}

#table-tickets-inline>tbody>tr:hover {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    position: relative;
    z-index: 50;
}

#table-tickets-inline>tbody>tr>td {
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
    border-right: none;
    border-left: none;
    padding: 14px 12px;
    background-color: transparent !important;
    vertical-align: top;
}

#table-tickets-inline>tbody>tr>td:first-child {
    border-left: 1px solid #eaeaea;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

#table-tickets-inline>tbody>tr>td:last-child {
    border-right: 1px solid #eaeaea;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* --- Card Textareas --- */
.sp-tickets-table textarea.inline-input {
    resize: vertical;
    min-height: 24px !important;
    padding: 0 !important;
    line-height: 1.4;
    transition: all 0.2s;
}

.sp-tickets-table textarea.inline-input:focus {
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, .25) !important;
    padding: 6px !important;
    border-radius: 4px;
}

.sp-tickets-table td:nth-child(2) textarea {
    font-weight: 500;
    color: #333;
}

/* --- Badge Selects --- */
.sp-badge-select {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 50rem !important;
    padding: 2px 24px 2px 10px !important;
    font-size: 0.75rem;
    font-weight: 600;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 10px;
    cursor: pointer;
    border: 1px solid transparent;
}

/* Tags Colors */
.tags-traduire {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border-color: #ffeeba !important;
}

.tags-bloquant {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

/* Statut Colors */
.statut-declare {
    background-color: #e2e3e5 !important;
    color: #383d41 !important;
}

.statut-en-cours {
    background-color: #cce5ff !important;
    color: #004085 !important;
}

.statut-fait {
    background-color: #d4edda !important;
    color: #155724 !important;
}

.statut-a-valider {
    background-color: #cff4fc !important;
    color: #055160 !important;
}

.statut-clos {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

/* --- Optimisation Desktop pour éviter le débordement --- */
#table-tickets-inline .inline-select,
#table-tickets-inline .inline-input {
    width: 100% !important;
    max-width: 100% !important;
}

#table-tickets-inline textarea.inline-input {
    min-width: 120px !important;
    width: 100% !important;
}

#table-tickets-inline .auteur-select-wrapper,
#table-tickets-inline .sp-recette-sel,
#table-tickets-inline .tags-select-wrapper,
#table-tickets-inline .statut-select-wrapper {
    width: 100% !important;
    flex-grow: 1;
    min-width: 0;
}

#table-tickets-inline .auteur-select-wrapper select,
#table-tickets-inline .sp-recette-sel select,
#table-tickets-inline .tags-select-wrapper select,
#table-tickets-inline .statut-select-wrapper select {
    width: 100% !important;
}

/* ==========================================================================
   2. Design Premium Global (Pills, Cartes, Filtres)
   ========================================================================== */

/* Pill Tabs */
.sp-pill-tabs-wrap {
    display: inline-block;
}

.sp-board-pills {
    display: flex;
    gap: 4px;
    background: #f1f3f7;
    border-radius: 50px;
    padding: 4px;
    border: none;
}

.sp-board-pills .nav-link {
    border-radius: 50px;
    padding: 6px 18px;
    font-size: .85rem;
    font-weight: 500;
    color: #6c757d;
    border: none;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-board-pills .nav-link:hover:not(.active) {
    background: rgba(0, 0, 0, .05);
    color: #495057;
}

.sp-board-pills .nav-link.active {
    background: #fff;
    color: #0d6efd;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

/* Cards */
.sp-board-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaecf0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .04);
}

.sp-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f2f5;
    background: #fff;
}

.sp-card-title {
    font-size: .9rem;
    font-weight: 600;
    color: #1a1f36;
    display: flex;
    align-items: center;
}

/* thead style */
.sp-thead th {
    background: #f8f9fb !important;
    color: #6b7280;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 12px;
    border-bottom: 2px solid #eaecf0 !important;
    border-top: none !important;
}

/* Filters bar */
.sp-filters-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #f8f9fb;
    border-bottom: 1px solid #eaecf0;
    gap: 10px;
    flex-wrap: wrap;
}

.sp-filter-label {
    font-size: .78rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.sp-filter-sep {
    width: 1px;
    height: 20px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.sp-filter-select {
    width: auto !important;
    min-width: 150px;
    font-size: .8rem;
    border-radius: 20px;
    border-color: #e5e7eb;
}

/* Chips */
.sp-chip {
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 3px 12px;
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    background: none;
    white-space: nowrap;
}

.sp-chip-dark {
    border-color: #dee2e6;
    color: #6c757d;
}

.sp-chip-dark.active {
    background: #1a1f36;
    border-color: #1a1f36;
    color: #fff;
}

.sp-chip-info {
    border-color: #9eeaf9;
    color: #0dcaf0;
}

.sp-chip-info.active {
    background: #0dcaf0;
    border-color: #0dcaf0;
    color: #fff;
}

.sp-chip-warn {
    border-color: #ffda6a;
    color: #997404;
}

.sp-chip-warn.active {
    background: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.sp-chip-prim {
    border-color: #9ec5fe;
    color: #0d6efd;
}

.sp-chip-prim.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.sp-chip-purp {
    border-color: #e2d9f3;
    color: #6f42c1;
}

.sp-chip-purp.active {
    background: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}

.sp-chip-succ {
    border-color: #a3cfbb;
    color: #198754;
}

.sp-chip-succ.active {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

/* Inline editing */
.inline-input,
.inline-select {
    border-radius: 6px;
    padding: 2px 6px;
    min-height: 28px;
    font-size: .82rem;
    box-shadow: none !important;
}

.inline-input:focus,
.inline-select:focus {
    background: #fff !important;
    border: 1px solid #86b7fe !important;
    outline: 0;
}

/* Statut select pill */
select.statut-declare {
    background: #ecfeff !important;
    color: #0e7490 !important;
    border-color: #a5f3fc !important;
    border-radius: 20px;
    font-size: .75rem;
}

select.statut-en-cours {
    background: #fffbeb !important;
    color: #92400e !important;
    border-color: #fcd34d !important;
    border-radius: 20px;
    font-size: .75rem;
}

select.statut-fait {
    background: #fdf4ff !important;
    color: #86198f !important;
    border-color: #f0abfc !important;
    border-radius: 20px;
    font-size: .75rem;
}

select.statut-a-valider {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
    border-radius: 20px;
    font-size: .75rem;
}

select.statut-clos {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border-color: #86efac !important;
    border-radius: 20px;
    font-size: .75rem;
}

/* Action buttons */
.action-btn {
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Table rows */
.sp-tickets-table td {
    padding: 8px 12px;
}

.sp-tickets-table .inline-input {
    max-width: 100%;
}

/* ==========================================================================
   3. Responsive Design / Version Mobile et Tablette (Breakpoint 1280px)
   ========================================================================== */

@media (max-width: 1279.98px) {
    /* Éviter le défilement horizontal forcé de bootstrap sur mobile pour cette vue */
    .table-responsive-md {
        overflow-x: visible !important;
    }

    /* Transformation de la table en blocs */
    #table-tickets-inline, 
    #table-tickets-inline tbody, 
    #table-tickets-inline tr, 
    #table-tickets-inline td { 
        display: block !important; 
    }

    /* Masquer l'en-tête de la table */
    #table-tickets-inline thead { 
        display: none !important; 
    }

    /* Style des cartes pour chaque ligne */
    #table-tickets-inline>tbody>tr:nth-child(odd),
    #table-tickets-inline>tbody>tr:nth-child(even) {
        background-color: #ffffff !important;
        border: 1px solid #eaecf0 !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        padding: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
        transform: none !important;
        transition: box-shadow 0.2s ease-in-out;
        display: block !important;
    }

    #table-tickets-inline>tbody>tr:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        transform: none !important;
    }

    /* Reset des styles de cellules desktop */
    #table-tickets-inline>tbody>tr>td,
    #table-tickets-inline>tbody>tr>td:first-child,
    #table-tickets-inline>tbody>tr>td:last-child {
        border: none !important;
        border-bottom: 1px solid #f0f2f5 !important;
        border-radius: 0 !important;
        padding: 10px 0 !important;
        background-color: transparent !important;
    }

    #table-tickets-inline>tbody>tr>td:last-child {
        border-bottom: none !important;
    }

    /* Style commun des labels ::before */
    #table-tickets-inline tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.72rem;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    /* Rendu Côte-à-Côte (champs courts) */
    #table-tickets-inline tbody tr td:nth-of-type(1),
    #table-tickets-inline tbody tr td:nth-of-type(4),
    #table-tickets-inline tbody tr td:nth-of-type(5),
    #table-tickets-inline tbody tr td:nth-of-type(6),
    #table-tickets-inline tbody tr td:nth-of-type(8),
    #table-tickets-inline tbody tr td:nth-of-type(9),
    #table-tickets-inline tbody tr td:nth-of-type(10),
    #table-tickets-inline tbody tr td:nth-of-type(11) {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        min-height: 44px;
    }

    /* Rendu Empilé (champs longs) */
    #table-tickets-inline tbody tr td:nth-of-type(2),
    #table-tickets-inline tbody tr td:nth-of-type(3),
    #table-tickets-inline tbody tr td:nth-of-type(7) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    #table-tickets-inline tbody tr td:nth-of-type(2)::before,
    #table-tickets-inline tbody tr td:nth-of-type(3)::before,
    #table-tickets-inline tbody tr td:nth-of-type(7)::before {
        margin-bottom: 8px;
    }

    /* Ajustement des dimensions des inputs/sélections */
    #table-tickets-inline tbody tr td:nth-of-type(2) textarea,
    #table-tickets-inline tbody tr td:nth-of-type(7) textarea {
        width: 100% !important;
        min-width: 100% !important;
        padding: 6px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 6px !important;
        background: #f9fafb !important;
    }

    #table-tickets-inline tbody tr td:nth-of-type(2) textarea:focus,
    #table-tickets-inline tbody tr td:nth-of-type(7) textarea:focus {
        background: #ffffff !important;
        border-color: #0d6efd !important;
    }

    #table-tickets-inline tbody tr td:nth-of-type(3) .sp-recette-sel,
    #table-tickets-inline tbody tr td:nth-of-type(3) .sp-recette-sel select {
        width: 100% !important;
        max-width: 100% !important;
    }

    #table-tickets-inline tbody tr td:nth-of-type(3) select {
        border: 1px solid #e5e7eb !important;
        border-radius: 6px !important;
        background: #f9fafb !important;
        padding: 4px 8px !important;
    }

    /* Alignements spécifiques */
    #table-tickets-inline tbody tr td:nth-of-type(1) span {
        font-size: 0.95rem;
    }
}
