/* Solstice OS — dashboard. Sobre, lisible sur téléphone, sans dépendance. */
:root {
  --bg: #f6f3ee; --card: #fff; --ink: #2b2622; --muted: #8a8079; --line: #ece6de;
  --accent: #c0392b; --ok: #2e7d4f; --warn: #b9770e; --blue: #2e5fa8; --flash: #eef6f0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171513; --card: #221f1c; --ink: #eee7df; --muted: #9b9188; --line: #34302b; --flash: #1f3326; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, system-ui, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink);
       display: flex; min-height: 100vh; }
a { color: var(--blue); }
.side { width: 190px; flex: none; padding: 18px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.brand { font-weight: 700; font-size: 17px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.side nav a.on { background: var(--card); font-weight: 600; box-shadow: 0 1px 2px #0001; }
.logout { margin-top: auto; } .logout button { width: 100%; }
main { flex: 1; padding: 18px; min-width: 0; }
.banner { background: #fdf2e0; color: #7a4b00; border: 1px solid #f2d6a2; padding: 8px 12px; border-radius: 10px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 3px #0000000f; min-width: 0; }
.card.wide { grid-column: span 2; } .card.full { max-width: 1100px; }
.card header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card h2 { font-size: 15px; margin: 0; text-transform: uppercase; letter-spacing: .03em; }
.maj, .muted, .sub { color: var(--muted); font-size: 12.5px; } .sub { margin: 0 0 8px; }
.soon { opacity: .6; border: 1px dashed var(--line); box-shadow: none; }
table { width: 100%; border-collapse: collapse; } td, th { padding: 5px 4px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.num { text-align: right; white-space: nowrap; } .nowrap { white-space: nowrap; }
tr.today td { font-weight: 600; color: var(--accent); }
.empty { color: var(--muted); font-style: italic; margin: 6px 0; }
.alert { background: #fbe9e7; color: #9c2b1f; padding: 6px 10px; border-radius: 8px; margin: 0 0 8px; font-weight: 600; }
.alert-text { color: var(--accent); } .up { color: var(--ok); } .down { color: var(--accent); }
.list { margin: 6px 0 0; padding-left: 18px; }
.bars { list-style: none; margin: 0; padding: 0; } .bars li { display: grid; grid-template-columns: 1fr 70px 64px; gap: 8px; align-items: center; padding: 3px 0; }
.bars .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .bars .bar i { display: block; height: 100%; background: var(--blue); }
.bars li.low .lbl, .bars li.low .num { color: var(--accent); font-weight: 600; } .bars li.low .bar i { background: var(--accent); }
.bars .units { grid-column: 1 / -1; font-size: 11px; color: var(--muted, #888); margin-top: -2px; }
.mail { list-style: none; margin: 0; padding: 0; } .mail li { display: grid; grid-template-columns: 1fr auto; padding: 5px 0; border-top: 1px solid var(--line); }
.mail .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mail .when { color: var(--muted); font-size: 12.5px; }
.mail .subj { grid-column: 1 / -1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail li.unread .who, .mail li.unread .subj { font-weight: 700; color: var(--ink); }
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; } .chart { position: relative; height: 120px; min-width: 0; }
.badge { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.valider-wrap { display: grid; grid-template-rows: minmax(0, 2fr) minmax(0, 1fr); height: 620px; padding: 0; overflow: hidden; }
.valider-wrap > .valider { overflow-y: auto; padding: 14px 16px; }
.valider-wrap > .demander { border-top: 2px solid var(--line); padding: 10px 16px 12px; overflow-y: auto; background: var(--bg); }
.demander h3 { margin: 0 0 6px; font-size: 14px; } .demander form { display: flex; gap: 8px; align-items: stretch; }
.demander textarea { flex: 1; resize: vertical; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.answers .answer { border-top: 1px solid var(--line); padding: 6px 0; font-size: 13px; } .answers .answer:first-child { border-top: 0; }
.answers .a { white-space: pre-wrap; margin-top: 2px; } .answers .answer.échec .a { color: var(--warn); }
.valider .action { border-top: 1px solid var(--line); padding: 10px 0; } .valider .what { margin: 3px 0 6px; }
.valider .action.échec .line, .valider .action.à_vérifier .line { color: var(--warn); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .refuse { display: flex; gap: 6px; }
.edit { display: flex; gap: 6px; align-items: center; margin: 6px 0; } .edit label { flex: 1; display: flex; gap: 6px; align-items: center; }
.edit input { flex: 1; }
.flash { background: var(--flash); color: var(--ink); border-radius: 8px; padding: 6px 10px; margin: 0 0 6px; }
button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: .5; cursor: wait; }
input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-width: 0; }
.filters { display: flex; gap: 10px; align-items: end; margin-bottom: 10px; flex-wrap: wrap; }
.journal td:last-child { width: 55%; }
body.login { align-items: center; justify-content: center; }
.login-card { width: min(360px, 92vw); display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; }
.warn { background: #fdf2e0; color: #7a4b00; padding: 8px 10px; border-radius: 8px; }
code { background: var(--bg); padding: 1px 5px; border-radius: 5px; }
@media (max-width: 760px) {
  body { flex-direction: column; } .side { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border: 0; padding: 10px; gap: 8px; }
  .side nav { flex-direction: row; flex-wrap: wrap; } .logout { margin: 0 0 0 auto; } .logout button { width: auto; }
  main { padding: 10px; } .card.wide { grid-column: auto; } .valider-wrap { height: auto; grid-template-rows: auto auto; } .charts { grid-template-columns: 1fr; } .grid { grid-template-columns: 1fr; }
}
.legend { font-size: 11.5px; color: var(--muted); margin: 0 0 4px; } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 3px 0 6px; vertical-align: -1px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--bg); border-radius: 10px; padding: 8px; min-height: 120px; } .day.today { outline: 2px solid var(--accent); }
.day h3 { font-size: 12.5px; margin: 0 0 6px; color: var(--muted); text-transform: uppercase; }
.ev { border-left: 4px solid var(--muted); background: var(--card); border-radius: 6px; padding: 4px 6px; margin-bottom: 6px; font-size: 13px; }
.ev .h { font-weight: 700; margin-right: 4px; } .ev .s { display: block; color: var(--muted); font-size: 12px; }
.k-livraison { border-color: #c0392b; } .k-enlevement { border-color: #e67e22; } .k-reservation { border-color: #8e44ad; }
.k-rdv { border-color: #2e5fa8; } .k-ferie { border-color: #95a5a6; opacity: .8; }
.legend i.k-livraison { background: #c0392b; } .legend i.k-enlevement { background: #e67e22; } .legend i.k-reservation { background: #8e44ad; }
.legend i.k-rdv { background: #2e5fa8; } .legend i.k-ferie { background: #95a5a6; }
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } }
.planning { width: 100%; } .week { gap: 10px; }
.ev.editable { cursor: pointer; } .ev.editable:hover { box-shadow: 0 0 0 2px var(--blue) inset; } .ev.dragging { opacity: .4; }
.day.drop { outline: 2px dashed var(--blue); }
dialog { border: 0; border-radius: 14px; padding: 18px; background: var(--card); color: var(--ink); width: min(420px, 92vw); }
dialog::backdrop { background: #0006; }
#edit-form { display: flex; flex-direction: column; gap: 10px; } #edit-form h3 { margin: 0; }
#edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; } .hours { display: flex; gap: 10px; } .hours label { flex: 1; }
.upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.pick { border: 1px dashed var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.pick input { display: block; max-width: 220px; font-size: 12px; margin-top: 4px; }
.filters a.on { font-weight: 700; color: var(--ink); text-decoration: none; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.file { margin: 0; background: var(--bg); border-radius: 10px; overflow: hidden; }
.file img, .file .pdf { width: 100%; height: 150px; object-fit: cover; display: flex; align-items: center; justify-content: center;
  background: var(--line); font-weight: 700; color: var(--muted); }
.file figcaption { padding: 8px; font-size: 13px; } .file form { margin-top: 6px; } button.small { padding: 3px 8px; font-size: 12px; }
.edit label.long { flex-direction: column; align-items: stretch; } .edit textarea { width: 100%; font: inherit; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.subhead { font-size: 12.5px; margin: 10px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.locations { list-style: none; margin: 0; padding: 0; } .locations li { padding: 5px 8px; margin-bottom: 4px; border-left: 4px solid #e67e22;
  background: var(--bg); border-radius: 6px; } table.small td { font-size: 13px; padding: 3px 4px; }
.sync { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: -8px; }
#sync-btn { padding: 2px 9px; font-size: 15px; line-height: 1.2; border-radius: 50%; }
#sync-btn.htmx-request { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
tr.low-row td { color: var(--accent); font-weight: 600; }

/* Prospection (020) */
.prospect-head .search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.search-state { margin: 10px 2px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding: 10px 0 16px; align-items: start; }
.pcol { background: var(--card); border-radius: 12px; padding: 8px; min-height: 120px; max-height: 78vh; overflow-y: auto; border: 2px solid transparent; }
.pcol.over { border-color: var(--blue); }
.pcol h3 { margin: 2px 4px 8px; font-size: 13px; display: flex; justify-content: space-between; }
.pcard { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; margin-bottom: 7px; font-size: 12.5px; cursor: grab; }
.pcard.dragging { opacity: .45; } .pcard.replied { border-color: #2e9e5b; }
.pcard .pinfo { margin: 3px 0; overflow-wrap: anywhere; } .pcard select { width: 100%; margin-top: 4px; font-size: 12px; }
.pcard details summary { cursor: pointer; font-size: 12px; margin-top: 4px; } .pcard .hist { padding-left: 16px; margin: 6px 0 0; }
.pcard .edit label { display: flex; gap: 4px; align-items: center; font-size: 12px; } .pcard .edit input[name=valeur] { flex: 1; min-width: 0; }
.warn-text { color: var(--warn); } .ok-text { color: #2e9e5b; font-weight: 600; }
.settings .row { display: flex; flex-wrap: wrap; gap: 14px; } .settings input[type=number] { width: 70px; }
.settings label.long { display: block; margin: 8px 0; } .settings label.long input, .settings label.long textarea { display: block; width: 100%; margin-top: 3px; font: inherit; }
.settings fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; } .stats tr.total td { font-weight: 700; }
.settings input, .settings textarea { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; }
button.mini { font-size: 11px; padding: 2px 6px; white-space: nowrap; }
.accounts tr.total td { border-top: 2px solid var(--line); } .ops .lbl { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops td { font-size: 12.5px; } td.up, .up { color: var(--ok); } td.down, .down { color: var(--accent); }
.mail li { position: relative; } .mail-actions { display: flex; gap: 6px; align-items: flex-start; margin-top: 2px; }
.mail-actions details.reply summary { cursor: pointer; list-style: none; font-size: 13px; } .mail-actions details.reply[open] { flex: 1; }
.mail-actions details.reply form { display: flex; gap: 4px; margin-top: 4px; } .mail-actions details.reply input[name=consigne] { flex: 1; min-width: 0; font-size: 12px; }
.mail details.mail-open > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
.mail details.mail-open > summary::-webkit-details-marker { display: none; } .mail details.mail-open > summary .subj { grid-column: 1 / -1; }
.mail details.mail-open[open] > summary .subj { font-weight: 600; }
.mail-preview { margin: 6px 0 4px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow-y: auto; font-size: 13px; }
.mail-preview .mail-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.mail details.mail-open, .mail .mail-actions { grid-column: 1 / -1; }
/* Site (040) */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; } .tabs a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.tabs a.on { background: var(--ink); color: var(--card); }
.beer-edit { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0; } .beer-edit summary { cursor: pointer; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.gallery figure { margin: 0; } .gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; } .gallery figcaption { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.review-line { border-top: 1px solid var(--line); padding: 6px 0; } form.inline { display: inline; }
.shop-admin { font-size: 13px; } .shop-admin input:not([type=checkbox]) { width: 160px; } .shop-admin td, .shop-admin th { padding: 4px 6px; }
