:root {
  --paper: #e9d3b3;
  --red: #d80100;
  --ink: #111;
  --muted: #665f56;
  --white: #fff;
  --font-title: "Dosis", Arial, sans-serif;
  --font-body: "Roboto Slab", Georgia, serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    url("../img/site/Secteur-42-5.png") center top / 100% auto no-repeat,
    var(--paper);
  font-family: var(--font-body);
}

button,
input {
  font: inherit;
}

input[type="file"] {
  border-style: dashed;
  background: #fff;
}

.image-upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.image-upload-row button {
  padding: 10px 13px;
  font-size: 1rem;
}

.admin-shell {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 76px 0;
}

.admin-login,
.admin-dashboard {
  border: 8px solid var(--white);
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 22px 58px rgba(54, 35, 16, .18);
}

.admin-login {
  display: grid;
  grid-template-columns: 220px 1fr 340px;
  gap: 32px;
  align-items: center;
  padding: 34px;
}

.admin-login img {
  width: 220px;
  height: auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--font-title);
  font-size: clamp(3.3rem, 6vw, 5.5rem);
  line-height: .9;
}

p {
  color: var(--muted);
  font-weight: 700;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
}

input {
  width: 100%;
  border: 2px solid #c7ad83;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fffaf2;
}

.check-label {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}

.check-label input {
  width: 22px;
  height: 22px;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 13px 18px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
}

.form-status {
  min-height: 1.5em;
  margin: 0;
}

.admin-dashboard {
  padding: 34px;
}

.admin-dashboard header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-grid article {
  padding: 20px;
  border-radius: 18px;
  background: #fffaf2;
}

.dashboard-grid strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.8rem;
  line-height: 1;
}

.dashboard-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.admin-tabs button {
  background: #fffaf2;
  color: var(--ink);
}

.admin-tabs button.is-active {
  background: var(--red);
  color: var(--white);
}

.admin-module {
  margin-top: 22px;
}

.module-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.module-heading h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: .9;
}

.module-note {
  max-width: 760px;
  margin: 10px 0 0;
  color: #60594f;
  font-size: .98rem;
  line-height: 1.45;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
  padding: 22px;
  border-radius: 20px;
  background: #fffaf2;
}

.admin-form[hidden] {
  display: none;
}

.admin-form-event {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(199, 173, 131, .4);
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,250,242,.96)),
    #fffaf2;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .74), 0 20px 42px rgba(72, 48, 20, .08);
}

.admin-form-event::before {
  content: "Configuration de l'activité";
  grid-column: 1 / -1;
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 800;
  line-height: .95;
}

.admin-form-event > label,
.admin-form-event .seating-actions,
.admin-form-event .ticket-builder {
  min-width: 0;
}

.admin-form-event > label {
  grid-column: span 2;
  min-height: 100%;
  border: 1px solid rgba(199, 173, 131, .36);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 22px rgba(72, 48, 20, .045);
}

.admin-form-event .activity-title-field {
  grid-column: span 4;
}

.admin-form-event .activity-type-field {
  grid-column: span 2;
}

.admin-form-event .activity-type-field select {
  min-height: 58px;
  border-color: var(--red);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
}

.admin-hidden-field {
  display: none;
}

.account-admin-row > div:first-child {
  min-width: 0;
}

.account-linked-members {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.account-member-link {
  padding: 7px 10px;
  border: 1px solid #d8c5a7;
  border-radius: 6px;
  background: #fffaf2;
  color: var(--ink);
  font-family: inherit;
  font-size: .88rem;
}

.admin-form-event:not(:has(input[name="requires_registration"]:checked)) .ticket-builder,
.admin-form-event:not(:has(input[name="has_seating"]:checked)) label:has(select[name="seating_layout_id"]),
.admin-form-event:not(:has(input[name="has_seating"]:checked)) .seating-price-config,
.admin-form-event:not(:has(input[name="has_seating"]:checked)) .seating-create-field,
.admin-form-event:not(:has(input[name="has_seating"]:checked)) .seating-actions {
  display: none;
}

.ticket-options-raw {
  display: none;
}

.ticket-builder,
.seating-actions {
  grid-column: 1 / -1;
  border: 2px solid #ead8bd;
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,250,242,.98)),
    #fff;
  box-shadow: 0 18px 36px rgba(72, 48, 20, .07);
}

.image-upload-row {
  grid-column: 1 / -1;
  border: 1px dashed rgba(199, 173, 131, .8);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, .72);
}

.check-label {
  min-height: 58px;
  border: 2px solid #ead8bd;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.check-label:has(input:checked) {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(216, 1, 0, .08);
}

.ticket-builder-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.ticket-builder-head strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.55rem;
  line-height: 1;
}

.ticket-builder-head span,
.form-help {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
}

.ticket-builder-head button,
.seating-actions button {
  padding: 10px 13px;
  font-size: 1rem;
}

.ticket-rows {
  display: grid;
  gap: 10px;
}

.ticket-row {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(230px, 1.5fr) minmax(110px, .55fr) minmax(110px, .55fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 14px;
  background: #fffaf2;
}

.seating-price-config {
  display: grid;
  grid-template-columns: minmax(180px, .45fr) minmax(280px, 1fr);
  gap: 12px;
  border: 2px solid rgba(194, 49, 31, .25);
  border-radius: 16px;
  padding: 14px;
  background: rgba(194, 49, 31, .05);
}

.button-secondary {
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.ticket-row label {
  font-size: 1rem;
}

.ticket-row button {
  padding: 10px 12px;
  background: #1f1f1f;
  font-size: .95rem;
}

.seating-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.seating-builder-head,
.seating-builder-fields,
.seat-plan-tools {
  display: grid;
  gap: 12px;
}

.seating-builder-head {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.seating-builder-head strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.65rem;
  line-height: 1;
}

.seating-builder-head span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 700;
}

.seating-builder-fields {
  grid-template-columns: minmax(180px, .7fr) minmax(260px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
}

.seat-plan-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.seat-plan-reference {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 10px 14px;
  border-left: 4px solid var(--red);
  background: #fffaf2;
  color: var(--muted);
}

.seat-plan-reference strong {
  color: var(--ink);
}

.seat-plan-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  border: 3px dashed #c7ad83;
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(199,173,131,.15) 25%, transparent 25%, transparent 75%, rgba(199,173,131,.15) 75%),
    linear-gradient(45deg, rgba(199,173,131,.15) 25%, transparent 25%, transparent 75%, rgba(199,173,131,.15) 75%),
    #fffaf2;
  background-position: 0 0, 14px 14px;
  background-size: 28px 28px;
}

.seat-plan-canvas.has-background {
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.seat-bubble {
  position: absolute;
  display: grid;
  place-items: center;
  width: var(--seat-bubble-size, 28px);
  height: var(--seat-bubble-size, 28px);
  box-sizing: border-box;
  border: 2px solid var(--white);
  border-radius: 50%;
  padding: 0 !important;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-title);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-indent: 0;
  box-shadow: 0 5px 12px rgba(0,0,0,.24);
  transform: translate(-50%, -50%);
  cursor: grab;
  user-select: none;
}

.seat-bubble.is-selected {
  background: #17afd2;
  box-shadow: 0 0 0 5px rgba(23,175,210,.22), 0 14px 28px rgba(0,0,0,.24);
}

.seat-plan-tools {
  border-radius: 16px;
  padding: 14px;
  background: #fffaf2;
}

.seat-plan-tool-row,
.seat-group-tools {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}

.seat-plan-tool-row strong {
  align-self: center;
  color: var(--muted);
  font-size: .95rem;
}

.seat-plan-alignment-tools {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.seat-group-tools {
  grid-template-columns: minmax(200px, 1.2fr) auto minmax(200px, 1.2fr) auto auto;
  padding-top: 12px;
  border-top: 1px solid rgba(109, 101, 89, .2);
}

.seat-plan-tools button.is-active {
  background: #17afd2;
  color: var(--white);
}

.seat-plan-tools .button-danger {
  background: #292929;
}

.seat-plan-tools button {
  padding: 10px 12px;
  font-size: .95rem;
}

.seat-size-control span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
}

.seat-size-control input {
  width: 100%;
}

.seat-size-control output {
  font-weight: 900;
  text-align: right;
}

@media (max-width: 1100px) {
  .seat-plan-tool-row,
  .seat-plan-alignment-tools,
  .seat-group-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.compact-form {
  background: #f4e4c9;
}

.admin-form .wide,
.form-actions {
  grid-column: 1 / -1;
}

select,
textarea {
  width: 100%;
  border: 2px solid #c7ad83;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  font: inherit;
}

.native-search-select {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.search-select {
  position: relative;
  width: 100%;
}

.search-select input {
  width: 100%;
  padding-right: 42px;
  background:
    linear-gradient(45deg, transparent 50%, #60594f 50%) right 17px center / 8px 8px no-repeat,
    linear-gradient(135deg, #60594f 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
    #fff;
}

.search-select-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(21, 21, 21, .14);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(30, 20, 10, .16);
}

.search-select-panel button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .94rem;
  font-weight: 800;
  text-align: left;
}

.search-select-panel button:hover,
.search-select-panel button.is-keyboard,
.search-select-panel button.is-selected {
  background: #f2e3cb;
}

.search-select-panel button.is-selected {
  color: var(--red);
}

.search-select-empty {
  padding: 12px;
  color: var(--muted);
  font-weight: 800;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
  margin: 6px 0 12px;
}

.admin-list-heading strong {
  font-family: var(--font-title);
  font-size: 1.5rem;
}

.admin-list-heading span {
  color: var(--muted);
  font-weight: 700;
}

.admin-list-tools {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(21, 21, 21, .08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(30, 20, 10, .045);
}

.admin-list-tools label {
  width: min(100%, 440px);
}

.admin-list-tools input[type="search"] {
  min-height: 44px;
}

.admin-pagination {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-pagination span {
  color: #60594f;
  font-size: .92rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-pagination button {
  padding: 10px 14px;
  border-radius: 12px;
}

.admin-pagination button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background: #fffaf2;
}

.admin-row h3 {
  margin: 0 0 6px;
  font-family: var(--font-title);
  font-size: 1.55rem;
  line-height: 1;
}

.admin-row p {
  margin: 0;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-row-actions button {
  padding: 9px 12px;
  font-size: 1rem;
}

.admin-row-link,
.admin-export-link {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: var(--red);
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.pos-form {
  align-items: start;
}

.pos-panel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 2px solid rgba(199, 173, 131, .55);
  border-radius: 18px;
  background: #fffaf2;
}

.pos-panel > strong {
  grid-column: 1 / -1;
  font-family: var(--font-title);
  font-size: 1.35rem;
  color: var(--red);
}

.pos-quick-member {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pos-ticket-list {
  display: grid;
  gap: 10px;
}

.pos-ticket-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}

.pos-ticket-row strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.15rem;
}

.pos-ticket-row span {
  color: var(--muted);
  font-weight: 700;
}

.pos-ticket-controls {
  display: grid;
  grid-template-columns: 38px 44px 38px;
  gap: 6px;
  align-items: center;
}

.pos-ticket-controls button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
}

.pos-ticket-controls output {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 10px;
  background: #f4e4c9;
  font-family: var(--font-title);
  font-weight: 900;
}

.pos-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--white);
}

.pos-summary span,
.pos-summary strong {
  font-family: var(--font-title);
}

.pos-summary strong {
  font-size: 2rem;
}

.pos-payment-qr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 2px solid rgba(199, 173, 131, .45);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(0,0,0,.08);
}

.pos-payment-qr[hidden] {
  display: none;
}

.pos-payment-qr strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-title);
  font-size: 1.4rem;
}

.pos-payment-qr span,
.pos-payment-qr p {
  display: block;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.pos-payment-qr canvas {
  width: 156px;
  height: 156px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.attendance-scan-panel {
  display: grid;
  gap: 16px;
  margin: 18px 0 22px;
  padding: 20px;
  border: 2px solid rgba(199, 173, 131, .55);
  border-radius: 22px;
  background: #fffaf2;
  box-shadow: 0 18px 44px rgba(38, 27, 16, .08);
}

.attendance-scan-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.attendance-scan-heading h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.attendance-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.attendance-scan-reader {
  overflow: hidden;
  width: min(100%, 560px);
  min-height: 310px;
  margin: 0 auto;
  border: 5px solid #fff;
  border-radius: 20px;
  background: #171412;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.2);
}

.attendance-scan-reader video {
  object-fit: cover;
}

.attendance-manual-scan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.attendance-manual-scan label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.attendance-scan-result {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 22px;
  color: #fff;
}

.attendance-scan-result[data-state="valid"] {
  background: linear-gradient(135deg, #15834f, #2fac72);
  box-shadow: 0 18px 38px rgba(21, 131, 79, .26);
}

.attendance-scan-result[data-state="invalid"] {
  background: linear-gradient(135deg, #b82317, #e44735);
  box-shadow: 0 18px 38px rgba(184, 35, 23, .24);
}

.attendance-scan-result strong,
.attendance-scan-result h3,
.attendance-scan-result p {
  margin: 0;
}

.attendance-scan-result strong {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 5vw, 2.3rem);
}

.attendance-scan-result h3 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  line-height: .95;
}

.attendance-scan-result p {
  font-size: 1rem;
  font-weight: 800;
}

.pos-success-row {
  border: 2px solid rgba(33, 148, 91, .25);
  background: #f2fff8;
}

.pos-ledger {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(0,0,0,.08);
}

.pos-ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.pos-ledger-head h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 2rem;
}

.pos-export-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.pos-export-form label {
  display: grid;
  gap: 5px;
  font-size: .95rem;
}

.pos-export-form input {
  min-width: 150px;
}

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

.pos-stats article {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 16px;
  background: #f4e4c9;
}

.pos-stats strong,
.pos-stats span {
  font-family: var(--font-title);
}

.pos-stats strong {
  font-size: 2rem;
}

.pos-stats small {
  color: var(--muted);
  font-weight: 800;
}

.pos-sale-row {
  border-left: 5px solid var(--red);
}

@media (max-width: 900px) {
  .admin-login {
    grid-template-columns: 1fr;
  }

  .admin-login img {
    width: 170px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-form,
  .admin-form-event,
  .ticket-row,
  .seating-price-config,
  .seating-builder-head,
  .seating-builder-fields,
  .seat-plan-editor,
  .seating-actions,
  .pos-panel,
  .pos-quick-member,
  .pos-payment-qr {
    grid-template-columns: 1fr;
  }

  .pos-payment-qr canvas {
    justify-self: start;
  }

  .attendance-scan-heading,
  .attendance-manual-scan {
    grid-template-columns: 1fr;
  }

  .attendance-scan-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .attendance-scan-actions button,
  .attendance-manual-scan button {
    width: 100%;
  }

  .attendance-scan-reader {
    min-height: 260px;
  }

  .admin-form-event > label,
  .admin-form-event .activity-title-field,
  .admin-form-event .activity-type-field {
    grid-column: 1 / -1;
  }

  .pos-ledger-head,
  .pos-export-form,
  .admin-list-tools {
    display: grid;
  }

  .pos-stats {
    grid-template-columns: 1fr;
  }
}

/* Interface admin professionnelle */
body {
  background: #f5f1e9;
}

.admin-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.admin-login {
  width: min(100% - 40px, 1180px);
  margin: 64px auto;
}

.admin-app {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 18px;
  overflow-y: auto;
  background: #151515;
  color: #fff;
  box-shadow: 18px 0 42px rgba(30, 20, 10, .12);
}

.admin-brand {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .13);
}

.admin-brand img {
  width: 58px;
  height: auto;
}

.admin-brand strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.45rem;
  line-height: 1;
}

.admin-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .66);
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-workspace {
  min-width: 0;
  padding: 28px clamp(22px, 4vw, 48px) 54px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin: -28px calc(clamp(22px, 4vw, 48px) * -1) 28px;
  padding: 22px clamp(22px, 4vw, 48px);
  border-bottom: 1px solid rgba(21, 21, 21, .08);
  background: rgba(245, 241, 233, .94);
  backdrop-filter: blur(18px);
}

.admin-topbar h1 {
  margin: 0;
  font-size: clamp(2.15rem, 3vw, 3.35rem);
  line-height: .95;
}

.admin-topbar .eyebrow {
  margin-bottom: 5px;
  color: #8f281d;
}

.admin-topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-topbar-actions a,
.admin-topbar-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
}

.admin-topbar-actions a {
  border: 2px solid rgba(21, 21, 21, .16);
  background: #fff;
  color: var(--ink);
}

.admin-topbar-actions button {
  background: #151515;
  color: #fff;
}

.admin-tabs {
  display: grid;
  gap: 18px;
  margin: 22px 0 0;
}

.admin-nav-group {
  display: grid;
  gap: 6px;
}

.admin-nav-group > span {
  padding: 0 10px;
  color: rgba(255, 255, 255, .42);
  font-family: var(--font-title);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.admin-tabs button {
  position: relative;
  justify-content: start;
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  padding: 11px 12px 11px 42px;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  font-size: 1.03rem;
  text-align: left;
}

.admin-tabs button::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: .72;
}

.admin-tabs button:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.admin-tabs button.is-active {
  background: #c92d20;
  color: #fff;
  box-shadow: 0 12px 26px rgba(216, 1, 0, .28);
}

.admin-tabs button.is-active::before {
  background: currentColor;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.dashboard-grid article,
.admin-module,
.admin-form,
.compact-form,
.pos-ledger {
  border: 1px solid rgba(21, 21, 21, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 45px rgba(30, 20, 10, .08);
}

.dashboard-grid article {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.dashboard-grid article::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(201, 45, 32, .09);
}

.dashboard-grid strong {
  font-size: 2.1rem;
}

.dashboard-grid span {
  margin-top: 6px;
  font-size: .95rem;
}

.admin-module {
  margin-top: 0;
  padding: 22px;
}

.module-heading {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(21, 21, 21, .08);
}

.module-heading h2 {
  font-size: clamp(2rem, 3vw, 3.05rem);
}

.module-heading button,
.form-actions button,
.admin-row-actions button,
.admin-export-link,
.admin-row-link {
  border-radius: 12px;
}

.admin-form,
.admin-form-event {
  border-radius: 18px;
  box-shadow: none;
}

.admin-form {
  background: #fbf8f1;
}

.admin-form-event {
  border-color: rgba(21, 21, 21, .08);
}

label {
  color: #2a2723;
  font-size: 1rem;
}

input,
select,
textarea {
  border-color: rgba(21, 21, 21, .16);
  border-radius: 12px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: #c92d20;
  box-shadow: 0 0 0 4px rgba(201, 45, 32, .11);
}

.admin-row {
  border: 1px solid rgba(21, 21, 21, .07);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(30, 20, 10, .045);
}

.admin-row h3 {
  font-size: 1.35rem;
}

.admin-row p {
  color: #60594f;
  font-size: .95rem;
}

.admin-list-heading {
  padding: 4px 0 12px;
  border-bottom: 1px solid rgba(21, 21, 21, .08);
}

.ticket-builder,
.seating-actions,
.pos-panel {
  border-color: rgba(21, 21, 21, .08);
  background: #fff;
}

.pos-panel {
  box-shadow: inset 4px 0 0 rgba(201, 45, 32, .18);
}

.pos-ledger {
  background: #fff;
}

.pos-stats article {
  background: #f2e3cb;
}

.site-texts-form {
  grid-template-columns: 1fr;
}

.site-texts-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
}

.site-texts-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 2px solid #ead8bd;
  border-radius: 20px;
  background: rgba(255, 250, 242, .72);
}

.site-texts-group legend {
  padding: 0 10px;
  color: var(--red);
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 800;
}

.site-texts-group textarea {
  min-height: 116px;
  resize: vertical;
}

.email-template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.email-template-tabs button {
  padding: 10px 14px;
  border: 2px solid rgba(21, 21, 21, .1);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
}

.email-template-tabs button.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.email-template-form textarea {
  min-height: 260px;
  font-family: Consolas, "Courier New", monospace;
  font-size: .95rem;
  line-height: 1.5;
}

.email-template-intro {
  padding: 16px 18px;
  border-left: 6px solid var(--red);
  border-radius: 14px;
  background: #fff;
}

.email-template-intro strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.6rem;
}

.email-template-intro p {
  margin: 4px 0 0;
}

.email-template-help {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
}

.email-template-help div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.email-template-help code {
  padding: 7px 10px;
  border-radius: 999px;
  background: #f2e3cb;
  color: #6d2019;
  font-weight: 800;
}

.email-preview {
  padding: 18px;
  border-radius: 18px;
  background: #f4ead7;
}

.mail-preview-shell {
  max-width: 680px;
  overflow: hidden;
  border: 1px solid #ead8bd;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(83, 58, 25, .12);
}

.mail-preview-header {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 24px 28px 18px;
  background: #fffaf2;
  color: var(--ink);
}

.mail-preview-header img {
  width: 112px;
  height: auto;
}

.mail-preview-header span {
  color: var(--red);
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mail-preview-header strong {
  display: block;
  margin-top: 5px;
  font-family: var(--font-title);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: .92;
}

.mail-preview-header small {
  display: block;
  margin-top: 8px;
  color: #665f57;
  font-weight: 800;
}

.mail-preview-accent {
  height: 7px;
  margin: 0 28px;
  border-radius: 999px;
  background: var(--red);
}

.mail-preview-body {
  padding: 28px;
  font-size: 1rem;
  line-height: 1.6;
}

.mail-preview-body p {
  color: #2a2723;
  font-weight: 700;
}

.mail-sample-card {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #ead8bd;
  border-left: 6px solid var(--red);
  border-radius: 14px;
  background: #fffaf2;
}

.mail-sample-card strong {
  font-family: var(--font-title);
  font-size: 1.45rem;
}

.mail-preview-footer {
  padding: 18px 28px;
  border-top: 1px solid #ead8bd;
  color: #665f57;
  font-size: .9rem;
  font-weight: 800;
}

.technical-settings-form {
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,250,242,.98)),
    #fffaf2;
}

.technical-settings-group {
  border-color: rgba(21, 21, 21, .1);
  background: #fff;
}

.technical-settings-group input[type="password"]::placeholder {
  color: #7a7165;
}

@media (max-width: 1180px) {
  .admin-app {
    grid-template-columns: 230px minmax(0, 1fr);
  }

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

@media (max-width: 820px) {
  .admin-app {
    display: block;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-tabs {
    grid-template-columns: 1fr;
  }

  .admin-workspace {
    padding: 22px 16px 40px;
  }

  .admin-topbar {
    position: static;
    display: grid;
    margin: 0 0 22px;
    padding: 0 0 18px;
    background: transparent;
    backdrop-filter: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .site-texts-group {
    grid-template-columns: 1fr;
  }
}
.member-link-requests {
  margin-bottom: 24px;
  padding: 18px;
  border: 2px solid #d99416;
  border-radius: 8px;
  background: #fff8e8;
}

.member-link-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.member-link-controls select {
  min-height: 42px;
}

@media (max-width: 900px) {
  .member-link-controls { grid-template-columns: 1fr 1fr; }
  .member-link-controls select { grid-column: 1 / -1; }
}
