/*--- static/css/table.css ---*/

/* ✅ SUCCESS (vert) */
.row-success td:not(:first-child):not(:nth-last-child(-n+2)) {
    background-color: rgba(66, 158, 57, 0.85) !important;
}

.row-success td:first-child {
    background: linear-gradient(
        to right,
        rgba(66, 158, 57, 0.0) 0%,
        rgba(66, 158, 57, 0.6) 60%,
        rgba(66, 158, 57, 0.85) 100%
    ) !important;
}

.row-success td:nth-last-child(2) {
    background: linear-gradient(
        to right,
        rgba(66, 158, 57, 0.85) 0%,
        rgba(66, 158, 57, 0.6) 70%,
        rgba(66, 158, 57, 0.0) 100%
    ) !important;
}


/* ⚠️ WARNING (orange) */
.row-warning td:not(:first-child):not(:nth-last-child(-n+2)) {
    background-color: rgba(255, 166, 0, 0.4) !important;
}

.row-warning td:first-child {
    background: linear-gradient(
        to right,
        rgba(255, 166, 0, 0.0) 0%,
        rgba(255, 166, 0, 0.3) 60%,
        rgba(255, 166, 0, 0.4) 100%
    ) !important;
}

.row-warning td:nth-last-child(2) {
    background: linear-gradient(
        to right,
        rgba(255, 166, 0, 0.4) 0%,
        rgba(255, 166, 0, 0.25) 70%,
        rgba(255, 166, 0, 0.0) 100%
    ) !important;
}


/* 🔥 DANGER (rouge) */
.row-danger td:not(:first-child):not(:nth-last-child(-n+2)) {
    background-color: rgba(255, 0, 0, 0.4) !important;
}

.row-danger td:first-child {
    background: linear-gradient(
        to right,
        rgba(255, 0, 0, 0.0) 0%,
        rgba(255, 0, 0, 0.3) 60%,
        rgba(255, 0, 0, 0.4) 100%
    ) !important;
}

.row-danger td:nth-last-child(2) {
    background: linear-gradient(
        to right,
        rgba(255, 0, 0, 0.4) 0%,
        rgba(255, 0, 0, 0.25) 70%,
        rgba(255, 0, 0, 0.0) 100%
    ) !important;
}

/* 🕓 CLEARED */
.row-cleared td:not(:first-child):not(:nth-last-child(-n+3)) {
    background-color: rgba(120, 130, 140, 0.3) !important;
    font-style: italic;
    color: rgba(200, 200, 200, 0.7) !important;
    transition: all 0.3s ease-in-out;
}

/* Dégradé sur la première colonne (gauche → droite) */
.row-cleared td:first-child {
    background: linear-gradient(
        to right,
        rgba(120, 130, 140, 0.0) 0%,
        rgba(120, 130, 140, 0.25) 60%,
        rgba(120, 130, 140, 0.3) 100%
    ) !important;
    font-style: italic;
    color: rgba(200, 200, 200, 0.7) !important;
}

/* Dégradé sur l’avant-dernière colonne (droite → transparent) */
.row-cleared td:nth-last-child(3) {
    background: linear-gradient(
        to right,
        rgba(120, 130, 140, 0.3) 0%,
        rgba(120, 130, 140, 0.25) 70%,
        rgba(120, 130, 140, 0.0) 100%
    ) !important;
    font-style: italic;
    color: rgba(200, 200, 200, 0.7) !important;
}

/* EQUIPPED */
.row-equipped td:not(:first-child):not(:nth-last-child(-n+2)) {
    background-color: rgba(120, 130, 140, 0.3) !important;
    font-style: italic;
    color: rgba(200, 200, 200, 0.7) !important;
    transition: all 0.3s ease-in-out;
}

/* Dégradé sur la première colonne (gauche → droite) */
.row-equipped td:first-child {
    background: linear-gradient(
        to right,
        rgba(120, 130, 140, 0.0) 0%,
        rgba(120, 130, 140, 0.25) 60%,
        rgba(120, 130, 140, 0.3) 100%
    ) !important;
    font-style: italic;
    color: rgba(200, 200, 200, 0.7) !important;
}

/* Dégradé sur l’avant-dernière colonne (droite → transparent) */
.row-equipped td:nth-last-child(2) {
    background: linear-gradient(
        to right,
        rgba(120, 130, 140, 0.3) 0%,
        rgba(120, 130, 140, 0.25) 70%,
        rgba(120, 130, 140, 0.0) 100%
    ) !important;
    font-style: italic;
    color: rgba(200, 200, 200, 0.7) !important;
}

.alerts-danger td {
    background-color: rgba(255, 0, 0, 0.4) !important;
}

.alerts-warning td {
    background-color: rgba(255, 166, 0, 0.4) !important;
}

.airworthiness-table {
  max-height: calc(98vh - 420px) !important; /* ajuste 300px selon navbar + filtres */
  overflow-y: auto;
}

.airworthiness-page {
  overflow-y: hidden !important; /* empêche la double scrollbar sur cette page uniquement */
}

.deferred-table {
  max-height: calc(98vh - 350px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.table-row-clickable {
  cursor: pointer;
}

/* Scroll vertical comme AD */
.work-orders-table {
  max-height: calc(98vh - 220px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

/* Empêche la double scrollbar (le body ne scroll plus, seul le tableau) */
.work-orders-page {
  overflow-y: hidden !important;
}

/* Limiter la largeur de la card Work Orders */
.work-orders-card {
  max-width: 1400px; /* ajuste selon ton écran */
  margin: 0 auto;    /* centre horizontalement */
  width: 100%;       /* garde le responsive */
}

/* Scroll vertical comme AD */
.JC-table {
  max-height: calc(98vh - 500px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.JCIP-table {
  max-height: calc(98vh - 480px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.tp-table {
  max-height: calc(98vh - 280px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.gpa-table {
  max-height: calc(98vh - 190px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.part-table {
  max-height: calc(98vh - 260px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.tool-table {
  max-height: calc(98vh - 260px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.lc-table {
  max-height: calc(98vh - 190px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.JCIP-card {
  max-width: 1400px; /* ajuste selon ton écran */
  margin: 0 auto;    /* centre horizontalement */
  width: 100%;       /* garde le responsive */
}

.tp-wo-table {
  max-height: calc(98vh - 280px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.MxSimulator-table {
  max-height: calc(98vh - 580px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

.MxSimulation-table {
  max-height: calc(98vh - 150px); /* ajuste selon header/navbar */
  overflow-y: auto;
}

tr.cursor-pointer:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Forcer texte noir même sur les lignes équipées (grises) */
tr.row-equipped.cursor-pointer:hover td {
    color: #000 !important;
}

/* Supprimer les flèches uniquement dans le tableau GPA */
.gpa-table input[type=number]::-webkit-inner-spin-button,
.gpa-table input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gpa-table input[type=number] {
    -moz-appearance: textfield;
}

.gpa-table input.form-control {
    width: 100%;
    text-align: center;
    min-width: 60px;
}

/* Inputs dans le tableau GPA : moins de padding */
.gpa-table input.form-control {
    width: 100%;
    text-align: center;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
}

