:root {
  --ink: #171213;
  --ink-soft: #41383a;
  --muted: #71676a;
  --line: #e6dcde;
  --line-strong: #cbbdc1;
  --paper: #fffdfb;
  --panel: #fff8f7;
  --mist: #edf8f7;
  --sea: #123f46;
  --sea-soft: #dcefed;
  --rose: #d33645;
  --rose-deep: #87202b;
  --green: #2f806b;
  --gold: #b47829;
  --shadow: 0 18px 42px rgba(23, 18, 19, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(237, 248, 247, 0.72), transparent 260px),
    var(--paper);
}

main {
  overflow-x: hidden;
}

body.isLocked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(211, 54, 69, 0.22);
  outline-offset: 2px;
}

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  border-bottom: 1px solid rgba(230, 220, 222, 0.9);
  padding: 12px clamp(14px, 3.8vw, 54px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: rgba(255, 253, 251, 0.95);
  backdrop-filter: blur(14px);
}

.brand {
  width: 150px;
  min-width: 122px;
}

.mainNav {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.mainNav button,
.ghostButton,
.primaryButton {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.mainNav button.isActive,
.primaryButton {
  color: #fff;
  border-color: var(--rose);
  background: var(--rose);
}

.primaryButton {
  width: 100%;
}

.ghostButton:hover,
.mainNav button:hover {
  border-color: var(--rose);
}

.headerStatus {
  display: flex;
  align-items: center;
  gap: 8px;
}

.headerStatus span,
.headerStatus strong,
.statusPill,
.smallPill {
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sea-soft);
  color: var(--sea);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.headerStatus strong {
  min-width: 30px;
  color: #fff;
  background: var(--ink);
}

.noticeBand {
  width: min(1240px, calc(100% - 28px));
  margin: 22px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px clamp(18px, 4vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    linear-gradient(90deg, rgba(255, 253, 251, 0.96), rgba(255, 253, 251, 0.86)),
    url("assets/brand-contours.png") right center / auto 160% no-repeat,
    var(--paper);
  box-shadow: 0 10px 26px rgba(23, 18, 19, 0.07);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.96;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.03;
}

h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
}

.noticeBand > p {
  max-width: 500px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.view {
  display: none;
  padding: 22px clamp(14px, 3.8vw, 54px) 54px;
  overflow-x: hidden;
}

.view.isActive {
  display: block;
}

.layout {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.layout.single {
  grid-template-columns: minmax(0, 820px);
}

.panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panelHeader {
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(180deg, #fff, var(--panel));
}

.panelHeader select {
  width: min(260px, 100%);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.productList,
.cartList,
.adminList,
.lookupResult,
.summaryTable {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.productItem,
.cartItem,
.adminItem,
.lookupCard,
.metric,
.summaryRow,
.clientCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.productItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 16px;
  align-items: center;
}

.itemTitle {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.itemTitle h3,
.cartItem h4,
.adminItem h4 {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.productMeta,
.adminMeta,
.lookupMeta {
  min-width: 0;
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.itemTitle strong,
.cartTop strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.productComment,
.emptyState,
.formError {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.productActions {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 8px;
}

.quantityRow {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(60px, 1fr) 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.quantityRow button {
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.quantityRow input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  font-weight: 900;
}

.addButton,
.deleteButton,
.editButton {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}

.deleteButton {
  color: var(--rose-deep);
  border: 1px solid var(--line);
  background: #fff;
}

.editButton {
  color: var(--sea);
  border: 1px solid var(--line);
  background: #fff;
}

.orderPanel {
  position: sticky;
  top: 96px;
}

.cartItem {
  display: grid;
  gap: 8px;
}

.cartTop,
.cartControls,
.orderTop,
.adminActions,
.summaryRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cartControls {
  justify-content: stretch;
}

.cartControls .quantityRow {
  flex: 1;
}

.totalLine {
  margin: 0 14px;
  border-top: 1px solid var(--line);
  padding: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 950;
}

.totalLine strong {
  color: var(--rose-deep);
  font-size: 24px;
}

.orderForm,
.lookupForm,
.adminForm,
.adminLogin {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.formGrid,
.adminForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.wideField {
  grid-column: 1 / -1;
}

.confirmationBox {
  margin: 0 14px 14px;
  border: 1px solid rgba(47, 128, 107, 0.42);
  border-radius: 8px;
  padding: 14px;
  background: #eefaf6;
  color: #185342;
  font-weight: 850;
  line-height: 1.45;
}

.lookupForm {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.adminLoginWrap {
  width: min(520px, 100%);
  margin: 0 auto;
}

.adminLogin {
  padding: 24px;
}

.formError {
  min-height: 20px;
  color: var(--rose-deep);
  font-weight: 850;
}

.adminShell {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.adminTop {
  margin-bottom: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.metrics {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  display: grid;
  gap: 5px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric strong {
  font-size: 28px;
  line-height: 1;
}

.adminGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.widePanel {
  grid-column: 1 / -1;
}

.adminItem {
  display: grid;
  gap: 10px;
}

.ordersList .adminItem {
  grid-template-columns: minmax(0, 1fr) 190px;
  align-items: start;
}

.orderLines {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.statusPill.en-cours {
  color: #754a10;
  background: #fff1da;
}

.statusPill.validee {
  color: #174d3f;
  background: #e8f8f4;
}

.statusPill.livree {
  color: #383d75;
  background: #eceeff;
}

.summaryTable {
  gap: 0;
}

.summaryRow {
  border-radius: 0;
  border-bottom: 0;
}

.summaryRow:first-child {
  border-radius: 8px 8px 0 0;
}

.summaryRow:last-child {
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  max-width: min(460px, calc(100% - 32px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.isVisible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1060px) {
  .siteHeader {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .mainNav,
  .headerStatus {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .layout,
  .adminGrid {
    grid-template-columns: 1fr;
  }

  .orderPanel {
    position: static;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .noticeBand,
  .panelHeader,
  .adminTop,
  .orderTop {
    align-items: flex-start;
    flex-direction: column;
  }

  .noticeBand {
    background:
      linear-gradient(180deg, rgba(255, 253, 251, 0.96), rgba(255, 253, 251, 0.9)),
      url("assets/brand-contours.png") right center / auto 120% no-repeat,
      var(--paper);
  }

  .productItem,
  .ordersList .adminItem,
  .lookupForm,
  .formGrid,
  .adminForm,
  .metrics {
    grid-template-columns: 1fr;
  }

  .itemTitle {
    flex-direction: column;
  }

  .mainNav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mainNav button {
    flex: 1 1 92px;
    min-width: 0;
    padding: 0 4px;
    font-size: 13px;
  }

  .brand {
    width: 128px;
  }
}

@media (max-width: 430px) {
  .siteHeader {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand {
    align-self: center;
  }

  .mainNav {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mainNav button {
    width: 100%;
  }

  .headerStatus {
    justify-content: center;
  }

  .view {
    padding-left: 10px;
    padding-right: 10px;
  }

  .noticeBand {
    width: calc(100% - 20px);
  }

  .cartTop,
  .cartControls,
  .adminActions {
    align-items: stretch;
    flex-direction: column;
  }

  .quantityRow {
    display: flex;
  }

  .quantityRow button {
    flex: 0 0 40px;
  }

  .quantityRow input {
    width: 0;
    flex: 1 1 auto;
  }
}
