/* ==========================================================================
   Event Studio POS — Thème "Nuit à Marrakech"
   Noir profond · accent or · verre dépoli · typographie éditoriale
   (Borne de vente + Tableau de bord admin)
   ========================================================================== */

:root {
  --bg: #0a0a0c;
  --bg-2: #0d0d10;
  --surface: rgba(23, 23, 29, 0.9);
  --surface-2: rgba(32, 32, 40, 0.82);
  --surface-solid: #141419;
  --ink: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.62);
  --muted-2: rgba(245, 241, 232, 0.4);
  --gold: #d9b676;
  --gold-strong: #eaca8a;
  --gold-soft: rgba(217, 182, 118, 0.12);
  --emerald: #58c9a3;
  --coral: #e08a7f;
  --danger: #e0655a;
  --line: rgba(245, 241, 232, 0.1);
  --line-strong: rgba(245, 241, 232, 0.2);

  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(60vw 60vw at 88% -6%, rgba(217, 182, 118, 0.13), transparent 60%),
    radial-gradient(60vw 60vw at -8% 108%, rgba(120, 70, 40, 0.16), transparent 62%),
    var(--bg);
  font-family: var(--font-ui);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: translateY(1px) scale(0.99);
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

h2 {
  margin-bottom: 6px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.02rem;
  font-weight: 600;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* --- Logo ----------------------------------------------------------------- */
.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-line strong,
.brand-line small {
  display: block;
}

.brand-line strong {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.brand-line small {
  color: var(--muted);
  font-size: 0.82rem;
}

.brand-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-logo.wide {
  width: 210px;
}

.brand-logo.compact {
  width: 158px;
}

.brand-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* --- Boutons génériques --------------------------------------------------- */
.ghost-button,
.pay-method,
.icon-button,
.qty-controls button,
select,
.admin-nav button {
  min-height: 46px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.ghost-button:hover,
.pay-method:hover,
.icon-button:hover,
.qty-controls button:hover,
.admin-nav button:hover {
  border-color: var(--line-strong);
  background: rgba(245, 241, 232, 0.08);
}

.ghost-button.full {
  width: 100%;
  margin-top: 14px;
}

.primary-button {
  width: 100%;
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #1a1206;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 34px rgba(217, 182, 118, 0.22);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button:hover {
  box-shadow: 0 20px 44px rgba(217, 182, 118, 0.34);
  filter: brightness(1.04);
}

select {
  min-width: 210px;
  color-scheme: dark;
}

select option {
  background: var(--surface-solid);
  color: var(--ink);
}

/* --- Surfaces (verre) ----------------------------------------------------- */
.kiosk-topbar,
.borne-products,
.kiosk-ticket,
.panel,
.stand-card,
.device-card,
.user-card,
.product-admin-card,
.admin-topbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

/* ============================ BORNE DE VENTE ============================== */
.kiosk-screen {
  min-height: 100vh;
  padding: 18px;
}

.kiosk-topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  margin-bottom: 18px;
}

.kiosk-status {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 400;
}

.camera-live,
.camera-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 4px rgba(88, 201, 163, 0.16);
  animation: esPulse 2.4s ease-out infinite;
}

.kiosk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 404px;
  gap: 18px;
}

.borne-products,
.kiosk-ticket,
.panel {
  padding: 22px;
}

.product-toolbar,
.section-head,
.ticket-head,
.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.product-toolbar,
.section-head {
  margin-bottom: 20px;
}

.kiosk-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.kiosk-product {
  min-height: 290px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
}

.kiosk-product:hover {
  transform: translateY(-5px);
  border-color: rgba(217, 182, 118, 0.45);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.product-photo {
  width: 100%;
  aspect-ratio: 1.32 / 1;
  object-fit: cover;
  display: block;
  background: #1a1a20;
}

.product-info {
  flex: 1;
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.product-info span {
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.product-info strong {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.product-price {
  width: max-content;
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  color: var(--gold-strong);
  background: var(--gold-soft);
  border: 1px solid rgba(217, 182, 118, 0.28);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 500;
}

/* --- Ticket / panier ------------------------------------------------------ */
.kiosk-ticket {
  position: sticky;
  top: 18px;
  align-self: start;
}

.icon-button {
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: 1.3rem;
  color: var(--muted);
}

.cart-list {
  min-height: 200px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.empty-cart {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
}

.cart-line,
.sale-line,
.device-line,
.accounting-row,
.partner-row,
.performance-row {
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.cart-line strong,
.sale-line strong {
  font-weight: 600;
}

.cart-line small,
.sale-line small,
.device-line small,
.partner-row small,
.accounting-row span {
  display: block;
  color: var(--muted);
}

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

.qty-controls button {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.15rem;
}

.qty-controls strong {
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ticket-summary {
  margin: 18px 0;
  display: grid;
  gap: 9px;
}

.ticket-summary div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--font-sans);
}

.ticket-summary strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.total-row {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}

.total-row strong {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--gold-strong);
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pay-method {
  min-height: 52px;
  justify-content: center;
}

.pay-method.active {
  color: #1a1206;
  border-color: transparent;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  font-weight: 600;
}

.ticket-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--gold-soft);
  border: 1px solid rgba(217, 182, 118, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
}

.camera-strip {
  margin-top: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(88, 201, 163, 0.07);
  border: 1px solid rgba(88, 201, 163, 0.18);
  border-radius: var(--radius-md);
}

.camera-strip small {
  display: block;
  color: var(--muted);
  word-break: break-all;
}

/* ============================ ADMIN ====================================== */
.admin-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px 1fr;
}

.admin-sidebar {
  min-height: 100vh;
  padding: 24px 22px;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.92), rgba(10, 10, 12, 0.96));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.admin-sidebar .brand-line {
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
}

.admin-sidebar small {
  color: var(--muted);
}

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

.admin-nav button {
  min-height: 50px;
  justify-content: flex-start;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.admin-nav button:hover {
  color: var(--ink);
  background: rgba(245, 241, 232, 0.05);
}

.admin-nav button.active {
  color: var(--gold-strong);
  background: var(--gold-soft);
  border-color: rgba(217, 182, 118, 0.28);
}

.session-card {
  margin-top: auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.session-card span,
.session-card small {
  display: block;
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.session-card strong {
  display: block;
  margin: 4px 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
}

.admin-main {
  min-width: 0;
  padding: 26px;
}

.admin-topbar {
  min-height: 88px;
  align-items: center;
  margin-bottom: 22px;
  padding: 20px 22px;
}

.admin-topbar p:last-child {
  margin-bottom: 0;
}

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

.admin-view {
  display: none;
  animation: esFade 0.4s ease both;
}

.admin-view.active {
  display: block;
}

/* --- Vue globale ---------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.stat-card span {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--gold-strong);
  font-variant-numeric: tabular-nums;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 18px;
}

.section-head span {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.stand-performance,
.sales-list,
.accounting-table,
.partner-list {
  display: grid;
  gap: 10px;
}

.performance-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 14px;
  align-items: center;
}

.performance-row strong {
  font-weight: 600;
  font-size: 0.95rem;
}

.performance-row span {
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  font-family: var(--font-sans);
}

.bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-strong));
  border-radius: 999px;
}

/* --- Cartes (stands / users / produits / matériel) ------------------------ */
.stand-board,
.device-grid,
.user-board,
.product-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.stand-card,
.device-card,
.user-card,
.product-admin-card {
  padding: 18px;
}

.stand-card:hover,
.device-card:hover,
.user-card:hover,
.product-admin-card:hover {
  border-color: var(--line-strong);
}

.stand-card header,
.device-card header,
.user-card header,
.product-admin-card header,
.partner-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stand-card dl,
.user-card dl,
.product-admin-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 14px;
  margin: 0;
}

.stand-card dt,
.user-card dt,
.product-admin-card dt {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.stand-card dd,
.user-card dd,
.product-admin-card dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
}

.product-admin-card img {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  object-fit: cover;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.device-line {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.device-line strong {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
}

.partner-row {
  display: grid;
  gap: 8px;
}

.partner-row strong {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold-strong);
}

.accounting-row strong {
  font-weight: 600;
}

/* --- Pastilles / tags ----------------------------------------------------- */
.role-pill,
.stand-badge,
.status-pill,
.tag {
  width: max-content;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  color: var(--gold-strong);
  background: var(--gold-soft);
  border: 1px solid rgba(217, 182, 118, 0.28);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-pill {
  color: var(--emerald);
  background: rgba(88, 201, 163, 0.1);
  border-color: rgba(88, 201, 163, 0.3);
}

.tag.event,
.tag.partner-pay {
  color: var(--coral);
  background: rgba(224, 138, 127, 0.1);
  border-color: rgba(224, 138, 127, 0.3);
}

.role-pill.role-super-admin {
  color: var(--gold-strong);
  background: var(--gold-soft);
  border-color: rgba(217, 182, 118, 0.32);
}

.role-pill.role-admin {
  color: #c9b3e8;
  background: rgba(150, 120, 200, 0.12);
  border-color: rgba(150, 120, 200, 0.32);
}

.role-pill.role-stand-manager {
  color: var(--emerald);
  background: rgba(88, 201, 163, 0.1);
  border-color: rgba(88, 201, 163, 0.3);
}

.role-pill.role-partner {
  color: var(--coral);
  background: rgba(224, 138, 127, 0.1);
  border-color: rgba(224, 138, 127, 0.3);
}

/* --- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 380px;
  padding: 15px 18px;
  color: var(--ink);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  font-family: var(--font-sans);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.24s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* --- Animations ----------------------------------------------------------- */
@keyframes esPulse {
  0% { box-shadow: 0 0 0 0 rgba(88, 201, 163, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(88, 201, 163, 0); }
  100% { box-shadow: 0 0 0 0 rgba(88, 201, 163, 0); }
}

@keyframes esFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1120px) {
  .kiosk-layout,
  .admin-screen,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-sidebar .brand-line {
    flex-direction: row;
    align-items: center;
  }

  .admin-nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .kiosk-ticket {
    position: static;
  }

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

@media (max-width: 720px) {
  .admin-main,
  .admin-sidebar,
  .kiosk-screen {
    padding: 16px;
  }

  .stats-grid,
  .kiosk-product-grid {
    grid-template-columns: 1fr;
  }

  .kiosk-topbar,
  .kiosk-status,
  .admin-topbar,
  .admin-actions,
  .product-toolbar,
  .section-head,
  .ticket-head {
    align-items: stretch;
    flex-direction: column;
  }

  select {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
