/* 462impression — mise en page commune, calquée sur 462fsl.manager.
 * Couleurs et polices : variables du thème (css/themes/). */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--bg); color: var(--text);
    font-family: var(--font-body); font-size: 15px; line-height: 1.5;
}
a { color: var(--text); text-decoration: none; }
h1 { font-family: var(--font-brand); font-weight: 500; color: var(--h1); }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav {
    background: var(--surface); border-bottom: 2px solid var(--accent);
    display: flex; align-items: center; gap: 24px;
    padding: 0 24px; height: 52px; overflow-x: auto; white-space: nowrap;
}
.site-nav a { font-weight: 700; color: var(--text); font-size: 15px; }
.site-nav a:hover, .site-nav a.active { color: var(--accent); }
.site-nav .brand { font-family: var(--font-brand); font-size: 16px; color: var(--accent); margin-right: 8px; }
.site-nav .brand span { color: var(--text); }
.site-nav .sep { color: var(--border); }
.site-nav .spacer { flex: 1; }
.site-nav .user-info { font-size: 14px; color: var(--muted); font-weight: 400; }
.site-nav .discreet, .site-nav button.link { color: var(--muted); font-size: 14px; font-weight: 400; }
.site-nav .discreet:hover, .site-nav button.link:hover { color: var(--text); }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }

/* Onglets d'une section (atelier) : sous la navigation, même typographie, discrets */
.sub-nav {
    display: flex; gap: 22px; padding: 0 24px; height: 40px; align-items: center;
    background: var(--surface-2); border-bottom: 1px solid var(--border); overflow-x: auto; white-space: nowrap;
}
.sub-nav a { color: var(--muted); font-weight: 700; font-size: 14px; }
.sub-nav a:hover { color: var(--text); }
.sub-nav a.active { color: var(--accent); }

/* ── Contenu ────────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1300px; margin: 0 auto; padding: 24px 20px 0; flex: 1; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    padding: 20px; margin-bottom: 20px;
}
.card-title { font-size: 18px; font-weight: 700; color: var(--title); margin: 0 0 14px; }
.muted { color: var(--muted); }

/* Tuiles (calquées sur .bench-card) : bordure gauche colorée, bandeau Orbitron */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile {
    display: block; color: inherit;
    background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--tile-color, var(--accent));
    border-radius: 5px; padding: 14px 16px;
}
a.tile { transition: background .12s ease, transform .12s ease; }
a.tile:hover { background: var(--hover); transform: translateY(-1px); }
.tile .tile-head {
    font-family: var(--font-brand); font-size: 13px; color: var(--muted); background: var(--surface-3);
    margin: -14px -16px 8px; padding: 7px 16px; border-top-right-radius: 5px;
}
.tile .tile-main { font-size: 20px; font-weight: 700; color: var(--tile-color, var(--text)); }
.tile .tile-info { font-size: 13px; color: var(--info); margin-top: 4px; }
.tile .tile-foot { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tile.fff { --tile-color: var(--proc-fff); }
.tile.sla { --tile-color: var(--proc-sla); }
.tile.sls { --tile-color: var(--proc-sls); }
.tile.slm { --tile-color: var(--proc-slm); }

/* Cases de chiffres (calquées sur .stat-box) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 14px 16px; text-align: center; }
.stat-box .val { font-family: var(--font-brand); font-size: 28px; color: var(--accent); line-height: 1.2; }
.stat-box .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-box .val.sm { font-size: 18px; line-height: 1.55; white-space: nowrap; }

/* En-tête de page (page Bobines du manager) : titre, compteur, raccourcis à droite */
.page-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; }
.page-head .count { color: var(--muted); font-size: 15px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn-ghost.active { color: var(--text); border-color: var(--accent); background: var(--ghost-active); }

/* Barre de filtres */
.card.filters { padding: 14px 20px; }
.card.filters form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.card.filters input[type=search] { min-width: 220px; }
.card.flush { padding: 0; overflow-x: auto; }
.card.flush table.data th { padding: 10px; }

/* Tableaux */
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); }
table.data td { padding: 7px 10px; color: var(--text); border-bottom: 1px solid var(--row-border); }
table.data tr:hover td { background: var(--row-hover); }
table.data a { color: var(--link); }
table.data a:hover { color: var(--accent); }
table.data td.num, .num { font-family: monospace; font-size: 15px; white-space: nowrap; }
table.data td.dim, .dim { color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 13px; font-weight: 700; color: #fff; background: var(--badge-grey); }
.badge.blue { background: var(--badge-blue); }   .badge.green { background: var(--badge-green); }
.badge.olive { background: var(--badge-olive); } .badge.orange { background: var(--accent); }
.badge.red { background: var(--badge-red); }     .badge.purple { background: var(--badge-purple); }

/* Messages */
.flash { padding: 10px 16px; border-radius: 4px; margin-bottom: 16px; }
.flash.ok, .flash.info { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.flash.error { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-border); }

/* Formulaires */
select, input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], textarea {
    background: var(--surface); color: var(--input-text);
    border: 1px solid var(--border-input); border-radius: 3px;
    padding: 6px 10px; font-family: var(--font-body); font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
.btn {
    display: inline-block; padding: 7px 18px;
    background: var(--accent); color: #fff; border: none; border-radius: 3px;
    font-family: var(--font-body); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border-input); }
.btn-ghost:hover { background: transparent; color: var(--text); border-color: #555; }

/* Fiches d'édition : grille de champs, libellés orange comme la connexion du manager */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld > span { color: var(--accent); font-size: 14px; }
.fld.wide { grid-column: span 2; }
.fld.check { flex-direction: row; align-items: center; gap: 8px; align-self: end; min-height: 34px; }
.fld.check > span { color: var(--text); }
.fld input:not([type=checkbox]), .fld select { width: 100%; padding: 8px 10px; font-size: 15px; }
.fld.check input { width: 18px; height: 18px; margin: 0; flex: none; }
.fld input[readonly] { color: var(--muted); }
.fld small { color: var(--muted); font-size: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
ul.plain { margin: 0; padding-left: 18px; }
@media (max-width: 520px) { .fld.wide { grid-column: auto; } }

/* Parcours client */
[hidden] { display: none !important; }
.dropzone {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0;
    border: 2px dashed var(--border-input); border-radius: 6px; padding: 22px; transition: border-color .12s, background .12s;
}
.dropzone.over { border-color: var(--accent); background: var(--ghost-active); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .dz-label { flex: 1; display: flex; flex-direction: column; cursor: pointer; min-width: 220px; }
.dropzone .dz-main { color: var(--title); font-size: 17px; font-weight: 700; }
.dropzone .dz-sub { color: var(--muted); font-size: 13px; }
.model-tile .thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: var(--surface-2); margin: 0 -16px 8px; }
.model-tile .thumb img { width: 100%; height: 100%; object-fit: contain; }
.model-tile .tile-info { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.model-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.model-layout > .card { margin-bottom: 0; }
@media (max-width: 860px) { .model-layout { grid-template-columns: 1fr; } }
.model-layout + .card, .model-layout + .page-head { margin-top: 20px; }
.views { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.views img { width: 100%; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); }
.quote-form { display: flex; flex-direction: column; gap: 14px; }
.fff-options { border: 1px solid var(--border); border-radius: 5px; padding: 10px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.fff-options legend { color: var(--muted); font-size: 13px; padding: 0 6px; }
.price-box { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 5px; padding: 14px 16px; min-height: 64px; transition: opacity .12s; }
.price-box.loading { opacity: .5; }
.price-box .price { font-family: var(--font-brand); font-size: 28px; color: var(--accent); line-height: 1.2; }
.price-box .price small { font-family: var(--font-body); font-size: 14px; color: var(--muted); }
.price-box .err { color: var(--err); }
.price-box .warn { color: var(--accent); margin-top: 6px; font-size: 14px; }
.thumb-cell { width: 56px; }
.thumb-cell img { width: 48px; height: 48px; object-fit: contain; border-radius: 4px; background: var(--surface-2); display: block; }
.card.totals { max-width: 460px; margin-left: auto; }
table.sum { width: 100%; border-collapse: collapse; }
table.sum td { padding: 6px 0; border-bottom: 1px solid var(--row-border); }
table.sum td:first-child { color: var(--muted); }
table.sum td.num { text-align: right; }
table.sum tr.grand td { color: var(--title); font-weight: 700; font-size: 17px; border-bottom: 0; }
.form-grid.one { grid-template-columns: 1fr; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
a.link-accent { color: var(--link); }

/* Connexion (calquée sur login.php du manager) */
.login-wrap { max-width: 400px; margin: 80px auto; }
.login-wrap h1 { margin: 0 0 8px; }
.login-wrap label { display: block; color: var(--accent); font-size: 16px; margin: 14px 0 4px; }
.login-wrap input[type=text], .login-wrap input[type=email], .login-wrap input[type=password] { display: block; width: 100%; padding: 10px; font-size: 16px; }
.login-wrap .remember { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 15px; margin-top: 14px; }
.login-wrap .btn { margin-top: 20px; width: 100%; padding: 10px 18px; font-size: 16px; }

/* Pied */
.site-foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
    padding: 14px 24px; margin-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px;
}
