/* Carnet Pressing — feuille de style partagée (espace pressing, admin, pages de connexion) */

:root{
  --bg:#F6F3EC;
  --surface:#FFFFFF;
  --surface-alt:#EDE8DC;
  --border:#DDD5C4;
  --ink:#22262A;
  --ink-muted:#6B6F74;
  --accent:#2E6E8E;
  --accent-strong:#20536D;
  --accent-ink:#FFFFFF;
  --success:#2E7D5B;
  --success-bg:#E3F1E9;
  --warning:#A8781F;
  --warning-bg:#F6ECD8;
  --danger:#B23A3A;
  --danger-bg:#F7E4E1;
  --shadow: 0 1px 2px rgba(30,26,18,0.06), 0 8px 24px rgba(30,26,18,0.08);
  --radius: 14px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#15181A; --surface:#1D2124; --surface-alt:#252A2D; --border:#33393D;
    --ink:#ECEBE6; --ink-muted:#9CA2A6; --accent:#6FB3D8; --accent-strong:#8FC5E3;
    --accent-ink:#0B1114; --success:#5FC79B; --success-bg:#1D3129;
    --warning:#E0B559; --warning-bg:#332A16; --danger:#E38080; --danger-bg:#3A2222;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  }
}
:root[data-theme="dark"]{
  --bg:#15181A; --surface:#1D2124; --surface-alt:#252A2D; --border:#33393D;
  --ink:#ECEBE6; --ink-muted:#9CA2A6; --accent:#6FB3D8; --accent-strong:#8FC5E3;
  --accent-ink:#0B1114; --success:#5FC79B; --success-bg:#1D3129;
  --warning:#E0B559; --warning-bg:#332A16; --danger:#E38080; --danger-bg:#3A2222;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg); color:var(--ink);
  font-family:"IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing:antialiased; min-height:100vh;
}
@media (prefers-reduced-motion: reduce){ *{animation-duration:.001ms !important; transition-duration:.001ms !important;} }

a{color:var(--accent);}

/* ---------- App shell (espace pressing) ---------- */
.app{ width:100%; max-width:480px; min-height:100vh; margin:0 auto; background:var(--surface); display:flex; flex-direction:column; box-shadow:var(--shadow); }

header.topbar{ position:sticky; top:0; z-index:20; display:flex; align-items:center; gap:10px; padding:14px 18px; background:var(--surface); border-bottom:1px solid var(--border); }
.brand-mark{ width:34px; height:34px; border-radius:9px; background:var(--accent); color:var(--accent-ink); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.brand-mark svg{ width:19px; height:19px; }
.brand-text{ display:flex; flex-direction:column; line-height:1.15; min-width:0; }
.brand-text .app-name{ font-family:"Fraunces", Georgia, serif; font-weight:600; font-size:17px; }
.brand-text .pressing-name{ font-size:12.5px; color:var(--ink-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .logout-link{ margin-left:auto; font-size:12.5px; color:var(--ink-muted); text-decoration:none; }

main.content{ flex:1; padding:16px 18px 96px; }

h1.view-title, h2.view-title{ font-family:"Fraunces", Georgia, serif; font-weight:600; font-size:20px; margin:2px 0 16px; text-wrap:balance; }

.stat-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:18px; }
.stat-card{ background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; }
.stat-card .stat-label{ font-size:11.5px; color:var(--ink-muted); text-transform:uppercase; letter-spacing:.06em; }
.stat-card .stat-value{ font-family:"IBM Plex Mono", ui-monospace, monospace; font-variant-numeric:tabular-nums; font-size:20px; font-weight:600; margin-top:3px; }

.section-label{ font-size:12px; text-transform:uppercase; letter-spacing:.07em; color:var(--ink-muted); margin:20px 0 8px; }
.section-label:first-child{ margin-top:0; }

.search-article{ margin-bottom:18px; }

.empty-state{ border:1px dashed var(--border); border-radius:var(--radius); padding:26px 18px; text-align:center; color:var(--ink-muted); font-size:14px; }

.banner{ background:var(--warning-bg); border:1px solid var(--warning); color:var(--warning); border-radius:12px; padding:11px 13px; font-size:13.5px; margin-bottom:16px; }
.banner a{ color:inherit; font-weight:600; }
.banner.banner-success{ background:var(--success-bg); border-color:var(--success); color:var(--success); }
.banner.banner-danger{ background:var(--danger-bg); border-color:var(--danger); color:var(--danger); }

.card-row{ display:flex; align-items:flex-start; gap:12px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:11px 12px; margin-bottom:8px; text-decoration:none; color:inherit; }
.card-row:hover{ border-color:var(--accent); }
.code-chip{ font-family:"IBM Plex Mono", monospace; font-weight:600; font-size:13px; background:var(--surface-alt); border:1px solid var(--border); border-radius:7px; padding:4px 7px; flex-shrink:0; margin-top:1px; }
.row-main{ flex:1; min-width:0; }
.row-name{ font-weight:600; font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.row-sub{ font-size:12.5px; color:var(--ink-muted); margin-top:2px; line-height:1.45; }
.row-end{ text-align:right; flex-shrink:0; min-width:74px; margin-top:1px; }
.row-total{ font-family:"IBM Plex Mono", monospace; font-weight:600; font-size:13.5px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.pill{ display:inline-block; font-size:10.5px; font-weight:600; letter-spacing:.03em; padding:2px 7px; border-radius:99px; margin-top:3px; }
.pill-ok{ background:var(--success-bg); color:var(--success); }
.pill-warn{ background:var(--warning-bg); color:var(--warning); }
.pill-danger{ background:var(--danger-bg); color:var(--danger); }

label.field{ display:block; margin-bottom:14px; }
label.field .field-label{ display:block; font-size:13px; font-weight:600; margin-bottom:5px; }
label.field .field-hint{ display:block; font-size:12px; color:var(--ink-muted); margin-top:4px; }
input[type="text"], input[type="tel"], input[type="number"], input[type="search"], input[type="password"], input[type="email"]{
  width:100%; font:inherit; font-size:15px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--ink);
}
input:focus-visible, button:focus-visible, a.card-row:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.field-error{ color:var(--danger); font-size:12.5px; margin-top:5px; }

.btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; font:inherit; font-weight:600; font-size:14.5px; cursor:pointer; border-radius:11px; border:1px solid transparent; padding:11px 16px; transition:filter .12s ease; text-decoration:none; touch-action:manipulation; }
.btn:active{ filter:brightness(.95); }
.btn-primary{ background:var(--accent); color:var(--accent-ink); }
.btn-primary:disabled{ opacity:.4; cursor:not-allowed; }
.btn-ghost{ background:transparent; border-color:var(--border); color:var(--ink); }
.btn-success{ background:var(--success); color:#fff; }
.btn-danger-text{ background:none; border:none; color:var(--danger); font-size:13px; font-weight:500; cursor:pointer; padding:6px 2px; text-decoration:underline; }
.btn-block{ width:100%; }

.cat-row{ background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius); padding:13px 14px; margin-bottom:10px; }
.cat-row .cat-name{ font-weight:600; font-size:14.5px; margin-bottom:9px; }
.service-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.service-col .service-label{ font-size:11.5px; color:var(--ink-muted); margin-bottom:5px; }
.stepper{ display:flex; align-items:center; gap:6px; }
.stepper button{ width:32px; height:32px; border-radius:8px; border:1px solid var(--border); background:var(--surface-alt); color:var(--ink); font-size:17px; font-weight:600; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; touch-action:manipulation; user-select:none; -webkit-user-select:none; }
.stepper input[type="number"]{ flex:1; text-align:center; font-family:"IBM Plex Mono", monospace; font-weight:600; font-size:15px; padding:6px 4px; }

/* ---------- Écran de dépôt : une carte par article, un seul service affiché ---------- */
.cat-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.cat-head .cat-name{ margin-bottom:0; }

.service-toggle{ display:inline-flex; background:var(--surface); border:1px solid var(--border); border-radius:99px; padding:2px; flex-shrink:0; }
.service-opt{ border:none; background:none; font:inherit; font-size:11.5px; font-weight:600; color:var(--ink-muted); padding:6px 13px; border-radius:99px; cursor:pointer; touch-action:manipulation; white-space:nowrap; transition:background .15s ease, color .15s ease; }
.service-opt.is-active{ background:var(--accent); color:var(--accent-ink); }

.cat-price{ font-size:12.5px; color:var(--ink-muted); margin-bottom:11px; font-variant-numeric:tabular-nums; }
.autre-service-note{ font-size:11.5px; color:var(--ink-muted); margin-top:10px; font-style:italic; }

.qty-input-solo{
  display:block; width:100%; text-align:center; font-family:"IBM Plex Mono", monospace; font-weight:700; font-size:20px;
  border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--ink);
  padding:11px 4px; height:46px;
}
.qty-input-solo:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }

.sticky-footer{ position:sticky; bottom:0; background:var(--surface); border-top:1px solid var(--border); padding:12px 18px calc(12px + env(safe-area-inset-bottom)); display:flex; align-items:center; gap:12px; }
.sticky-footer[hidden]{ display:none; }
.sticky-footer .total-block{ flex:1; min-width:0; }
.sticky-footer .total-label{ font-size:11px; color:var(--ink-muted); text-transform:uppercase; letter-spacing:.06em; }
.sticky-footer .total-value{ font-family:"IBM Plex Mono", monospace; font-weight:600; font-size:18px; font-variant-numeric:tabular-nums; }

nav.tabbar{ display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--border); background:var(--surface); position:sticky; bottom:0; z-index:20; padding-bottom:env(safe-area-inset-bottom); }
nav.tabbar a{ background:none; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:3px; padding:9px 4px 8px; color:var(--ink-muted); font-size:10.5px; text-decoration:none; }
nav.tabbar a svg{ width:20px; height:20px; }
nav.tabbar a.active{ color:var(--accent); }

.receipt{ border:1px solid var(--border); border-radius:14px; overflow:hidden; margin-bottom:16px; }
.receipt-top{ background:var(--accent); color:var(--accent-ink); padding:16px 18px; text-align:center; }
.receipt-top .r-code{ font-family:"IBM Plex Mono", monospace; font-size:26px; font-weight:600; }
.receipt-top .r-caption{ font-size:11.5px; opacity:.85; margin-top:2px; text-transform:uppercase; letter-spacing:.06em; }
.receipt-body{ padding:14px 18px; border-top:1px dashed var(--border); background:var(--surface); }
.receipt-line{ display:flex; justify-content:space-between; gap:10px; font-family:"IBM Plex Mono", monospace; font-size:13px; padding:5px 0; border-bottom:1px dashed var(--border); }
.receipt-line:last-of-type{ border-bottom:none; }
.receipt-total{ display:flex; justify-content:space-between; padding:12px 18px; border-top:1px dashed var(--border); font-weight:600; font-size:15.5px; font-family:"IBM Plex Mono", monospace; }
.receipt-note{ font-size:12.5px; color:var(--ink-muted); line-height:1.5; margin-bottom:16px; }

.detail-row{ display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid var(--border); font-size:14px; }
.detail-row:last-of-type{ border-bottom:none; }
.btn-row{ display:flex; gap:10px; margin-top:16px; }
.btn-row .btn{ flex:1; }
.add-cat-row{ display:flex; gap:8px; margin-top:6px; }
.add-cat-row input{ flex:1; }

/* ---------- Guest pages (inscription / connexion) ---------- */
.guest-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px 18px; }
.guest-card{ width:100%; max-width:400px; background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:28px 26px; box-shadow:var(--shadow); }
.guest-card .guest-brand{ display:flex; align-items:center; gap:10px; margin-bottom:22px; }
.guest-card .guest-brand .brand-mark{ width:38px; height:38px; }
.guest-card .guest-brand span{ font-family:"Fraunces", Georgia, serif; font-weight:600; font-size:19px; }
.guest-card h1{ font-family:"Fraunces", Georgia, serif; font-weight:600; font-size:21px; margin:0 0 6px; }
.guest-card p.subtitle{ color:var(--ink-muted); font-size:14px; margin:0 0 22px; line-height:1.5; }
.guest-card .switch-link{ text-align:center; font-size:13.5px; color:var(--ink-muted); margin-top:16px; }

/* ---------- Admin ---------- */
.admin-wrap{ max-width:920px; margin:0 auto; padding:28px 20px 60px; }
.admin-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.admin-header h1{ font-family:"Fraunces", Georgia, serif; font-size:22px; margin:0; }
table.admin-table{ width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
table.admin-table th, table.admin-table td{ text-align:left; padding:11px 14px; border-bottom:1px solid var(--border); font-size:13.5px; }
table.admin-table th{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-muted); background:var(--surface-alt); }
table.admin-table tr:last-child td{ border-bottom:none; }
.admin-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.admin-actions form{ display:inline; }
.table-scroll{ overflow-x:auto; }

/* ---------- Bienvenue / install PWA ---------- */
.install-steps{ list-style:none; padding:0; margin:0 0 20px; display:flex; flex-direction:column; gap:10px; }
.install-steps li{ display:flex; gap:10px; align-items:flex-start; background:var(--surface-alt); border:1px solid var(--border); border-radius:12px; padding:11px 13px; font-size:13.5px; }
.install-steps li .step-num{ font-family:"IBM Plex Mono", monospace; font-weight:600; color:var(--accent); flex-shrink:0; }