/* =============================================================================
 * redmine.css — Redmine 6 aux couleurs de devinthehood.com (docs/THEME.md).
 *
 * Déposé par la phase 11b comme stylesheets/application.css du thème « devinthehood »
 * (/usr/share/redmine/themes/devinthehood/), avec charte.css, fonts.css et fonts/ à côté, les
 * logos dans images/ et le favicon dans favicon/. Propshaft les range tous sous
 * /assets/themes/devinthehood/ : les url() relatives ci-dessous s'y résolvent.
 *
 * ⚠️ Pas de mode sombre (charte-sombre.css n'est pas chargée) : Redmine code ses couleurs en dur,
 * et un contenu de nuit laissait du texte clair sur des fonds restés blancs. Barres de nuit,
 * contenu sur papier, dans les deux modes.
 * ============================================================================= */

@import url("/assets/application-e6088b27.css");
@import url("/assets/themes/devinthehood/charte-c80407b5.css");
@import url("/assets/themes/devinthehood/fonts-1fddf13b.css");

:root {
    --fonts-main: var(--dith-font);
}

/* Redmine écrit en 14 px ; en Archivo, l'écran paraissait tassé. Tout ce qui est en em suit. */
body {
    font-size: 0.9375rem;
}

body,
#wrapper,
#main {
    background: var(--dith-surface);
    color: var(--dith-text);
}

a,
a:link,
a:visited {
    color: var(--dith-link);
}

a:hover,
a:active {
    color: var(--dith-link-hover);
}

::selection {
    background: rgb(var(--dith-accent-500) / 20%);
}

pre,
code,
body.textarea-monospace textarea.wiki-edit {
    font-family: var(--dith-mono);
}

input[type='checkbox'],
input[type='radio'] {
    accent-color: var(--dith-red-ink);
}

/* Les icônes SVG de Redmine ont un trait bleu codé en dur (#169) : elles suivent désormais la
 * couleur de leur texte, sans quoi chaque lien mêlait une icône bleue à un libellé rouge. */
svg.icon-svg,
a.icon:hover svg,
a.icon-only:hover svg {
    stroke: currentColor;
}

svg.icon-ok {
    stroke: var(--dith-ok);
}

.icon-error svg.icon-svg {
    stroke: var(--dith-ko);
}

.icon-warning svg.icon-svg {
    stroke: var(--dith-warn);
}

/* -----------------------------------------------------------------------------
 * Les barres — de nuit
 * -------------------------------------------------------------------------- */

#top-menu {
    padding: 7px 24px;
    background: var(--dith-bar);
    color: var(--dith-bar-dim);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    line-height: 1.6;
    text-transform: uppercase;
}

#top-menu a,
#top-menu a:link,
#top-menu a:visited {
    margin-right: 14px;
    color: var(--dith-bar-dim);
    font-weight: 400;
}

#top-menu a:hover,
#top-menu #loggedas a {
    color: var(--dith-bar-text);
    text-decoration: none;
}

#top-menu #loggedas {
    margin-right: 14px;
    color: var(--dith-bar-dim);
}

#header {
    min-height: 0;
    padding: 18px 24px 52px;
    border-top: 1px solid var(--dith-bar-line);
    background: var(--dith-bar);
    color: var(--dith-bar-text);
}

/* Sans onglets (accueil, administration, connexion), plus de bande vide sous le titre. */
#header:not(:has(#main-menu)) {
    padding-bottom: 18px;
}

#header a,
#header a:link,
#header a:visited {
    color: var(--dith-bar-text);
}

/* La variante sobre : la marque, puis le nom en Archivo large et capitales. La marque est posée
 * en absolu dans la marge gauche : le titre garde son flux, et le fil d'Ariane d'un sous-projet
 * reste AU-DESSUS du nom (un h1 en flex les mettait côte à côte). */
#header h1 {
    position: relative;
    min-height: 2.6rem;
    padding-left: 3.3rem;
    font-family: var(--dith-font);
    font-size: 1.7rem;
    font-weight: 860;
    font-stretch: 125%;
    letter-spacing: -0.01em;
    line-height: 2.6rem;
    text-transform: uppercase;
}

#header h1::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 2.45rem;
    height: 2.65rem;
    background: url("/assets/themes/devinthehood/redmine-marque-nuit-60f3e54b.svg") center / contain no-repeat;
    transform: translateY(-50%);
}

#header h1 .breadcrumbs {
    color: var(--dith-bar-dim);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 400;
    font-stretch: 100%;
    letter-spacing: 0.1em;
    line-height: 1.4;
}

#header h1 .breadcrumbs a:hover {
    color: var(--dith-bar-text);
}

/* La recherche et le saut de projet : deux pilules de nuit, le libellé en kicker. */
#quick-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

#quick-search form {
    display: flex;
    align-items: center;
    gap: 10px;
}

#quick-search label,
#quick-search label a {
    color: var(--dith-bar-dim);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#quick-search #q,
#project-jump .drdn-trigger {
    height: 32px;
    border: 1px solid var(--dith-bar-line);
    border-radius: var(--dith-radius-pill);
    background-color: var(--dith-bar-raised);
    color: var(--dith-bar-text);
}

#quick-search #q {
    width: 200px;
    padding: 0 14px;
}

#project-jump .drdn-trigger {
    padding: 0 30px 0 14px;
    line-height: 30px;
    background-position: calc(100% - 10px) 50%;
}

#quick-search #q::placeholder {
    color: var(--dith-bar-dim);
}

#quick-search #q:focus {
    border-color: var(--dith-red);
    box-shadow: var(--dith-focus);
}

/* Les onglets du projet : mono en capitales ; l'actif porte le trait rouge. */
#main-menu {
    left: 24px;
}

#main-menu li a {
    padding: 11px 14px;
    border-radius: 0;
    background: transparent;
    color: var(--dith-bar-dim);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#main-menu li a:hover,
#main-menu li a.new-object {
    background: var(--dith-bar-hover);
    color: var(--dith-bar-text);
    text-decoration: none;
}

#main-menu li a.selected,
#main-menu li a.selected:hover {
    background: transparent;
    color: var(--dith-bar-text);
    font-weight: 500;
    box-shadow: inset 0 -2px 0 var(--dith-red);
}

#main-menu .menu-children {
    overflow: hidden;
    border: 1px solid var(--dith-border);
    border-radius: 0 0 var(--dith-radius-field) var(--dith-radius-field);
    background: var(--dith-surface-panel);
}

#main-menu .menu-children li a {
    padding: 8px 14px;
    background: var(--dith-surface-panel);
    color: var(--dith-text);
    letter-spacing: 0.06em;
}

#main-menu .menu-children li a:hover {
    background: var(--dith-surface-hover);
    color: var(--dith-text);
}

/* Les flèches de défilement des onglets : de nuit dans la barre du projet, sur papier dans le
 * contenu (onglets de la configuration). */
#main-menu .tabs-buttons {
    background: var(--dith-bar);
    border-bottom-color: var(--dith-bar-line);
}

#content div.tabs-buttons {
    border-bottom-color: var(--dith-border);
    background: var(--dith-surface);
}

/* Mobile : l'en-tête fixe et le menu volant.
 * ⚠️ Redmine charge responsive.css APRÈS la feuille du thème, avec les mêmes sélecteurs : à
 * spécificité égale, ses bleus (#628db6, #3e5b76) l'emportaient sur toute cette section, et le
 * téléphone gardait l'en-tête et le menu volant d'origine (constaté le 2026-10-24). Le `body` devant
 * chaque sélecteur suffit à passer devant les siens. */
@media screen and (max-width: 899px) {
    /* La règle de bureau sans onglets, (2,0,0), garderait ses 18 px sous l'en-tête fixe de 64 px. */
    body #header,
    body #header:not(:has(#main-menu)) {
        padding: 0;
        background-color: var(--dith-bar);
    }

    body #header a.mobile-toggle-button {
        color: var(--dith-bar-text);
        border-left-color: var(--dith-bar-line);
    }

    body .flyout-menu {
        color: var(--dith-bar-text);
        background-color: var(--dith-bar);
    }

    body .flyout-menu h3 {
        color: var(--dith-bar-text);
        border-color: var(--dith-bar-line);
        background-color: var(--dith-bar-raised);
        font-family: var(--dith-mono);
    }

    body .flyout-menu a,
    body .flyout-menu h4,
    body .flyout-menu__avatar,
    body .flyout-menu__avatar a {
        color: var(--dith-bar-text);
    }

    body .flyout-menu ul li a,
    body .flyout-menu__avatar,
    body .flyout-menu__sidebar form > ul li {
        border-top-color: var(--dith-bar-line);
    }

    body .flyout-menu ul li a:hover {
        background-color: var(--dith-bar-hover);
        text-decoration: none;
    }

    /* L'onglet courant, comme au bureau : le filet rouge, à gauche dans une liste verticale. */
    body .flyout-menu ul li a.selected {
        font-weight: 500;
        box-shadow: inset 3px 0 0 var(--dith-red);
    }
}

/* -----------------------------------------------------------------------------
 * Le contenu — sur papier
 * -------------------------------------------------------------------------- */

#content,
#main.nosidebar #content {
    padding: 26px 32px 36px;
    background: var(--dith-surface);
}

#content h2,
#content h3,
#content h4,
#sidebar h3 {
    color: var(--dith-text);
}

#content h2 {
    margin-bottom: 18px;
    font-size: 1.85rem;
    font-weight: 860;
    font-stretch: 125%;
    letter-spacing: -0.01em;
    line-height: 1.1;
    text-transform: uppercase;
}

#content h3 {
    font-weight: 820;
    font-stretch: 112%;
    text-transform: uppercase;
}

/* Un titre de bloc qui est un lien (« Ma page ») : l'encre, le rouge au survol. */
#content h3 a,
#content h3 a:link,
#content h3 a:visited {
    color: var(--dith-text);
}

#content h3 a:hover {
    color: var(--dith-red-ink);
}

/* Les actions de la page (en haut à droite) : des pilules ; « Nouveau… » en bouton plein. */
#content > .contextual {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 0.8125rem;
}

#content > .contextual > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 14px;
    border: 1px solid color-mix(in srgb, var(--dith-text) 22%, transparent);
    border-radius: var(--dith-radius-pill);
    color: var(--dith-text);
    text-decoration: none;
}

#content > .contextual > a:hover {
    border-color: var(--dith-red-ink);
    color: var(--dith-red-ink);
}

#content > .contextual > a.icon-add {
    border-color: var(--dith-button);
    background: var(--dith-button);
    color: var(--dith-button-text);
}

#content > .contextual > a.icon-add:hover {
    border-color: var(--dith-button-hover);
    background: var(--dith-button-hover);
    color: var(--dith-button-text);
}

/* Les filtres d'une liste : légendes en kicker, boutons en pilules (« Appliquer » plein). */
fieldset#filters legend,
fieldset#options legend,
fieldset.collapsible > legend {
    color: var(--dith-text-2);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#query_form p.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}

#query_form p.buttons > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid color-mix(in srgb, var(--dith-text) 22%, transparent);
    border-radius: var(--dith-radius-pill);
    color: var(--dith-text);
    font-size: 0.8125rem;
    text-decoration: none;
}

#query_form p.buttons > a:hover {
    border-color: var(--dith-red-ink);
    color: var(--dith-red-ink);
}

#query_form p.buttons > a.icon-checked {
    border-color: var(--dith-button);
    background: var(--dith-button);
    color: var(--dith-button-text);
}

#query_form p.buttons > a.icon-checked:hover {
    background: var(--dith-button-hover);
    color: var(--dith-button-text);
}

/* « Aucune donnée » : un cadre en pointillés, une ligne de kicker. */
.nodata {
    padding: 34px 16px;
    border: 1px dashed color-mix(in srgb, var(--dith-text) 25%, transparent);
    background: transparent;
    color: var(--dith-text-3);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* L'accueil de l'administration : des tuiles, comme la page « Administrer » de Jenkins. */
#admin-index #admin-menu ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    max-width: 1100px;
}

#admin-index #admin-menu li {
    padding: 0;
}

#admin-index #admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px !important;
    border: 1px solid var(--dith-border);
    border-radius: var(--dith-radius);
    background: var(--dith-surface-panel);
    color: var(--dith-text);
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: border-color 0.2s var(--dith-ease), transform 0.2s var(--dith-ease);
}

#admin-index #admin-menu a svg {
    width: 22px;
    height: 22px;
    color: var(--dith-red-ink);
}

#admin-index #admin-menu a:hover {
    border-color: var(--dith-red-ink);
    transform: translateY(-1px);
}

/* -----------------------------------------------------------------------------
 * La barre latérale — sur papier, des listes de navigation
 * -------------------------------------------------------------------------- */

#sidebar {
    padding: 22px 24px 22px 26px;
    border-left: 1px solid var(--dith-border);
    background: var(--dith-surface-panel);
    font-size: 0.875rem;
}

/* Les titres en kicker, avec la puce hexagonale du site. */
#sidebar h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 10px;
    color: var(--dith-text-3);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    font-stretch: 100%;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

#sidebar h3:first-child {
    margin-top: 4px;
}

#sidebar h3::before {
    content: '';
    flex: none;
    width: 7px;
    height: 8px;
    background: var(--dith-red);
    clip-path: var(--dith-hexagon);
}

/* Des listes de navigation, pas des liens dans un texte : l'encre, le rouge au survol. */
#sidebar a,
#sidebar a:link,
#sidebar a:visited {
    color: var(--dith-text-2);
}

#sidebar a:hover {
    color: var(--dith-red-ink);
    text-decoration: none;
}

#sidebar ul li,
#admin-menu li {
    padding-bottom: 2px;
}

#sidebar a.icon,
#admin-menu a.icon {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

#sidebar a.selected,
#admin-menu a.selected {
    padding: 3px 10px;
    border-radius: var(--dith-radius-pill);
    background-color: var(--dith-button);
    color: var(--dith-button-text) !important;
}

#sidebar a.selected svg,
#admin-menu a.selected svg {
    stroke: var(--dith-button-text);
}

#sidebar-switch-button {
    color: var(--dith-text-3);
}

#footer {
    padding: 10px;
    border-top-color: var(--dith-border);
    background: var(--dith-surface);
    color: var(--dith-text-3);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
}

/* -----------------------------------------------------------------------------
 * Formulaires et boutons
 * -------------------------------------------------------------------------- */

input,
select,
textarea,
button {
    border-color: color-mix(in srgb, var(--dith-text) 22%, transparent);
    border-radius: 8px;
    background-color: var(--dith-surface-panel);
    color: var(--dith-text);
}

input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
input[type='date'],
input[type='url'],
select {
    height: 30px;
}

input[type='text']:focus,
input[type='password']:focus,
input[type='date']:focus,
input[type='number']:focus,
select:focus,
textarea:focus {
    border-color: var(--dith-red-ink);
    box-shadow: var(--dith-focus);
}

.tabular label,
.tabular label.floating {
    color: var(--dith-text-2);
    font-weight: 600;
}

/* Le bouton principal : une pilule rouge encre, libellé mono en capitales. */
input[type='submit'],
button[type='submit'] {
    height: 34px;
    padding: 0 20px;
    border: 1px solid var(--dith-button);
    border-radius: var(--dith-radius-pill);
    background-color: var(--dith-button);
    color: var(--dith-button-text);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

input[type='submit']:hover,
button[type='submit']:hover {
    border-color: var(--dith-button-hover);
    background-color: var(--dith-button-hover);
}

input[type='button'] {
    border-color: var(--dith-text);
    border-radius: var(--dith-radius-pill);
}

.box,
fieldset.box {
    padding: 14px 16px;
    border-color: var(--dith-border);
    border-radius: var(--dith-radius);
    background-color: var(--dith-surface-panel);
    color: var(--dith-text-2);
}

fieldset {
    border-color: var(--dith-border);
    border-radius: var(--dith-radius);
}

legend {
    color: var(--dith-text);
    font-weight: 600;
}

/* -----------------------------------------------------------------------------
 * Listes, onglets, états
 * -------------------------------------------------------------------------- */

table.list,
.table-list {
    overflow: hidden;
    border: 1px solid var(--dith-border);
    border-radius: var(--dith-radius);
    background: var(--dith-surface-panel);
}

table.list th,
.table-list-header {
    padding: 9px 8px;
    border-bottom: 1px solid var(--dith-border);
    background-color: var(--dith-surface-hover);
    color: var(--dith-text-2);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

table.list th a {
    color: var(--dith-text-2);
}

table.list td {
    padding-top: 8px;
    padding-bottom: 8px;
    border-top-color: var(--dith-border);
}

/* ⚠️ Survol sur paper-2 : les libellés y passent à ink-2 (ink-3 y tombe à 4,4:1). */
table.list tbody tr:hover {
    background-color: var(--dith-surface-hover);
}

tr.group td {
    border-bottom-color: var(--dith-border);
    background-color: var(--dith-surface-panel);
}

table.list tr.overdue td.due_date,
div.issue.overdue .due-date .value {
    color: var(--dith-ko);
}

#content .tabs ul {
    border-bottom-color: var(--dith-border);
}

#content .tabs ul li a {
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--dith-text-2);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#content .tabs ul li a:hover {
    color: var(--dith-text);
}

#content .tabs ul li a.selected,
#content .tabs ul li a.selected:hover {
    border: none;
    background: transparent;
    color: var(--dith-text);
    box-shadow: inset 0 -2px 0 var(--dith-red);
}

/* Les messages : un liseré de la couleur d'état, le texte dans sa variante lisible. */
div.flash,
#errorExplanation,
.conflict,
.warning {
    border-radius: var(--dith-radius);
}

div.flash.notice {
    border-color: color-mix(in srgb, var(--dith-ok) 45%, transparent);
    background-color: color-mix(in srgb, var(--dith-ok) 8%, var(--dith-surface-panel));
    color: var(--dith-ok);
}

div.flash.error,
#errorExplanation {
    border-color: color-mix(in srgb, var(--dith-ko) 45%, transparent);
    background-color: color-mix(in srgb, var(--dith-ko) 7%, var(--dith-surface-panel));
    color: var(--dith-ko);
}

div.flash.warning,
.conflict {
    border-color: color-mix(in srgb, var(--dith-warn) 45%, transparent);
    background-color: color-mix(in srgb, var(--dith-amber) 14%, var(--dith-surface-panel));
    color: var(--dith-warn);
}

div.flash svg.icon-svg,
#errorExplanation svg.icon-svg,
.conflict svg.icon-svg {
    stroke: currentColor;
}

.badge {
    border-radius: var(--dith-radius-pill);
    font-family: var(--dith-mono);
    font-weight: 500;
    letter-spacing: 0.06em;
}

.badge-status-open {
    border-color: var(--dith-link);
    color: var(--dith-link);
}

.badge-status-closed {
    border-color: var(--dith-ok);
    color: var(--dith-ok);
}

.badge-status-locked {
    border-color: var(--dith-off);
    color: var(--dith-off);
}

.badge-count {
    background: var(--dith-text-2);
}

table.progress td.closed {
    background: var(--dith-success);
}

table.progress td.done {
    background: color-mix(in srgb, var(--dith-success) 45%, var(--dith-paper));
}

table.progress td.todo {
    background: var(--dith-surface-sunk);
}

.pagination ul.pages li.current {
    border-color: var(--dith-ink);
    background-color: var(--dith-ink);
    color: var(--dith-paper);
}

.pagination ul.pages li.page:hover {
    background-color: var(--dith-surface-hover);
}

/* Le code : de nuit, comme les terminaux du site. */
div.wiki pre,
pre {
    border: 1px solid var(--dith-bar-line);
    border-radius: var(--dith-radius);
    background: var(--dith-code-bg);
    color: var(--dith-code-text);
}

div.wiki code:not(pre code) {
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--dith-surface-hover);
}

.drdn-content {
    border-color: var(--dith-border);
    border-radius: var(--dith-radius-field);
    background-color: var(--dith-surface-panel);
}

.contextual .drdn-items > a:hover,
#project-jump .drdn-items > a:hover {
    border-color: transparent;
    background-color: var(--dith-surface-hover);
    color: var(--dith-text) !important;
}

#ajax-indicator {
    border: none;
    border-radius: var(--dith-radius-pill);
    background: var(--dith-ink);
    color: var(--dith-paper);
}

/* -----------------------------------------------------------------------------
 * La page de connexion — une carte de nuit, le logo complet en tête
 * -------------------------------------------------------------------------- */

#login-form {
    width: 380px;
    margin-top: 4em;
    padding: 32px;
    border: none;
    border-radius: 18px;
    background: var(--dith-night);
    color: var(--dith-paper);
    box-shadow: 0 24px 60px -24px rgb(22 19 15 / 45%);
}

#login-form::before {
    content: '';
    display: block;
    height: 160px;
    margin-bottom: 26px;
    background: url("/assets/themes/devinthehood/redmine-logo-nuit-dc0a9651.svg") center / contain no-repeat;
}

#login-form label {
    color: var(--dith-dim);
    font-family: var(--dith-mono);
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#login-form input[type='text'],
#login-form input[type='password'] {
    height: 42px;
    border-color: transparent;
    border-radius: var(--dith-radius-field);
    background: var(--dith-paper-panel);
    color: var(--dith-ink);
}

#login-form input[type='submit'] {
    height: 46px;
    margin-top: 6px;
}

#login-form a,
#login-form a:link,
#login-form a:visited {
    color: var(--dith-amber);
}
