@import url("../v1/ds/fonts.css");

/* ==================================================================
   Système visuel partagé du BACK-OFFICE (coquille + primitives).
   Périmètre : `body.wc-admin` uniquement — le site public et l'assistant
   Wonder ne consomment pas ce fichier.
   Référence : prototype « wonder-cambodia-reservations-saas » (2026-10-14),
   arbitrage propriétaire : DM Sans auto-hébergée + échelle du prototype,
   avec plancher d'accessibilité (saisies 16 px, cibles ≥ 44 px, focus visible).
   ================================================================== */

/* DM Sans variable 400–700, auto-hébergée (OFL) : la ressource est celle du
   dépôt, identique au fichier servi par Google Fonts (aucun appel externe, la
   CSP `font-src 'self'` reste satisfaite). */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../v1/assets/fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../v1/assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

body.wc-admin {
  /* Jetons du prototype, portés à la portée du back-office uniquement. */
  --wc-canvas: #f8f7f4; --wc-surface: #ffffff; --wc-surface-soft: #fcfbf9;
  --wc-ink: #202520; --wc-muted: #6b6f68; --wc-muted-2: #6b6f68;
  --wc-line: #e9e7e1; --wc-line-dark: #dcded7;
  --wc-accent: #bb6b53; --wc-accent-dark: #97513d; --wc-accent-soft: #fbf0eb;
  --wc-green: #32745c; --wc-green-soft: #e9f5ef;
  --wc-blue: #4a6d8f; --wc-blue-soft: #edf3fa;
  --wc-amber: #9d712c; --wc-amber-soft: #fbf4e4;
  --wc-red: #b45046; --wc-red-soft: #fbeeea;
  --wc-shadow: 0 7px 26px rgba(34, 30, 23, .035);
  --wc-radius: 14px;
  --wc-sidebar: 244px;
  --wc-topbar: 70px;

  margin: 0;
  background: var(--wc-canvas);
  color: var(--wc-ink);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
}

body.wc-admin [hidden] { display: none !important; }
body.wc-admin svg { display: block; }
:where(body.wc-admin) :where(button, input, select, textarea) { font: inherit; }
body.wc-admin, body.wc-admin *, body.wc-admin *::before, body.wc-admin *::after { box-sizing: border-box; }
body.wc-admin button { cursor: pointer; }
body.wc-admin :focus-visible { outline: 3px solid rgba(187, 107, 83, .36); outline-offset: 2px; }
body.wc-admin .wc-icon { height: 18px; width: 18px; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
body.wc-admin .wc-icon.sm { height: 15px; width: 15px; }
body.wc-admin .wc-icon.lg { height: 21px; width: 21px; }
body.wc-admin .wc-sr-only { position: absolute; height: 1px; width: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.wc-admin .wc-skip { position: absolute; left: 16px; top: -100px; z-index: 60; background: #fff; padding: 10px;
  border-radius: 8px; text-decoration: none; color: var(--wc-ink); }
body.wc-admin .wc-skip:focus { top: 8px; }
/* Sprite d'icônes : masqué sans attribut `style` (la CSP interdit les styles en
   ligne) et sans `display: none` (les `use` doivent rester résolus). */
body.wc-admin .wc-admin-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ================================================================== */
/* Coquille : barre supérieure fixe + navigation latérale             */
/* ================================================================== */

.wc-admin-shell { min-height: 100dvh; }

.wc-admin-topbar {
  position: sticky;
  top: 0;
  z-index: 41;
  margin-left: var(--wc-sidebar);
  height: var(--wc-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 36px;
  border-bottom: 1px solid var(--wc-line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px);
}
.wc-admin-topbar-left,
.wc-admin-topbar-actions { display: flex; align-items: center; gap: 15px; min-width: 0; }
.wc-admin-breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wc-admin-breadcrumb-group { font-size: 12px; color: var(--wc-muted); font-weight: 600; white-space: nowrap; }
.wc-admin-breadcrumb-slash { color: #757a72; font-size: 18px; }
.wc-admin-current { font-size: 12px; font-weight: 700; color: var(--wc-ink); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.wc-admin-quick-search { padding: 9px 12px; color: #6b6f68; background: #f8f7f5; border: 1px solid #eceae5;
  border-radius: 9px; display: inline-flex; align-items: center; gap: 10px; font-size: 12px; min-width: 220px;
  justify-content: flex-start; min-height: 44px; }
.wc-admin-quick-search:hover { border-color: #dfdcd5; color: var(--wc-ink); }
.wc-admin-key-hint { margin-left: auto; font-size: 10px; border: 1px solid #dfe0d9; border-radius: 4px; padding: 1px 5px;
  white-space: nowrap; }
.wc-admin-topbar-sep { width: 1px; height: 25px; background: var(--wc-line); }
.wc-admin-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wc-admin-avatar { display: grid; place-items: center; width: 34px; height: 34px; background: #eae9df; color: #4d5549;
  border-radius: 50%; font-weight: 700; font-size: 11px; flex-shrink: 0; }
.wc-admin-user { font-size: 12px; font-weight: 700; line-height: 1.25; min-width: 0; white-space: nowrap; }
.wc-admin-role { display: block; color: var(--wc-muted); font-weight: 400; font-size: 10px; }
.wc-admin-signout { min-height: 44px; padding: 0 12px; border: 1px solid var(--wc-line); border-radius: 9px;
  background: #fff; color: #565d56; font-size: 12px; font-weight: 600; }
.wc-admin-signout:hover { border-color: #cdcfc6; color: var(--wc-ink); }
#wc-admin-mobile-menu { display: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--wc-line); border-radius: 9px; background: #fff; color: #565d56; }
#wc-admin-signout-status { color: #9d3e32; font-size: 12px; line-height: 1.4; margin: 0; }

.wc-admin-frame { display: block; }
.wc-admin-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
  width: var(--wc-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--wc-surface);
  border-right: 1px solid var(--wc-line);
}
.wc-admin-brand { display: flex; align-items: center; gap: 12px; min-height: 83px; padding: 21px 20px;
  border-bottom: 1px solid var(--wc-line); text-decoration: none; color: inherit; flex-shrink: 0; }
.wc-admin-brand-mark { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; background: #293a2c;
  border-radius: 11px; color: #fff7ec; font-weight: 700; font-size: 21px; letter-spacing: -.1em; padding-right: 3px; }
.wc-admin-brand-text { min-width: 0; }
.wc-admin-brand-name { font-weight: 700; font-size: 14px; letter-spacing: -.5px; line-height: 1.22; }
.wc-admin-brand-sub { display: block; text-transform: uppercase; letter-spacing: .13em; font-size: 9px; font-weight: 700;
  color: var(--wc-accent-dark); margin-top: 5px; }
.wc-admin-nav-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 12px; }
.wc-admin-nav-group { display: grid; gap: 3px; }
.wc-admin-nav-group + .wc-admin-nav-group { margin-top: 27px; }
.wc-admin-nav-label { padding: 0 12px 10px; color: #6b6f68; letter-spacing: .15em; font-size: 10px; font-weight: 700;
  text-transform: uppercase; }
:where(.wc-admin-nav) a[data-admin-module] {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 12px;
  border-radius: 10px;
  color: #696e66;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.wc-admin-nav a:hover { background: #f8f6f3; color: var(--wc-ink); }
.wc-admin-nav a[aria-current="page"] { color: var(--wc-accent-dark); background: var(--wc-accent-soft); font-weight: 700; }
.wc-admin-nav a[data-admin-count]::after { content: attr(data-admin-count); margin-left: auto; background: #f5e0d6;
  color: #8a4632; font-size: 10px; border-radius: 6px; padding: 2px 6px; font-weight: 700; }
.wc-admin-nav-footer { border-top: 1px solid var(--wc-line); padding: 16px; flex-shrink: 0; }
.wc-admin-workspace { background: #f7f8f4; border: 1px solid var(--wc-line); border-radius: 11px; padding: 12px;
  display: flex; align-items: center; gap: 10px; }
.wc-admin-workspace-mark { display: grid; place-items: center; width: 33px; height: 33px; background: #e5eae1;
  color: #42634a; border-radius: 9px; font-weight: 700; flex-shrink: 0; }
.wc-admin-workspace strong { display: block; font-size: 12px; font-weight: 600; }
.wc-admin-workspace > span:not(.wc-admin-workspace-mark) { color: var(--wc-muted); font-size: 10px; }
.wc-admin-legacy-actions { padding: 0 12px 20px; }
.wc-admin-legacy-actions button { width: 100%; min-height: 44px; margin-top: 14px; padding: 8px 12px;
  border: 1px solid var(--wc-line); border-radius: 10px; background: #fff; color: var(--wc-ink); font: inherit; cursor: pointer; }

.wc-admin-content { margin-left: var(--wc-sidebar); min-width: 0; }
.wc-admin-content > main {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 34px 36px 76px;
}
.wc-admin-nav-backdrop { display: none; }

/* Coquille « nue » (option `bare` de mountAdminShell) : aucune navigation ni barre supérieure.
   La surface hôte fournit sa propre navigation et occupe toute la hauteur utile. */
.wc-admin-shell-bare .wc-admin-frame-bare { min-height: 100dvh; }
.wc-admin-shell-bare .wc-admin-content { margin-left: 0; min-width: 0; }
.wc-admin-shell-bare .wc-admin-content > main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* État invité (session absente sur une page qui gère son propre accès). */
.wc-admin-shell.wc-admin-guest .wc-admin-nav,
.wc-admin-shell.wc-admin-guest .wc-admin-topbar-left { display: none !important; }
.wc-admin-shell.wc-admin-guest .wc-admin-topbar,
.wc-admin-shell.wc-admin-guest .wc-admin-content { margin-left: 0; }
.wc-admin-shell.wc-admin-guest .wc-admin-content > main { max-width: 720px; }

/* ================================================================== */
/* Primitives partagées (boutons, champs, pastilles, cartes, tables)   */
/* ================================================================== */

.wc-btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  padding: 0 14px; min-height: 44px; border-radius: 9px; border: 1px solid var(--wc-line-dark);
  background: #fff; color: #353b35; font-weight: 700; font-size: 12px; white-space: nowrap;
  text-decoration: none; transition: background .13s ease, border-color .13s ease, box-shadow .13s ease;
}
.wc-btn:hover { background: #f7f7f4; border-color: #c5c8bf; }
.wc-btn[aria-pressed="true"] { background: #26392e; border-color: #26392e; color: #fff; }
.wc-btn-dark { background: #26392e; border-color: #26392e; color: #fff; }
.wc-btn-dark:hover { background: #36503e; border-color: #36503e; color: #fff; }
.wc-btn-accent { color: #fff; background: #a7543d; border-color: #a7543d; }
.wc-btn-accent:hover { color: #fff; background: #8f4733; border-color: #8f4733; }
.wc-btn-danger { border-color: #b44337; background: var(--wc-red-soft); color: #7d2f26; }
.wc-btn-quiet { background: transparent; border-color: transparent; color: #62685e; }
.wc-btn-quiet:hover { background: #f1f1ec; border-color: transparent; }
.wc-btn-sm { min-height: 44px; padding: 0 10px; font-size: 11px; }
.wc-btn:disabled { opacity: .52; cursor: not-allowed; }
.wc-btn .wc-icon { width: 16px; height: 16px; }

.wc-icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; background: #fff;
  border: 1px solid var(--wc-line); border-radius: 9px; color: #565d56; }
.wc-icon-button:hover { border-color: #cdcfc6; color: var(--wc-ink); }

.wc-field { border: 1px solid #e4e5de; color: #363c35; background: #fff; border-radius: 9px; min-height: 44px;
  padding: 0 12px; font-size: 16px; outline: none; width: 100%; }
.wc-field:focus { border-color: #bc8a78; box-shadow: 0 0 0 3px rgba(187, 107, 83, .09); }
.wc-field::placeholder { color: #6b6f68; }
/* Apparence native du `<select>` : aucune ressource `data:` (la CSP `default-src 'self'`
   des pages du back-office n'autorise pas `img-src data:`). */
select.wc-field { padding-right: 12px; }
textarea.wc-field { padding: 11px 12px; min-height: 100px; resize: vertical; line-height: 1.5; font-size: 16px; }
.wc-label { display: block; color: #7b8078; font-size: 11px; font-weight: 650; margin-bottom: 6px; }

.wc-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 11px; font-weight: 700;
  border-radius: 7px; line-height: 1.25; max-width: 100%; }
.wc-pill .wc-pill-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.wc-pill.red { color: #a03a31; background: var(--wc-red-soft); }
.wc-pill.green { color: #2b6350; background: var(--wc-green-soft); }
.wc-pill.blue { color: #3f5f7d; background: var(--wc-blue-soft); }
.wc-pill.amber { color: #86601f; background: var(--wc-amber-soft); }
.wc-pill.neutral { color: #5f645c; background: #f0f1ed; }
.wc-pill.terracotta { color: #8a4632; background: var(--wc-accent-soft); }

.wc-eyebrow { display: flex; align-items: center; gap: 9px; color: var(--wc-accent-dark); letter-spacing: .13em;
  font-size: 10px; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.wc-eyebrow .wc-dot { height: 6px; width: 6px; border-radius: 50%; background: var(--wc-accent); }
.wc-display { font-size: clamp(29px, 2.7vw, 37px); line-height: 1.14; letter-spacing: -.055em; font-weight: 700;
  margin: 0 0 11px; }
.wc-display span, .wc-display em { color: #767676; font-style: normal; }
.wc-card { background: var(--wc-surface); border: 1px solid var(--wc-line); border-radius: var(--wc-radius);
  box-shadow: var(--wc-shadow); }
.wc-note { color: var(--wc-muted); font-size: 12px; margin: 0; }
.wc-muted { color: var(--wc-muted); font-size: 12px; }
.wc-hand-link { background: transparent; border: 0; color: var(--wc-accent-dark); font-size: 12px; font-weight: 700;
  padding: 0; text-decoration: none; }
.wc-hand-link:hover { text-decoration: underline; }

.wc-toast-stack { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: grid; gap: 9px; }
.wc-toast { background: #253d2f; color: #fff; box-shadow: 0 10px 35px rgba(20, 30, 23, .2); padding: 13px 16px;
  border-radius: 10px; font-size: 12px; max-width: 355px; }
.wc-modal-overlay { display: none; position: fixed; z-index: 90; inset: 0; background: rgba(20, 29, 22, .45);
  backdrop-filter: blur(3px); justify-content: center; align-items: center; padding: 20px; }
.wc-modal-overlay.show { display: flex; }
.wc-modal { background: #fff; border-radius: 15px; width: min(100%, 520px); border: 1px solid #e9e5de;
  box-shadow: 0 22px 65px rgba(12, 23, 15, .2); max-height: calc(100vh - 40px); overflow-y: auto; }
.wc-modal-header { display: flex; justify-content: space-between; align-items: start; gap: 15px; padding: 22px 23px 15px; }
.wc-modal-header h2 { font-size: 18px; margin: 0 0 7px; letter-spacing: -.03em; font-weight: 700; }
.wc-modal-header p { color: #7b8178; font-size: 12px; margin: 0; line-height: 1.6; }
.wc-modal-content { padding: 5px 23px 20px; }
.wc-modal-footer { border-top: 1px solid var(--wc-line); display: flex; justify-content: flex-end; gap: 8px;
  padding: 15px 23px; }

.wc-table-scroll { overflow-x: auto; max-width: 100%; }
.wc-table { width: 100%; border-collapse: collapse; }
.wc-table th, .wc-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f0f0ec; font-size: 12px;
  vertical-align: top; overflow-wrap: anywhere; }
.wc-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #6b6f68; font-weight: 700; }

/* ================================================================== */
/* Responsive : rail d'icônes, puis tiroir mobile                     */
/* ================================================================== */

@media (max-width: 1300px) {
  .wc-admin-topbar { padding: 0 27px; }
  .wc-admin-content > main { padding: 34px 27px 76px; }
}
@media (max-width: 1100px) {
  body.wc-admin { --wc-sidebar: 72px; }
  .wc-admin-brand { padding: 17px; justify-content: center; min-height: 78px; }
  .wc-admin-brand-text, .wc-admin-nav-label, .wc-admin-nav-footer { display: none; }
  .wc-admin-nav-scroll { padding: 20px 11px; }
  .wc-admin-nav-group + .wc-admin-nav-group { margin-top: 24px; border-top: 1px solid var(--wc-line); padding-top: 15px; }
  .wc-admin-nav a { display: grid; place-items: center; padding: 11px 0; }
  /* Rail d'icônes : le libellé reste dans l'arbre d'accessibilité (nom accessible
     du lien conservé), il est seulement retiré visuellement. La marque n'est PAS
     visée (elle a sa propre pastille). */
  .wc-admin-nav a[data-admin-module] span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}
@media (max-width: 900px) {
  .wc-admin-topbar { margin-left: 0; gap: 10px; }
  /* La recherche de dossier globale est retirée : la page Réservations porte sa
     propre recherche, et la barre ne doit jamais se replier sur deux lignes. */
  .wc-admin-quick-search { display: none; }
  .wc-admin-content { margin-left: 0; }
  /* Le tiroir et son voile commencent SOUS la barre supérieure : aucun contrôle
     global (menu, recherche) n'est jamais masqué par la navigation mobile. */
  .wc-admin-nav {
    display: none;
    top: var(--wc-topbar);
    bottom: 0;
    width: min(280px, 85vw);
    overflow-y: auto;
    box-shadow: 12px 0 30px #0002;
  }
  .wc-admin-nav.open { display: flex; z-index: 43; }
  .wc-admin-brand { justify-content: flex-start; padding: 21px 20px; }
  /* Le tiroir réaffiche ses libellés : la technique de masquage du rail doit être
     ENTIÈREMENT défaite, sinon les libellés restent séquestrés à 1×1 px. */
  .wc-admin-nav a[data-admin-module] span { position: static; width: auto; height: auto; margin: 0;
    overflow: visible; clip: auto; clip-path: none; white-space: normal; }
  .wc-admin-brand-text, .wc-admin-nav-label, .wc-admin-nav-footer { display: block; }
  .wc-admin-nav a { display: flex; padding: 12px; }
  .wc-admin-nav-scroll { padding: 24px 12px; }
  .wc-admin-nav-group + .wc-admin-nav-group { margin-top: 27px; border: 0; padding: 0; }
  .wc-admin-nav-backdrop:not([hidden]) {
    display: block; position: fixed; inset: var(--wc-topbar) 0 0; z-index: 42; width: 100%; padding: 0; border: 0;
    border-radius: 0; background: rgba(15, 24, 18, .4);
  }
  #wc-admin-mobile-menu { display: inline-flex; }
}
@media (max-width: 700px) {
  body.wc-admin { --wc-topbar: 62px; }
  .wc-admin-topbar { padding: 0 17px; height: 62px; }
  .wc-admin-user, .wc-admin-signout, .wc-admin-topbar-sep, .wc-admin-quick-search { display: none; }
  .wc-admin-content > main { padding: 23px 15px 55px; }
}
@media (max-width: 370px) { .wc-admin-breadcrumb-group, .wc-admin-breadcrumb-slash { display: none; } }

@media print {
  .wc-admin-nav, .wc-admin-topbar, .wc-admin-nav-backdrop { display: none !important; }
  body.wc-admin { background: #fff; }
  .wc-admin-content { margin-left: 0; }
  .wc-admin-content > main { padding: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wc-admin-shell *, .wc-admin-shell *::before, .wc-admin-shell *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
