/* Tabelec shop — feuille de style principale (sans étape de build) */

@font-face { font-family: 'Univia Pro'; src: url('../fonts/univiapro/UniviaPro-Regular.woff2') format('woff2'), url('../fonts/univiapro/UniviaPro-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Univia Pro'; src: url('../fonts/univiapro/UniviaPro-Medium.woff2') format('woff2'), url('../fonts/univiapro/UniviaPro-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Univia Pro'; src: url('../fonts/univiapro/UniviaPro-Bold.woff2') format('woff2'), url('../fonts/univiapro/UniviaPro-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
	--jaune: #ffec00;
	--jaune-clair: #fff7a6;
	--bleu: #005eb8;
	--texte: #1d1d1b;
	--gris: #6b6b6b;
	--bord: #d9d9d9;
	--fond: #ffffff;
	--fond-doux: #f6f6f4;
	--rouge: #c62828;
	--orange: #e07b00;
	--vert: #2e7d32;
	--rayon: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: 'Univia Pro', Arial, sans-serif;
	color: var(--texte);
	background: var(--fond);
	line-height: 1.45;
}
a { color: var(--bleu); }
h1 { font-size: 1.6rem; margin: 0 0 .2em; font-style: italic; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .5em; }
small, .muted { color: var(--gris); }
.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* --- bandeau ------------------------------------------------------------- */
.topbar {
	position: sticky; top: 0; z-index: 10;
	background: rgba(255, 255, 255, .95);
	border-bottom: 5px solid var(--jaune);
	backdrop-filter: blur(4px);
}
.topbar .container { display: flex; align-items: center; gap: 16px; min-height: 76px; }
.topbar .logo img { height: 46px; display: block; }
.topbar .titles { flex: 1; min-width: 0; }
.topbar .titles h1 { font-size: 1.35rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .titles .subtitle { font-weight: 700; color: var(--gris); }
.topbar nav { display: flex; gap: 6px; }
.icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: 50%;
	color: var(--texte); background: transparent; border: 0; cursor: pointer;
	font-size: 22px; text-decoration: none;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--jaune); outline: none; }
.icon-btn.inline { width: auto; height: auto; padding: 0; font-size: inherit; border-radius: 0; }

main { padding: 24px 0 80px; }

/* --- messages ------------------------------------------------------------ */
.flash { border-radius: var(--rayon); padding: 12px 16px; margin: 0 0 16px; border-left: 6px solid; background: var(--fond-doux); }
.flash.success { border-color: var(--vert); background: #edf7ed; }
.flash.warning { border-color: var(--orange); background: #fff4e5; }
.flash.error { border-color: var(--rouge); background: #fdecea; }
.flash ul { margin: .3em 0 0; padding-left: 1.2em; }

/* --- formulaires --------------------------------------------------------- */
.form { display: grid; grid-template-columns: 220px 1fr; gap: 12px 20px; align-items: start; max-width: 860px; }
.form > label, .form > .label { padding-top: 9px; font-weight: 500; }
.form .full { grid-column: 1 / -1; }
.form .hint { display: block; color: var(--gris); font-size: .85rem; margin-top: 4px; }
fieldset { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 12px 16px; margin: 0; }
legend { padding: 0 6px; font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
	width: 100%; max-width: 520px;
	font: inherit; color: inherit;
	padding: 9px 11px; border: 1px solid #b9b9b9; border-radius: var(--rayon); background: #fff;
}
input.narrow { max-width: 140px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--jaune); outline-offset: 0; border-color: #a59a00; }
.checks label { display: block; padding: 3px 0; }
.checks.columns { columns: 2 260px; }
.readonly { padding: 9px 11px; background: var(--fond-doux); border: 1px solid var(--bord); border-radius: var(--rayon); min-height: 40px; max-width: 520px; white-space: pre-line; }
.field-error { color: var(--rouge); font-size: .9rem; margin-top: 4px; }

.btn {
	display: inline-flex; align-items: center; gap: 8px;
	font: inherit; font-weight: 500;
	padding: 9px 16px; border-radius: var(--rayon);
	border: 1px solid #d4c400; background: var(--jaune); color: var(--texte);
	cursor: pointer; text-decoration: none;
}
.btn:hover, .btn:focus-visible { background: var(--jaune-clair); outline: none; }
.btn.secondary { background: #fff; border-color: #b9b9b9; }
.btn.secondary:hover { background: var(--fond-doux); }
.btn.danger { background: #fff; border-color: var(--rouge); color: var(--rouge); }
.btn.danger:hover { background: #fdecea; }
.btn.big { font-size: 2.2rem; padding: 6px 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.search { background: var(--fond-doux); border-radius: var(--rayon); padding: 16px; margin-bottom: 20px; }
.search .form { grid-template-columns: 160px 1fr; }

/* --- tableaux ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 700; border-bottom: 2px solid var(--texte); padding: 8px; white-space: nowrap; }
table.list td { border-bottom: 1px solid var(--bord); padding: 8px; vertical-align: top; }
table.list tr[data-href] { cursor: pointer; }
table.list tr[data-href]:hover td { background: var(--jaune-clair); }
table.list .num { text-align: right; white-space: nowrap; }
table.list .center { text-align: center; }
table.list tr.total td { font-weight: 700; border-top: 2px solid var(--texte); }
table.list tr.group td { background: var(--jaune); font-weight: 700; text-align: center; }
.strike { text-decoration: line-through; color: var(--gris); }
.red { color: var(--rouge); } .orange { color: var(--orange); } .green { color: var(--vert); }
.count { margin: 8px 0; color: var(--gris); }

/* --- tuiles (menu, choix d'actions) -------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile {
	display: block; padding: 18px; border-radius: var(--rayon);
	background: var(--jaune); color: var(--texte); text-decoration: none; font-size: 1.1rem; font-weight: 500;
	border: 1px solid #d4c400;
}
.tile:hover, .tile:focus-visible { background: var(--jaune-clair); outline: none; }
.tile .fa { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.tile.plain { background: #fff; border-color: var(--bord); font-size: 1rem; }
.tile.plain:hover { background: var(--fond-doux); }
.tile small { display: block; font-weight: 400; margin-top: 4px; }

/* --- emplacements du stock (carte cliquable) ----------------------------- */
.locator { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.locator .map, .locator .levels { position: relative; display: inline-block; }
.locator .map img { width: 520px; max-width: 100%; display: block; }
.locator .levels img { height: 300px; display: block; }
.locator .dot {
	position: absolute; transform: translate(-50%, -50%);
	width: 26px; height: 26px; border-radius: 50%;
	background: rgba(255, 255, 255, .9); border: 2px solid var(--texte);
	font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
	cursor: pointer; padding: 0;
}
.locator .dot:hover { background: var(--jaune-clair); }
.locator .dot.selected { background: var(--jaune); box-shadow: 0 0 0 4px rgba(0, 0, 0, .25); }

/* --- divers -------------------------------------------------------------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--bord); border-radius: var(--rayon); text-decoration: none; }
.pagination .current { background: var(--jaune); border-color: #d4c400; }
#scanner { max-width: 520px; margin: 0 auto; }
.card { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; margin-bottom: 16px; }
.hidden { display: none !important; }

/* --- mode développement (SITE_MODE=dev) ---------------------------------- */
body.site-dev {
	background: repeating-linear-gradient(45deg, #fff3e0, #fff3e0 30px, #ffe0b2 30px, #ffe0b2 60px);
}
body.site-dev .topbar { border-bottom-color: #e65100; }
.dev-banner {
	position: fixed; z-index: 100; left: 0; right: 0; bottom: 0;
	background: #e65100; color: #fff; text-align: center; font-weight: 700; letter-spacing: .12em;
	padding: 8px; box-shadow: 0 -2px 10px rgba(0, 0, 0, .3); pointer-events: none;
}
.dev-badge { background: #e65100; color: #fff; border-radius: 4px; padding: 2px 8px; font-size: .8rem; font-style: normal; vertical-align: middle; letter-spacing: .1em; }

@media (max-width: 700px) {
	.form, .search .form { grid-template-columns: 1fr; gap: 6px; }
	.form > label, .form > .label { padding-top: 10px; }
	.topbar .logo img { height: 34px; }
	.topbar .container { gap: 8px; min-height: 64px; }
	.topbar .titles h1 { font-size: 1rem; white-space: normal; line-height: 1.2; }
	.topbar .titles .subtitle { display: none; }
	.icon-btn { width: 36px; height: 36px; font-size: 19px; }
	.topbar nav { gap: 0; }
	table.list.responsive thead { display: none; }
	table.list.responsive tr { display: block; border-bottom: 1px solid var(--bord); padding: 6px 0; }
	table.list.responsive td { display: block; border: 0; padding: 2px 8px; text-align: left; }
	table.list.responsive td[data-label]::before { content: attr(data-label) " : "; color: var(--gris); }
	.btn { padding: 12px 18px; }
}
