/* ============================
   BODY & GLOBAL STYLES
============================ */
html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

html, body {
    max-width: 100%;
    height: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body:not(:has(.doNotBodyMarginBecauseItsIframe)) {
    /* LE NOT EST UN WORKAROUND : A supprimer dès que l'iframe traitement show disparaît */
    margin: 46px 0 0 0 !important;
}

body {
    padding: 0;
    font-size: 0.95rem;
    font-family: "Segoe UI", Roboto, sans-serif;
    overflow-y: auto;
    overflow-x: auto;
    height: 100%;
}

/* !! important : avec le layout de menu (extends de base.html.twig), c'est main-main qui s'occupe du scroll vertical !! */
body.with-app-layout {
    height: calc(100vh - 46px);
    overflow-y: hidden;
}

/* ============================
   LAYOUT : SIDEBAR + MAIN
============================ */

.app-layout {
    display: flex;
    height: 100%;
    min-width: 1200px;
}

/* ============================
   MAIN & CONTENT
============================ */

.main-main {
    flex: 1 1 0;
    padding: 1.2rem;
    box-sizing: border-box;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: auto;
}

.bodytmp, .bodyTmp {
    width: 98%;
}

.main-main,
.content {
    transition: margin-left 0.3s ease;
}

a {
    color: #3572b0
}

body a:not(.btn):not(body nav a),
.work-actions-menu a {
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding: 0.1rem;
    transition: border-bottom 0.4s ease;
}

body a:not(.btn):not(body nav a):hover,
.work-actions-menu a:hover {
    text-decoration: none;
    border-bottom: 2px solid var(--secondary-hover);
    color: var(--secondary-hover);
}

input[type="button"], input[type="submit"],
button[class="btn"] {
    /* cibler les vieux boutons tout pourri */
    background-color: white;
    border-radius: 4px;
    border-color: var(--secondary-hover);
    color: var(--secondary)
}

input[type="button"]:hover, input[type="submit"]:hover,
button[class="btn"]:hover {
    /* cibler les vieux boutons tout pourri */
    background-color: var(--secondary-hover);
    color: white;
}

.dropdown-item:hover {
    background-color: var(--secondary-hover);
    color: white;
}

.niceborder {
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: border-color 0.3s ease;
}

/* SOULIGNAGE */
.sousTitre, h3, h4, h5, h6 {
    margin-left: -1rem;
    padding-right: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #3498db;
    display: inline-block;
}


.border-bottom-primary {
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

.border-bottom-red {
    border-bottom: 3px solid var(--danger);
    display: inline-block;
}

.niceborder {
    border-bottom: 2px solid var(--danger); /* Invisible underline */
    transition: border-color 0.3s ease; /* Smooth transition */
}

/* TABLE  */
table.dataTable tbody tr:hover {
    background-color: #eff1fd;
}

table.dataTable:not(.excludeStyle) thead, table.datatableStyleLike thead {
    background-color: var(--secondary);
}

table.dataTable:not(.excludeStyle) thead tr th,
table.dataTable:not(.excludeStyle) thead tr td,
table.datatableStyleLike thead tr th {
    color: white;
    vertical-align: text-top;
}

/* CHECKBOX */

input[type=checkbox] {
    accent-color: var(--secondary);
}

input[type=checkbox]:not(.smallCheckBox) {
    scale: 1.4;
}

/* ============================
   LOGIN
============================ */

body.login {
    background-color: var(--secondary);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    color: white;
    height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    color: #333;
    width: 100%;
    max-width: 380px;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: float 0.7s ease-out;
}

@keyframes float {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo img {
    width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 8px auto;
}

.login-subtitle {
    font-size: 20px;
    text-align: center;
    margin-bottom: 15px;
    color: var(--secondary);
}

/* ============================
   SURCHARGE SPECIFIQUE AU PRINT
============================ */

@media print {
    /* On annule le layout plein écran de l'app pour la version imprimée */
    html, body {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.with-app-layout {
        height: auto !important;
        overflow: visible !important;
    }

    .app-layout,
    .main-main {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    table.table {
        border-collapse: collapse;
        width: 19cm !important;
        box-sizing: border-box;
        margin: 0 auto;
        border: 1px solid #000 !important;
    }

    table.table th,
    table.table td {
        border-width: 0 0 1px 1px;
        border-style: solid;
        border-color: #000;
    }

    /* Complète la colonne la plus à droite avec une bordure droite via :last-child */
    table.table tr > th:last-child,
    table.table tr > td:last-child {
        border-right: 1px solid #000;
    }

    @page {
        size: A4;
        margin: 10mm;
    }
}


/* ============================
   AUTRES
============================ */

.struck {
    text-decoration: line-through;
    opacity: 0.5;
}

.topbar:not(.DEV, .PREPROD) {
    background-color: #313657 !important;
}

.topbar.DEV {
    background-color: #e73150 !important;
}

.topbar.PREPROD {
    background-color: #161afdff !important;
}

.topbar:not(.DEV, .PREPROD) #topbarEnvColorLabel {
    display: none;
}
