/* Styles communs : espace de modification des clients et tableau de bord de Rub. */
:root {
  --bg: #f5f5f2;
  --card: #fff;
  --ink: #1b1d22;
  --muted: #646873;
  --line: #e2e2dc;
  --accent: #2346d8;
  --accent-soft: #e8edfd;
  --ok: #1f7a4a;
  --warn: #a15c00;
  --bad: #b3261e;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: 1.15rem; margin: 0 0 .8em; }
code { background: var(--accent-soft); padding: .15em .45em; border-radius: 6px; font-size: .95em; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; font: inherit; font-weight: 600; padding: .7em 1.2em; border-radius: 10px; border: 1.5px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn.ghost { background: var(--card); color: var(--accent); }
.btn.small { padding: .45em .9em; min-height: 38px; font-size: .9rem; }
.btn.danger { color: var(--bad); border-color: #e7b7b3; }
.link { background: none; border: 0; padding: .4em; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
input, textarea, select { font: inherit; width: 100%; padding: .65em .8em; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, textarea:focus, select:focus, .btn:focus-visible, button:focus-visible, label.btn:focus-within { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: auto; }
input[type="time"] { width: 7.5em; padding: .45em .5em; }
input[type="color"] { padding: 4px; height: 44px; }
.error { color: var(--bad); background: #fdecea; padding: .7em 1em; border-radius: 10px; }
.notice { background: #e7f5ec; color: var(--ok); padding: .7em 1em; border-radius: 10px; }
.help { color: var(--muted); font-size: .9rem; margin: .2em 0 .5em; }
.help.error { padding: .5em .8em; }
.help.ok { color: var(--ok); }

/* ------------------------------------------------ connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); width: min(420px, 100%); padding: 32px; border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.07); display: grid; gap: 14px; }
.card label { display: grid; gap: 6px; font-weight: 600; }
.brand { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--accent); margin: 0; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }

/* ------------------------------------------------ espace client */
.loading { padding: 40px; text-align: center; color: var(--muted); }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
.admin-top .brand { font-size: .65rem; }
.admin-body { display: grid; grid-template-columns: 230px 1fr; gap: 24px; width: min(1100px, 100%); margin: 0 auto; padding: 24px 16px 120px; }
.tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; align-self: start; }
.tabs button { text-align: left; font: inherit; padding: .7em 1em; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink); }
.tabs button:hover { background: #ebebe6; }
.tabs button.active { background: var(--accent); color: #fff; font-weight: 600; }
.panel-edit { background: var(--card); border-radius: 18px; padding: clamp(20px, 4vw, 36px); min-width: 0; }
.intro { color: var(--muted); margin-top: 0; }
.field { margin: 0 0 22px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field.toggle label { font-weight: 500; display: flex; align-items: center; gap: .5em; cursor: pointer; }
.field.toggle input { width: 20px; height: 20px; }
.preview { width: 100%; max-width: 360px; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; margin: 6px 0 10px; display: block; background: #eee; }
.preview.empty { display: grid; place-items: center; color: var(--muted); border: 2px dashed var(--line); background: #fafaf8; }
.list { display: grid; gap: 14px; }
.item { border: 1.5px solid var(--line); border-radius: 14px; padding: 6px 16px 14px; margin: 0; min-width: 0; }
.item legend { font-weight: 700; padding: 0 6px; color: var(--accent); }
.item .item { background: #fafaf8; }
.item-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.item-fields .field { margin-bottom: 14px; min-width: 0; }
.item-fields .type-textarea, .item-fields .type-photo, .item-fields .type-list { grid-column: 1 / -1; }
.item-actions { border-top: 1px solid var(--line); padding-top: 12px; }
.add { border-style: dashed; justify-self: start; }
.hours-editor { display: grid; gap: 8px; }
.day { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.day.closed { background: #fafaf8; }
.slots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 12px 16px; background: var(--card); border-top: 1px solid var(--line); z-index: 3; }
.save-status { margin: 0; color: var(--muted); font-size: .92rem; }
.save-status.pending { color: var(--warn); font-weight: 600; }
.save-status.ok { color: var(--ok); font-weight: 600; }
.save-status.error { color: var(--bad); font-weight: 600; }
.account { display: grid; gap: 4px; max-width: 460px; }
@media (max-width: 760px) {
  .admin-body { grid-template-columns: 1fr; padding-top: 12px; }
  .item-fields { grid-template-columns: 1fr; }
  .tabs { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 4px; }
  .tabs button { white-space: nowrap; }
  .day { grid-template-columns: 1fr auto; }
  .day .slots, .day > .muted { grid-column: 1 / -1; grid-row: 2; }
  .savebar { justify-content: space-between; }
}

/* ------------------------------------------------ tableau de bord de Rub */
.owner-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 24px; background: #12141a; color: #fff; }
.owner-top a { color: #fff; text-decoration: none; }
.owner-brand { font-weight: 800; letter-spacing: .04em; }
.owner-brand span { font-weight: 400; opacity: .6; }
.owner-top nav { display: flex; align-items: center; gap: 16px; }
.owner-top .link { color: #c9ccd6; }
.owner-main { width: min(1200px, 100%); margin: 0 auto; padding: 28px 16px 64px; }
.panel { background: var(--card); border-radius: 16px; padding: 22px; margin-bottom: 20px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2, .panel-head h1 { margin: 0; }
.panel-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two > .panel { margin-bottom: 20px; }
.alerts { background: #fff4e5; border: 1px solid #f3d3a5; border-radius: 16px; padding: 18px 22px; margin-bottom: 20px; }
.alerts h2 { color: var(--warn); }
.alerts ul { margin: 0; padding-left: 1.2em; }
.all-good { background: #e7f5ec; color: var(--ok); padding: 14px 18px; border-radius: 14px; font-weight: 600; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table a { text-decoration: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: .2em .65em; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: #eee; }
.pill.ok { background: #e7f5ec; color: var(--ok); }
.pill.warn { background: #fff4e5; color: var(--warn); }
.pill.bad { background: #fdecea; color: var(--bad); }
.status-en_ligne { background: #e7f5ec; color: var(--ok); }
.status-demo { background: var(--accent-soft); color: var(--accent); }
.status-suspendu { background: #fdecea; color: var(--bad); }
.empty { color: var(--muted); }
.chart { margin: 0; }
.chart svg { width: 100%; height: 160px; display: block; fill: var(--accent); background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%; }
.chart rect:hover { fill: #142c98; }
.chart figcaption { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.gauge { margin-bottom: 16px; }
.gauge p { margin: 0 0 4px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gauge .bar { height: 10px; background: #ececea; border-radius: 99px; overflow: hidden; }
.gauge .bar span { display: block; height: 100%; min-width: 3px; background: var(--ok); border-radius: 99px; }
.gauge.warn .bar span { background: var(--warn); }
.gauge.bad .bar span { background: var(--bad); }
.changes { list-style: none; padding: 0; margin: 0; }
.changes li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form .hint { font-weight: 400; }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form legend { font-weight: 600; margin-bottom: 6px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid2 .full, .grid2 button { grid-column: 1 / -1; justify-self: start; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.choice { display: flex !important; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font-weight: 400 !important; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.credentials dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; }
.credentials dt { font-weight: 600; color: var(--muted); }
.credentials dd { margin: 0; }
@media (max-width: 860px) {
  .two, .grid2 { grid-template-columns: 1fr; }
  .owner-top { padding: 12px 16px; }
  .credentials dl { grid-template-columns: 1fr; gap: 2px; }
  .credentials dd { margin-bottom: 10px; }
}
.extras { list-style: none; padding: 0; margin: 0 0 18px; }
.extras li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.extras form { margin: 0; }
.extras label { font-weight: 400; display: inline-flex; gap: 4px; align-items: center; }
.help-tab h2 { margin-top: 1.4em; }
.help-tab ol, .help-tab ul { padding-left: 1.2em; }
.help-tab li { margin-bottom: .4em; }
