/* Chez Liorah — charte : brun chocolat, orange flamme, fond crème */
:root {
  --ink: #210A08; --brown: #6B2E1C; --flame: #E8470F; --flame-txt: #B23A0C;
  --cream: #FAF6F2; --line: #EADFD6; --line-soft: #F3ECE7; --muted: #6E5A52; --soft: #FDEEE6;
  --good: #1F6B4A; --good-bg: #E4F2EA; --warn-bg: #FDE8DC; --gray-bg: #F1ECE8;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--cream); font-size: 14px; }
a { color: var(--flame-txt); }
a:hover { color: var(--ink); }
h1, .num-big { font-family: Oswald, 'Arial Narrow', sans-serif; font-weight: 500; }

.shell { display: flex; min-height: 100vh; }
.side { flex: 0 0 240px; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo img { width: 210px; display: block; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.side nav a::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: #CDBFB6; }
.side nav a:hover { background: var(--gray-bg); }
.side nav a.on { background: var(--ink); color: #fff; font-weight: 600; }
.side nav a.on::before { background: var(--flame); }
.side .bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.rate-box { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.rate-box small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--flame-txt); font-weight: 600; }
.rate-box strong { font-family: Oswald, sans-serif; font-weight: 500; font-size: 19px; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--brown); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.me div { display: flex; flex-direction: column; line-height: 1.3; }
.me span { font-size: 12px; color: var(--muted); }
.linkbtn { background: none; border: none; padding: 0; color: var(--flame-txt); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }

main { flex: 1; min-width: 0; padding: 28px 34px 48px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.head h1 { margin: 0; font-size: 32px; }
.head p { margin: 4px 0 0; color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card h2 small { font-weight: 400; font-size: 12px; color: var(--muted); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row > .side-form { flex: 1 1 320px; max-width: 420px; }
.row > .grow { flex: 999 1 520px; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi .lbl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.kpi.dark .lbl, .kpi.dark .foot { color: #E9D9D0; }
.kpi .val { font-family: Oswald, sans-serif; font-size: 30px; font-weight: 500; line-height: 1.15; }
.kpi .val small { font-size: 15px; font-weight: 400; }
.kpi .foot { font-size: 13px; color: var(--muted); }
.kpi.target { border: 1px dashed var(--flame); }

table { width: 100%; border-collapse: collapse; }
.tbl { overflow-x: auto; }
th { text-align: left; padding: 9px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
tfoot td { font-weight: 700; border-bottom: none; }
.r { text-align: right; }
td.wrap { white-space: normal; }
.in { color: var(--good); font-weight: 600; }
.out { color: var(--flame-txt); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--muted); }
.pill.warn { background: var(--warn-bg); color: var(--flame-txt); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.dark { background: var(--ink); color: #fff; }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
input, select, textarea { height: 42px; padding: 0 11px; border-radius: 8px; border: 1px solid #D9CCC3; background: #fff; font: 500 14px Inter, sans-serif; color: var(--ink); width: 100%; }
textarea { height: 70px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--flame); outline-offset: 0; border-color: var(--flame); }
input[type=checkbox] { width: 18px; height: 18px; }
input.mini { width: 90px; height: 34px; text-align: right; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.readonly { height: 42px; display: flex; flex-direction: column; justify-content: center; padding: 0 11px; border-radius: 8px; background: var(--gray-bg); font-weight: 500; }
.readonly small { font-size: 11px; color: var(--muted); }

.btn { height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 500 14px Inter, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--flame-txt); border-color: var(--flame-txt); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.danger { color: var(--flame-txt); }
form.inline { display: inline; }

.seg { display: flex; border: 1px solid #D9CCC3; border-radius: 8px; overflow: hidden; }
.seg label { flex: 1; }
.seg input { display: none; }
.seg span { display: flex; height: 40px; align-items: center; justify-content: center; font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: #fff; }

.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 11px 16px; text-decoration: none; color: var(--ink); border-bottom: 3px solid transparent; font-weight: 500; }
.tabs a.on { border-bottom-color: var(--flame); font-weight: 600; }

.flash { padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash.ok { background: var(--good-bg); color: var(--good); }
.flash.error { background: var(--warn-bg); color: var(--flame-txt); }
.lock { background: var(--gray-bg); color: var(--muted); padding: 10px 14px; border-radius: 10px; font-size: 13px; }

.summary { background: var(--soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.summary div.big { color: var(--ink); font-size: 14px; align-items: baseline; }
.summary div.big strong { font-family: Oswald, sans-serif; font-weight: 500; font-size: 24px; }

.line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.line.strong { font-weight: 700; }
.bar { height: 9px; border-radius: 5px; background: var(--gray-bg); overflow: hidden; }
.bar > div { height: 100%; background: var(--flame); border-radius: 5px; }
.bar.brown > div { background: var(--brown); }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--gray-bg); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 210px; border-bottom: 1px solid var(--line); }
.chart .c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; height: 100%; }
.chart .c i { display: block; width: 100%; max-width: 28px; background: var(--brown); border-radius: 4px 4px 0 0; }
.chart .c span { font-size: 10px; color: var(--muted); }
.empty { color: var(--muted); padding: 14px 0; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 400px; padding: 28px; gap: 16px; }
.login img { width: 260px; align-self: center; }

.printonly { display: none; }
@media print {
  .side, .tools, .noprint, form { display: none !important; }
  .printonly { display: block; }
  body { background: #fff; }
  main { padding: 0; }
  .card, .kpi { break-inside: avoid; border-color: #ccc; }
}
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; flex-basis: auto; }
  main { padding: 20px 16px; }
}
