/*
 * Feuille de style du dashboard.
 *
 * Écrite à la main et servie statiquement, sans Tailwind ni étape de build : `php artisan serve`
 * suffit à afficher le dashboard, sans `npm install` ni `npm run build` ni manifeste Vite à
 * régénérer avant chaque déploiement. Pour quelques écrans internes de consultation, la chaîne
 * d'assets coûterait plus cher qu'elle ne rapporte.
 *
 * Identité visuelle : celle du site public (public/css/site.css) -- bleu nuit, texte encre,
 * libellés en Geist Mono, cartes à double bordure fine --, sans le ciel ni les nuages, qui
 * n'ont rien à faire sur un écran de travail. Passer de la landing au dashboard ne doit pas donner
 * l'impression de changer de produit.
 *
 * L'orange Printaya (--brand) dit **qui** et **où agir** : logo, bouton principal, page active du
 * menu, contour de focus. Il ne sert JAMAIS à dire l'état d'une imprimante : le vert, l'ambre et le
 * rouge sont réservés à ça, et la teinte de l'orange (13°) est trop proche du rouge d'un échec pour
 * partager ce rôle. Un orange qui signifierait aussi « attention » rendrait l'écran illisible au
 * premier coup d'œil, qui est précisément le moment qui compte.
 *
 * Texte posé sur l'orange : blanc, par choix de marque (3,5:1, sous les 4,5:1 attendus pour du
 * texte normal). D'où le libellé en gras, et un survol qui fonce au lieu d'éclaircir.
 */

:root {
    color-scheme: dark;

    /* Mêmes valeurs que site.css : --nuit, --ciel, --encre, --ardoise, --halo. */
    --bg: #060f1c;
    --surface: rgba(12, 30, 51, 0.55);
    --surface-solid: #0b1a2c;
    --surface-raised: rgba(16, 35, 58, 0.75);
    --surface-hover: rgba(143, 183, 217, 0.07);
    --border: rgba(159, 176, 194, 0.14);
    --border-soft: rgba(159, 176, 194, 0.08);
    --border-strong: rgba(159, 176, 194, 0.3);

    --text: #f3f6f9;
    --text-dim: #c4d0dc;
    --muted: #9fb0c2;
    --muted-dark: #6f8398;

    --accent: #d6e7f6;
    --accent-soft: rgba(214, 231, 246, 0.08);

    /* Même valeur que --marque dans site.css. */
    --brand: #f0562d;
    --brand-hover: #da3a10;
    --brand-soft: rgba(240, 86, 45, 0.12);
    --brand-border: rgba(240, 86, 45, 0.3);

    /* Sémantique -- distincte de l'accent, et seule autorisée à qualifier un état. */
    --ok: #9fe3c4;
    --ok-bg: rgba(159, 227, 196, 0.12);
    --ok-text: #9fe3c4;
    --warn: #f2c879;
    --warn-bg: rgba(242, 200, 121, 0.12);
    --warn-text: #f2c879;
    --danger: #f19999;
    --danger-bg: rgba(241, 153, 153, 0.12);
    --danger-text: #f5aaaa;
    --info-bg: rgba(143, 183, 217, 0.13);
    --info-text: #8fb7d9;
    --busy-bg: rgba(183, 168, 240, 0.13);
    --busy-text: #c3b6f2;
    --neutral-bg: rgba(159, 176, 194, 0.12);
    --neutral-text: #b4c1cf;

    --radius: 16px;
    --radius-sm: 9px;

    --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Une seule lueur, fixe, en haut de l'écran : le rappel du ciel de la landing, sans les nuages. */
body {
    margin: 0;
    background:
        radial-gradient(1100px 560px at 72% -12%, rgba(23, 49, 77, 0.6), transparent 62%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
h2 { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.018em; }
h3 { font-size: 0.98rem; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0; }

::selection { background: rgba(143, 183, 217, 0.35); }

/* ---------------------------------------------------------------- structure */

.shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
}

.sidebar {
    background: rgba(6, 15, 28, 0.72);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--border);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}

@media (max-width: 900px) {
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    padding: 0 8px;
}

/* Le même signe que l'en-tête du site : carré orange, lettre blanche. */
.brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--brand);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    flex: none;
}

.brand .scope {
    display: block;
    margin-top: 1px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    color: var(--muted-dark);
    letter-spacing: 0.02em;
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.nav a:hover { background: var(--surface-hover); color: var(--text); }

.nav a.active {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    color: var(--brand);
}

.nav a.active svg { color: var(--brand); }

.nav svg { width: 17px; height: 17px; flex: none; }

/* Libellés en mono, comme les surtitres du site. */
.nav-label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.03em;
    color: var(--muted-dark);
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-foot {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.who {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted-dark);
    padding: 0 12px;
    word-break: break-word;
}

main {
    padding: 34px clamp(16px, 3.5vw, 44px) 64px;
    min-width: 0;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.subtitle { color: var(--muted); font-size: 14px; margin-top: 6px; }

.subtitle a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(214, 231, 246, 0.35);
    text-underline-offset: 4px;
}

.subtitle a:hover { text-decoration-color: currentColor; }

main > h1 + .subtitle { margin-bottom: 26px; }

section { margin-bottom: 28px; }

/* ------------------------------------------------------------------- cartes */

/*
 * Les cartes reprennent celles de la grille « Fonctionnalités » du site : un panneau dégradé
 * bordé d'un filet, entouré d'un second filet à quelques pixels -- dessiné ici par des ombres
 * pleines, pour ne rien changer au HTML des écrans.
 */
.card,
.stat,
.device,
.auth-card:not(.secondary) {
    background: linear-gradient(180deg, rgba(20, 41, 64, 0.5) 0%, rgba(8, 19, 33, 0.85) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow:
        0 0 0 6px rgba(12, 30, 51, 0.22),
        0 0 0 7px var(--border-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card {
    padding: 20px 22px;
}

.card + .card { margin-top: 22px; }

.card > h2 { margin-bottom: 14px; }

.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

/* Ce qui attend une décision humaine : ambre, la seule carte qui doit accrocher l'œil. */
.card.attention {
    border-color: rgba(242, 200, 121, 0.38);
    background: linear-gradient(180deg, rgba(242, 200, 121, 0.08) 0%, rgba(8, 19, 33, 0.88) 100%);
    box-shadow:
        0 0 0 6px rgba(242, 200, 121, 0.05),
        0 0 0 7px rgba(242, 200, 121, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card.attention > h2 { color: var(--warn-text); }

/* ---------------------------------------------------------------- chiffres */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
}

.stat {
    padding: 16px 18px;
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
}

.stat .value {
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat .label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.stat.accent .value { color: var(--accent); }
.stat.warn .value { color: var(--warn-text); }

.stat.alert { border-color: rgba(241, 153, 153, 0.35); }
.stat.alert .value { color: var(--danger-text); }

/* --------------------------------------------------------------- tableaux */

.table-scroll { overflow-x: auto; }

.card { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}

th {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--muted-dark);
    white-space: nowrap;
    border-bottom-color: var(--border);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-hover); }

td.num {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

td.note, .note { color: var(--muted); font-size: 13px; }

td .note { display: block; margin-top: 2px; }

.empty {
    color: var(--muted);
    text-align: center;
    padding: 28px 12px;
    font-size: 14px;
}

/* --------------------------------------------------------------- pastilles */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.55;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    flex: none;
}

.badge-plain::before { display: none; }

.badge-ok { background: var(--ok-bg); color: var(--ok-text); border-color: rgba(159, 227, 196, 0.28); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: rgba(242, 200, 121, 0.28); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); border-color: rgba(241, 153, 153, 0.3); }
.badge-info { background: var(--info-bg); color: var(--info-text); border-color: rgba(143, 183, 217, 0.28); }
.badge-busy { background: var(--busy-bg); color: var(--busy-text); border-color: rgba(183, 168, 240, 0.28); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-text); border-color: rgba(159, 176, 194, 0.22); }
.badge-neutral::before { box-shadow: none; }

.status-cell { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.status-reason { font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------- boutons */

/* Boutons du site : « voile » par défaut, « clair » pour l'action principale. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(12, 30, 51, 0.55);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.btn:hover { border-color: rgba(214, 231, 246, 0.55); background: rgba(16, 35, 58, 0.8); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--brand);
    border-color: transparent;
    color: #ffffff;
    font-weight: 600;
}

.btn-primary:hover { background: var(--brand-hover); border-color: transparent; }

.btn-small { padding: 5px 11px; font-size: 13px; }

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.btn-block { width: 100%; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

/* -------------------------------------------------------------- formulaires */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
}

.field input, .field select, .filters select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(6, 15, 28, 0.7);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus, .field select:focus, .filters select:focus {
    outline: none;
    border-color: rgba(214, 231, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(214, 231, 246, 0.1);
}

.field input::placeholder { color: var(--muted-dark); }

.hint { font-size: 12.5px; color: var(--muted); }

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.filters .field { margin-bottom: 0; min-width: 190px; }

/* Dans une carte de filtres : champs et bouton sur la même ligne de base et à la même hauteur,
   le champ de recherche prend la place disponible. */
.filters .field select { width: 100%; min-width: 0; margin-bottom: 0; }
.filters .field:first-child { flex: 1 1 280px; max-width: 460px; }
.filters .field input, .filters .field select, .filters > .btn { height: 42px; }
.filters > .btn { padding-top: 0; padding-bottom: 0; }

/* Le filtre de statut des écrans Impressions est un select nu, hors de tout .field. */
.filters select { width: auto; min-width: 200px; margin-bottom: 18px; cursor: pointer; }

.errors {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(241, 153, 153, 0.35);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13.5px;
}

.errors ul { margin: 0; padding-left: 18px; }

.flash {
    border-radius: var(--radius-sm);
    padding: 11px 15px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
}

.flash-success { background: var(--ok-bg); color: var(--ok-text); border-color: rgba(159, 227, 196, 0.32); }
.flash-error { background: var(--danger-bg); color: var(--danger-text); border-color: rgba(241, 153, 153, 0.35); }

/* ---------------------------------------------------------------- connexion */

/* La lueur de la landing, derrière les deux cartes de connexion et d'inscription. */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(760px 520px at 50% -8%, rgba(23, 49, 77, 0.75), transparent 70%);
}

.auth-bar {
    padding: 20px clamp(16px, 4vw, 40px);
    border-bottom: 1px solid var(--border);
}

.auth-wrap {
    flex: 1;
    display: grid;
    place-items: center;
    padding: clamp(28px, 6vw, 72px) 16px;
}

.auth-cols {
    width: 100%;
    max-width: 940px;
    display: grid;
    gap: 22px;
    grid-template-columns: 1fr;
}

@media (min-width: 860px) {
    .auth-cols { grid-template-columns: 1fr 1fr; gap: 28px; }
}

.auth-card {
    border-radius: var(--radius);
    padding: clamp(22px, 3vw, 32px);
}

/* La colonne d'inscription est le chemin secondaire : plus discrète, sans être cachée. */
.auth-card.secondary {
    background: transparent;
    border: 1px solid var(--border);
}

.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .subtitle { margin-bottom: 22px; }

.auth-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

/* ----------------------------------------------------------------- devices */

/*
 * Un poste et ses imprimantes forment un bloc : l'imprimante n'existe que derrière la machine qui
 * la déclare, et son état dépend d'abord de celui du poste. Dessous, un vrai tableau : identifiant,
 * état et raison alignés d'une imprimante à l'autre plutôt que tassés sur une ligne.
 */
.device { overflow: hidden; }

/* Le double filet des cartes, empilé dix fois, prenait autant de place que le contenu. */
.device { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }

.device + .device { margin-top: 14px; }

.device-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 8px 16px;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
}

.device-name {
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    word-break: break-word;
}

.device-name svg { width: 16px; height: 16px; flex: none; color: var(--muted); }

.device-meta {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 12.5px;
    color: var(--muted);
}

.device-meta form { display: flex; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--danger-text); border-color: rgba(241, 153, 153, 0.35); background: var(--danger-bg); }

.printer-table th, .printer-table td { padding: 6px 16px; font-size: 13.5px; }
.printer-table th { padding-top: 7px; padding-bottom: 5px; font-size: 10.5px; }
.printer-table .badge { padding-top: 1px; padding-bottom: 1px; }
.printer-table tbody tr:last-child td { border-bottom: none; }
.printer-table tbody tr:hover { background: var(--surface-hover); }

/* Largeurs fixes pour les colonnes courtes : les noms et les raisons se partagent le reste, et
   les colonnes restent alignées d'un poste à l'autre. */
.printer-table th:nth-child(2) { width: 90px; }
.printer-table th:nth-child(3) { width: 170px; }
.printer-table th:nth-child(4) { width: 36%; }

.printer-table .printer-name { font-weight: 500; }
.printer-table .printer-name .badge { margin-left: 8px; }

.printer-id {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted-dark);
    word-break: break-all;
}

.printer-detail { font-size: 13px; color: var(--muted); }

/* Un poste déconnecté garde ses imprimantes affichées, mais en retrait : ce sont les dernières
   connues, pas un état vérifié. Les masquer donnerait l'impression d'avoir perdu la config. */
.device.is-off .printer-table { opacity: 0.6; }

.device-empty { margin: 0; padding: 10px 16px; color: var(--muted); font-size: 13.5px; }

/* Sur téléphone, quatre colonnes ne tiennent pas : chaque imprimante devient un bloc, le nom sur
   sa ligne, l'identifiant, l'état et la raison dessous. */
@media (max-width: 700px) {
    .printer-table thead { display: none; }
    .printer-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 12px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-soft);
    }
    .printer-table tbody tr:last-child { border-bottom: none; }
    .printer-table td { padding: 0; border: none; }
    .printer-table .printer-name { flex-basis: 100%; }
    .printer-table .printer-detail { flex-basis: 100%; }
    .printer-table .printer-detail.is-empty { display: none; }
    .device-meta { margin-left: 0; }
}

/* ------------------------------------------------------------- impressions */

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.print-form h2 { margin-bottom: 16px; }

/*
 * Formulaire d'impression : imprimante, copies et couleur sur une ligne, la zone de dépôt dessous
 * sur toute la largeur, puis le bouton. Une seule colonne sur téléphone.
 */
.print-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    grid-template-areas:
        "printer copies color"
        "file    file   file"
        "submit  submit submit";
    gap: 14px 16px;
    align-items: end;
}

.print-grid .field { margin-bottom: 0; }
.field-printer { grid-area: printer; }
.field-copies { grid-area: copies; }
.field-color { grid-area: color; }
.field-file { grid-area: file; }
.field-submit { grid-area: submit; }
.print-grid .field input, .print-grid .field select { height: 42px; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    font-size: 14px;
    color: var(--text-dim);
    cursor: pointer;
}

.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(6, 15, 28, 0.45);
    color: var(--text-dim);
    font-size: 14px;
    text-align: center;
    transition: border-color 120ms ease, background 120ms ease;
}

.dropzone svg { width: 24px; height: 24px; color: var(--muted); }

/* Le vrai champ fichier recouvre la zone, invisible : clic et dépôt passent par lui. */
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone:hover, .dropzone.is-over { border-color: rgba(214, 231, 246, 0.55); background: var(--surface-hover); }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.dropzone.has-file { border-style: solid; color: var(--text); }
.dropzone.has-file svg { color: var(--ok-text); }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.section-head .icon-btn { text-decoration: none; }
.section-filter { margin-left: auto; }
.section-filter select {
    min-width: 200px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(6, 15, 28, 0.7);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.jobs-history { padding: 6px 0; }
.jobs-history > table > thead th { padding-left: 18px; padding-right: 18px; }
.jobs-history .job-row td { padding: 12px 18px; }
.jobs-history td.right { text-align: right; white-space: nowrap; }

.job-id { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--muted-dark); }
.job-title { font-weight: 500; word-break: break-word; }

/* Job déplié : un filet sur la gauche relie la ligne à son détail. */
.job-group.is-open { background: rgba(143, 183, 217, 0.04); }
.job-group.is-open > tr > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.job-group.is-open > .job-row > td { border-bottom-color: transparent; }
.job-created { white-space: nowrap; color: var(--text-dim); font-size: 13.5px; }

.job-details > td { padding: 4px 18px 18px 22px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }

.tab {
    padding: 8px 12px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--brand); }

.events-table th, .events-table td { padding: 7px 12px; font-size: 13px; }
.events-table tbody tr:last-child td { border-bottom: none; }
.event-description { color: var(--text-dim); }

.info-list {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 7px 16px;
    margin: 4px 0 0;
    font-size: 13.5px;
}

.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; word-break: break-word; }
.mono { font-family: var(--font-mono); font-size: 12px; }

.job-resolve { margin-top: 16px; }

@media (max-width: 760px) {
    .print-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "printer printer"
            "copies  color"
            "file    file"
            "submit  submit";
    }

    .section-filter { margin-left: 0; width: 100%; }
    .section-filter select { width: 100%; }

    /* Le tableau devient une pile de blocs : numéro et titre, puis poste, imprimante, date et
       statut à la suite. */
    .jobs-history > table, .jobs-history > table > tbody { display: block; }
    .jobs-history > table > thead { display: none; }
    .jobs-history .job-details { display: block; }
    .jobs-history .job-details[hidden] { display: none; }
    .jobs-history .job-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 16px; }
    .jobs-history .job-row td { padding: 0; border: none; }
    .jobs-history .job-row td:first-child { flex-basis: 100%; }
    .jobs-history td.right { margin-left: auto; }
    .job-group { border-bottom: 1px solid var(--border-soft); }
    .job-group.is-open > tr > td:first-child { box-shadow: none; }
    .job-group.is-open { box-shadow: inset 3px 0 0 var(--accent); }
    .job-details > td { display: block; padding: 4px 16px 16px; overflow-x: auto; }
    .info-list { grid-template-columns: 1fr; gap: 2px; }
    .info-list dd { margin-bottom: 8px; }
}

/* ---------------------------------------------------------------- divers */

.pagination { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-size: 13.5px; color: var(--muted); }

.pagination { flex-wrap: wrap; }
.pagination .page-links { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.pagination .page-links .btn { min-width: 34px; height: 34px; justify-content: center; padding-top: 0; padding-bottom: 0; }
.pagination .btn-icon { padding-left: 0; padding-right: 0; }
.pagination .btn-icon svg { width: 16px; height: 16px; }
.pagination .is-current { background: var(--brand-soft); border-color: var(--brand-border); color: var(--text); }
.pagination .is-disabled { opacity: 0.4; pointer-events: none; }
.pagination .page-gap { align-self: center; padding: 0 2px; color: var(--muted-dark); }

.callout {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 18px 20px;
    color: var(--text-dim);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.callout code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent);
    background: #071425;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------------------------------------------------------------------------
   Écran Intégration — valeurs à recopier

   Un jeton ou une commande curl se lit caractère par caractère et se sélectionne
   à la souris : d'où la police à chasse fixe, le retour à la ligne forcé (une
   barre de défilement horizontale rend la sélection pénible) et le contraste
   suffisant pour distinguer 0 de O, 1 de l.
   --------------------------------------------------------------------------- */
.token {
    margin: 12px 0 0;
    padding: 12px 14px;
    background: #071425;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--accent);
    white-space: pre-wrap;
    word-break: break-all;
    user-select: all;
}

/* ------------------------------------------------------------- intégration */

.inline-code {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: #071425;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent);
    word-break: break-all;
}

.note code { font-family: var(--font-mono); font-size: 12px; }

.variables-table td { vertical-align: middle; }
.variables-table td:first-child { width: 150px; }
.variables-table td:last-child { width: 32%; }

.value-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.value-list { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }

.compact-select {
    height: 32px;
    max-width: 300px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(6, 15, 28, 0.7);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.copy-btn { margin-top: 10px; }
.value-cell .copy-btn { margin-top: 0; }

.token-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 16px; }
.token-form .field { flex: 1 1 260px; margin: 0; }
.token-form .field input, .token-form .btn { height: 42px; }

@media (max-width: 700px) {
    .variables-table, .variables-table tbody { display: block; }
    .variables-table thead { display: none; }
    .variables-table td:nth-child(2) .note { word-break: break-word; }
    .variables-table tr { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
    .variables-table td { padding: 0; border: none; width: auto !important; }
    .variables-table td:nth-child(2), .variables-table td:last-child { flex-basis: 100%; }
    .compact-select { max-width: 100%; width: 100%; }
    .variables-table .value-cell { display: flex; }
}

/* Réaffichage d'un jeton : un petit panneau sous le bouton, mot de passe puis confirmation. */
.token-actions { display: flex; justify-content: flex-end; align-items: flex-start; gap: 8px; }
.reveal { position: relative; }
.reveal > summary { list-style: none; cursor: pointer; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal[open] > summary { background: var(--surface-hover); }

.reveal-form {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 5;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-solid);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    text-align: left;
}

.reveal-form label { font-size: 13px; color: var(--text-dim); }
.reveal-form input {
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(6, 15, 28, 0.7);
    color: var(--text);
    font: inherit;
}
.reveal-error { font-size: 12.5px; color: var(--danger-text); }
