/* NIZA FOOD — mockup site web eShop + admin
   Design tokens repris du mockup eShop existant (.planning/mockups-eshop-guest). */

:root {
  --niza: #0b4a8b;
  --niza-2: #1463b0;
  --niza-soft: #eaf2fb;
  --surface: #f5f7fa;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Top strip ---------- */
.strip {
  background: var(--niza);
  color: #cfe0ff;
  font-size: 12.5px;
  letter-spacing: .2px;
}
.strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}
.strip b { color: #fff; }
.strip .dot { color: #7fd1ae; }

/* ---------- Header ---------- */
.head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.head .container {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(145deg, var(--niza-2), var(--niza));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; letter-spacing: .5px; font-size: 15px;
}
.brand-txt strong { display: block; font-size: 16px; letter-spacing: .4px; }
.brand-txt span { display: block; font-size: 11px; color: var(--muted); }

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  min-width: 0;
}
.search input {
  border: 0; background: transparent; outline: none;
  width: 100%; font-size: 14px; color: var(--ink);
}
.search span { color: var(--muted); font-size: 15px; }

.head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 17px;
  color: var(--niza);
}
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--niza); color: #fff;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid #fff;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--niza); color: #fff; }
.btn-primary:hover { background: var(--niza-2); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #c7d2e3; }
.btn-soft { background: var(--niza-soft); color: var(--niza); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Nav ---------- */
.nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.nav .container {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 0 0 9px;
  scrollbar-width: none;
}
.nav .container::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.nav a.on { background: var(--niza-soft); color: var(--niza); }
.nav a:hover { color: var(--niza); }

/* ---------- Hero ---------- */
.hero {
  margin-top: 22px;
  border-radius: 22px;
  background:
    radial-gradient(900px 380px at 88% -10%, rgba(127, 209, 174, .22), transparent 60%),
    linear-gradient(135deg, #0b4a8b 0%, #1463b0 58%, #1a74c9 100%);
  color: #fff;
  padding: 34px 36px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 28px;
  align-items: center;
  overflow: hidden;
}
.hero .kicker {
  font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  color: #9fc6f5; font-weight: 700; margin-bottom: 10px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(25px, 3.1vw, 38px);
  line-height: 1.13;
  letter-spacing: -.4px;
}
.hero p { margin: 0 0 20px; color: #d3e4fb; font-size: 15px; max-width: 46ch; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-light { background: #fff; color: var(--niza); }
.hero .btn-outline { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.35); color: #fff; }
.hero-facts { display: flex; gap: 22px; margin-top: 24px; flex-wrap: wrap; }
.hero-facts div strong { display: block; font-size: 19px; }
.hero-facts div span { font-size: 12px; color: #9fc6f5; }

.hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-tile {
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(3px);
}
.hero-tile .em { font-size: 26px; }
.hero-tile b { display: block; margin-top: 8px; font-size: 14px; }
.hero-tile span { font-size: 11.5px; color: #c3daf7; }

/* ---------- Section ---------- */
.section { margin-top: 30px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.2px; }
.section-head a { font-size: 13.5px; color: var(--niza); font-weight: 600; }

/* ---------- Categories ---------- */
.cats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; transition: .15s ease;
}
.cat:hover { border-color: #bcd2ee; transform: translateY(-2px); box-shadow: var(--shadow); }
.cat .em { font-size: 24px; }
.cat b { display: block; margin-top: 6px; font-size: 13px; }
.cat span { font-size: 11px; color: var(--muted); }

/* ---------- Products ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: .15s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: #cfe0f5; transform: translateY(-2px); }
.thumb {
  height: 128px;
  display: grid; place-items: center;
  font-size: 44px;
  background: linear-gradient(160deg, #f1f6fd, #e4eefb);
}
.thumb.c2 { background: linear-gradient(160deg, #fdf5ec, #f8e8d6); }
.thumb.c3 { background: linear-gradient(160deg, #eefaf3, #ddf3e6); }
.thumb.c4 { background: linear-gradient(160deg, #f5f1fd, #ebe2fb); }
.card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; flex: 1; }
.card-body .name { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.card-body .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card-body .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; }
.price { font-size: 16px; font-weight: 700; color: var(--niza); }
.price small { font-size: 11px; color: var(--muted); font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.mut { background: var(--surface); color: var(--muted); }

/* ---------- Fiche produit ---------- */
.crumbs { font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.crumbs a { color: var(--niza); }
.product { display: grid; grid-template-columns: 1.05fr 1fr; gap: 26px; margin-top: 16px; align-items: start; }
.product-visual {
  border-radius: 20px; min-height: 380px; display: grid; place-items: center;
  font-size: 120px; background: linear-gradient(160deg, #f1f6fd, #dfeafb); border: 1px solid var(--line);
}
.product-info h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.3px; }
.product-info .sku { font-size: 12px; color: var(--muted); }
.product-price { margin: 18px 0; display: flex; align-items: baseline; gap: 10px; }
.product-price .big { font-size: 30px; font-weight: 800; color: var(--niza); }
.product-price span { font-size: 13px; color: var(--muted); }
.stock-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.note {
  background: var(--niza-soft); border: 1px solid #d3e4fb; color: #1e4a7d;
  border-radius: 12px; padding: 11px 13px; font-size: 12.5px; line-height: 1.5;
}
.buy-row { display: flex; gap: 10px; align-items: center; margin: 18px 0 14px; flex-wrap: wrap; }
.qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
}
.qty button { width: 38px; height: 40px; border: 0; background: #fff; font-size: 17px; color: var(--niza); }
.qty button:hover { background: var(--niza-soft); }
.qty input { width: 56px; height: 40px; border: 0; text-align: center; font-size: 15px; font-weight: 600; outline: none; }
.specs { margin-top: 22px; border-top: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.specs span { color: var(--muted); }

/* ---------- Panier ---------- */
.cart-wrap { display: grid; grid-template-columns: 1.5fr .8fr; gap: 20px; align-items: start; margin-top: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.panel-body { padding: 18px; }
.line { display: grid; grid-template-columns: 58px 1fr auto; gap: 13px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .mini { width: 58px; height: 58px; border-radius: 11px; background: linear-gradient(160deg, #f1f6fd, #e4eefb); display: grid; place-items: center; font-size: 24px; }
.line .nm { font-size: 14px; font-weight: 600; }
.line .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.line .end { text-align: right; }
.line .end b { display: block; font-size: 14.5px; color: var(--niza); }
.line .rm { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 4px 0; }
.line .rm:hover { color: var(--bad); }
.sum { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; }
.sum.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 17px; font-weight: 700; }
.sum.total span:last-child { color: var(--niza); }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); font-size: 14px; }

/* ---------- Login ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 880px; margin: 40px auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.auth-side { background: linear-gradient(150deg, #0b4a8b, #1463b0); color: #fff; padding: 38px 32px; }
.auth-side h2 { margin: 0 0 10px; font-size: 24px; }
.auth-side p { color: #cfe0ff; font-size: 13.5px; line-height: 1.6; }
.auth-side ul { margin: 20px 0 0; padding: 0; list-style: none; }
.auth-side li { display: flex; gap: 9px; font-size: 13px; margin-bottom: 11px; color: #e3eeff; }
.auth-form { padding: 38px 32px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; outline: none; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--niza-2); box-shadow: 0 0 0 3px rgba(20,99,176,.12); }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- Footer ---------- */
.foot { margin-top: 46px; background: #fff; border-top: 1px solid var(--line); }
.foot .container { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.foot b { color: var(--ink); }

/* =========================================================
   ADMIN
   ========================================================= */
.admin-body { background: #f1f5f9; }
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.side {
  background: #0b1f38;
  color: #cbd8ea;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.side .brand { color: #fff; padding: 4px 6px 16px; }
.side .brand-txt span { color: #8aa4c4; }
.side .group { font-size: 10.5px; letter-spacing: 1.3px; text-transform: uppercase; color: #6e88a8; padding: 16px 10px 6px; }
.side a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: #cbd8ea;
}
.side a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.on { background: var(--niza-2); color: #fff; font-weight: 600; }
.side .em { width: 18px; text-align: center; }
.side .bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }

.admin-main { padding: 22px 26px 40px; min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-top h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.admin-top p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--niza); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

.toolbar {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 18px;
}
.toolbar .field { margin: 0; min-width: 170px; }
.toolbar .spacer { flex: 1; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.on { color: var(--niza); border-bottom-color: var(--niza); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; }
.kpi .lbl { font-size: 12px; color: var(--muted); }
.kpi .val { font-size: 23px; font-weight: 800; letter-spacing: -.6px; margin-top: 6px; }
.kpi .val small { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi .delta { font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.up { color: var(--ok); }
.down { color: var(--bad); }

.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tbl-head b { font-size: 14.5px; }
.tbl-head span { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: #fafcfe; font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fafcff; }
tfoot td { font-weight: 700; background: #fafcfe; }

.chart { display: flex; align-items: flex-end; gap: 7px; height: 150px; padding: 18px 16px 0; }
.chart .bar { flex: 1; background: linear-gradient(180deg, #4f97e0, var(--niza)); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.chart .bar span { position: absolute; bottom: -19px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.chart-legend { padding: 26px 16px 14px; font-size: 11.5px; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; overflow-x: auto; }
  .side .brand { padding: 0 10px 0 0; }
  .side .group, .side .bottom { display: none; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .hero-art { display: none; }
  .product { grid-template-columns: 1fr; }
  .product-visual { min-height: 230px; font-size: 80px; }
  .cart-wrap, .two-col, .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 24px); }
  .head .container { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .brand-txt span { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .thumb { height: 104px; font-size: 34px; }
  .cats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat { padding: 12px 6px; }
  .admin-main { padding: 16px 12px 32px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi .val { font-size: 19px; }
  th, td { padding: 9px 11px; }
  .strip .container { font-size: 11.5px; }
  .hero-facts { gap: 16px; }
}
