Annuaire › Code ouvert
Code publié par son auteur, en lecture seule. « Copier dans mon espace » crée un nouveau site à vous (non publié) que vous pouvez modifier librement.
css/style.css · 3.8 Ko
/* ============================================================
Fichier : css/style.css
Rôle : apparence du carnet de caisse (mobile d'abord).
Dépend de : index.html (classes) et js/app.js (qui crée des
lignes de tableau et des boutons avec ces classes).
============================================================ */
/* ----- 1. Variables ----- */
:root {
--fond: #f6f1e7;
--carte: #ffffff;
--texte: #1f2933;
--texte-doux: #4a5560;
--accent: #2f6b2f; /* vert vanille */
--accent-fonce: #1f4d1f;
--danger: #a32121;
--bordure: #cdc6b6;
}
/* ----- 2. Base ----- */
*, *::before, *::after { box-sizing: border-box; } /* évite les débordements horizontaux */
body {
margin: 0; background: var(--fond); color: var(--texte);
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; /* polices système : aucune ressource externe */
line-height: 1.5;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aide { color: var(--texte-doux); font-size: .95rem; margin: 4px 0 8px; }
.centre { text-align: center; }
:focus-visible { outline: 3px solid #b45309; outline-offset: 2px; }
/* ----- 3. En-tête ----- */
.entete { position: relative; background: var(--accent-fonce); color: #fff; }
.entete__image { display: block; width: 100%; height: 120px; object-fit: cover; opacity: .5; }
.entete__texte { position: absolute; inset: 0; padding: 0 16px; display: flex; flex-direction: column; justify-content: center; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.entete h1 { margin: 0; font-size: 1.6rem; }
.entete p { margin: 4px 0 0; }
/* ----- 4. Mise en page ----- */
.page { max-width: 720px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.carte { background: var(--carte); border: 1px solid var(--bordure); border-radius: 10px; padding: 16px; min-width: 0; }
.carte h2 { margin: 0 0 8px; font-size: 1.2rem; }
.carte--total { background: #eef6ee; border-left: 6px solid var(--accent); }
.total { font-size: 2rem; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
/* ----- 5. Formulaire ----- */
.champ { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { font-weight: 600; }
input, textarea {
font: inherit; width: 100%; padding: 10px; color: var(--texte);
border: 2px solid var(--bordure); border-radius: 8px; background: #fff;
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; resize: vertical; margin-bottom: 8px; }
.invalide { border-color: var(--danger); }
.erreur { color: var(--danger); font-weight: 600; margin: 0 0 8px; }
.erreur:empty { margin: 0; }
/* ----- 6. Boutons ----- */
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.bouton {
font: inherit; font-weight: 700; cursor: pointer; padding: 10px 16px;
border-radius: 8px; border: 2px solid var(--accent); background: var(--accent); color: #fff;
}
.bouton:hover { background: var(--accent-fonce); }
.bouton--danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.bouton--danger:hover { background: #fbeaea; }
.bouton--petit { padding: 4px 10px; font-size: .9rem; }
/* ----- 7. Tableaux ----- */
.tableau-defilant { overflow-x: auto; } /* si le tableau est trop large, il défile seul */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--bordure); text-align: left; }
thead th { background: #f0ece1; }
.nombre { text-align: right; }
td.nombre { white-space: nowrap; }
tfoot td { font-weight: 700; }
.pied { text-align: center; color: var(--texte-doux); padding: 16px; font-size: .9rem; }
@media (min-width: 700px) {
.entete h1 { font-size: 2rem; }
.entete__texte { padding: 0 calc((100% - 720px) / 2 + 16px); }
}