/* ============================================================
   YUMI Beauty — Portail PIM-DAM
   Tokens repris du système bdd.yumi-beauty.com
   ============================================================ */
:root {
  --ink: #18201f;
  --muted: #667571;
  --line: #dde6e2;
  --soft: #f6f8f7;
  --panel: #ffffff;
  --teal: #0f766e;
  --teal-strong: #0a5e58;
  --teal-soft: #dcf3ef;
  --coral: #cf5c4a;
  --amber: #bf8a18;
  --green: #3b8f60;
  --violet: #6257c7;
  --blue: #326fb3;
  --view: var(--ink);
  --view-soft: color-mix(in srgb, var(--view) 14%, white);
  --view-ink: color-mix(in srgb, var(--view) 65%, black);
  --shadow: 0 24px 70px rgba(24, 32, 31, 0.12);
  --radius-l: 16px;
  --radius-m: 12px;
  --radius-s: 8px;
  --font-body: "Roboto", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #ffffff;
  font-family: var(--font-body);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
::selection { background: #131211; color: #ffffff; }

/* ============================================================
   Shell
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  padding: 22px;
  background: linear-gradient(180deg, #111111 0%, #2a2d2f 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  position: sticky;
  top: 0;
}

.brand.brand-home {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-l);
  padding: 10px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.brand-home:hover .brand-mark { transform: translateY(-1px); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid #111827;
  background: #ffffff;
  color: #111827;
  font-weight: 900;
  font-family: var(--font-body);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.brand h1 { margin: 0; font-size: 20px; }
.brand p { margin: 0; color: #6a7673; font-size: 13px; }

.search-box {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}
.search-box input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  outline: none;
}
.search-box input::placeholder { color: rgba(255, 255, 255, 0.38); }
.search-box input:focus { border-color: rgba(255, 255, 255, 0.54); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); }

.filter-block { display: grid; gap: 9px; }
.filter-block > span { color: rgba(255, 255, 255, 0.65); font-size: 12.5px; font-weight: 850; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip .chip-swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chip.active {
  border-color: color-mix(in srgb, var(--view) 36%, var(--line));
  background: var(--view-soft);
  color: var(--view-ink);
  font-weight: 850;
}

.view-tabs .tab {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  text-align: left;
}
.view-tabs .tab.active {
  border-color: color-mix(in srgb, var(--view) 36%, var(--line));
  background: var(--view-soft);
  color: var(--view-ink);
  font-weight: 850;
}

/* ---------------- Axis/gamme tree (accordéon) ---------------- */
.tree { display: flex; flex-direction: column; gap: 6px; }
.axis-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  text-align: left;
}
.axis-row.active {
  border-color: color-mix(in srgb, var(--view) 36%, var(--line));
  background: var(--view-soft);
  color: var(--view-ink);
  font-weight: 850;
}
.axis-swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.axis-name { flex: 1; }
.axis-count { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.axis-caret {
  font-size: 10px;
  opacity: .75;
  transition: transform .18s ease;
  flex-shrink: 0;
}
.axis-caret.open { transform: rotate(90deg); }

.gamme-list {
  overflow: hidden;
  max-height: 0;
  transition: max-height .22s ease;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gamme-list.open { max-height: 600px; margin-top: 6px; }
.gamme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  background: none;
  color: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  text-align: left;
}
.gamme-row:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.gamme-row.active {
  background: var(--view-soft);
  color: var(--view-ink);
  font-weight: 850;
}
.gamme-row .g-count { font-size: 10.5px; opacity: .8; font-variant-numeric: tabular-nums; }

/* ============================================================
   Workspace
   ============================================================ */
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding: 28px;
  background: #ffffff;
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 34px; line-height: 1.15; }
.eyebrow { margin: 0; color: var(--view); font-size: 12px; font-weight: 900; text-transform: uppercase; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }

.top-view-tabs {
  display: flex; gap: 6px; padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 25px rgba(24, 32, 31, 0.08);
}
.top-view-tabs[hidden] { display: none !important; }
.top-view-tabs .tab {
  padding: 8px 13px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.top-view-tabs .tab.active { background: white; color: var(--view-ink); box-shadow: 0 8px 18px rgba(24, 32, 31, 0.08); }

.primary-button {
  border-radius: 12px;
  padding: 0 16px;
  min-height: 42px;
  border: 1px solid var(--view-ink);
  background: linear-gradient(135deg, var(--view), var(--view-ink));
  color: white;
  font-weight: 850;
  cursor: pointer;
}
.primary-button:hover, .secondary-button:hover { filter: brightness(0.96); }
.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  filter: grayscale(0.15);
}
.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  background: white;
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(24, 32, 31, 0.07);
}
.icon-button {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: 18px;
}
.link-button { border: none; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; padding: 0; }

/* ---------------- Select / export bars ---------------- */
.select-all-row, .selection-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--soft);
  margin-bottom: 12px;
  font-size: 12.5px;
}
.spacer { flex: 1; }
.muted-text { color: var(--muted); font-size: 12px; }
.count-pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; white-space: nowrap; background: #fff; }
.selection-bar { background: var(--view-soft); border-color: color-mix(in srgb, var(--view) 30%, var(--line)); }
.selection-bar span:first-child { font-weight: 850; color: var(--view-ink); }

/* ============================================================
   Product grid
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 16px; }
.grid[hidden], .table-view[hidden] { display: none; }
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card:hover { border-color: color-mix(in srgb, var(--view) 40%, var(--line)); }
.card.selected { border-color: var(--view); box-shadow: 0 0 0 2px var(--view); }
.card-select {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 22px; height: 22px; border-radius: 8px;
  border: 1.5px solid rgba(24,32,31,.35);
  background: rgba(255,255,255,.92);
  box-shadow: 0 1px 4px rgba(24,32,31,.18);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.card-select svg { opacity: 0; width: 13px; height: 13px; }
.card-select svg path { stroke: #fff; }
.card.selected .card-select { background: var(--view); border-color: var(--view); }
.card.selected .card-select svg { opacity: 1; }
.card-delete-form {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  margin: 0;
}
.card-delete-button,
.table-delete-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f3c9cf;
  border-radius: 999px;
  background: #fee9ed;
  color: var(--red, #cf3f35);
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(207, 63, 53, 0.16);
}
.card-delete-button:hover,
.table-delete-button:hover {
  background: #cf3f35;
  border-color: #cf3f35;
  color: #fff;
}
.card-badges {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.card.has-delete .card-badges { top: 48px; }
.card-badge {
  font-size: 9.5px; font-weight: 900; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 999px; color: #fff;
}
.card-badge-pro { background: #111111; }
.card-badge-oos { background: var(--red, #cf3f35); }
.card-img { aspect-ratio: 1; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 5px; }
.card-gamme { font-size: 10.5px; font-weight: 900; text-transform: uppercase; color: var(--view-ink); }
.card-title { font-size: 12.5px; line-height: 1.35; font-weight: 700; }
.card-variant { font-size: 11px; line-height: 1.25; color: var(--muted); font-weight: 800; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.card-sku { font-size: 10.5px; color: var(--muted); }
.card-price { font-size: 13px; font-weight: 900; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------- Table view ---------------- */
.table-view {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: auto;
  max-height: 72vh;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}
.table-view table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table-view thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 850; color: var(--muted);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em;
  padding: 10px 12px; border: 1px solid var(--line); background: var(--soft);
  white-space: nowrap;
}
.table-view thead th.sortable { cursor: pointer; user-select: none; }
.table-view thead th.sortable:hover { color: var(--ink); }
.table-view thead th.t-num, .table-view td.t-num { text-align: right; }
.table-view tbody td { padding: 7px 12px; border: 1px solid var(--line); vertical-align: middle; }
.table-view tbody tr:nth-child(even) { background: var(--soft); }
.table-view tbody tr:hover { background: var(--view-soft); cursor: pointer; }
.table-view tbody tr.selected { background: var(--view-soft); font-weight: 700; }
.t-check-col { width: 34px; text-align: center; }
.t-delete-col { width: 44px; text-align: center; }
.table-delete-form { margin: 0; display: inline-grid; place-items: center; }
.table-delete-button { width: 28px; height: 28px; font-size: 19px; box-shadow: none; }
.t-thumb { width: 30px; height: 30px; border-radius: var(--radius-s); object-fit: cover; background: var(--soft); display: block; }
.t-check { width: 15px; height: 15px; accent-color: var(--view); cursor: pointer; }
.t-title { font-weight: 700; }
.t-badge { font-size: 9.5px; font-weight: 900; padding: 2px 9px; border-radius: 999px; color: #fff; display: inline-block; }
.t-swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.t-price { font-weight: 900; }

/* ============================================================
   Admin
   ============================================================ */
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-l);
  background: rgba(255,255,255,.88); box-shadow: var(--shadow); backdrop-filter: blur(14px);
  padding: 17px;
}
.metric::after {
  content: ""; position: absolute; right: 14px; bottom: 12px;
  width: 34px; height: 5px; border-radius: 999px; background: var(--view); opacity: .22;
}
.metric span { display: block; color: var(--muted); font-size: 13px; font-weight: 850; }
.metric strong { display: block; margin-top: 6px; font-size: 30px; }

.detail-area {
  border: 1px solid var(--line); border-radius: var(--radius-l);
  background: rgba(255,255,255,.88); box-shadow: var(--shadow); backdrop-filter: blur(14px);
  min-height: 168px; padding: 20px; margin-bottom: 16px;
}
.admin-card { display: grid; gap: 14px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; font-weight: 850; }
.admin-card > .panel-title { margin-bottom: 0; }
.panel-title .muted-text { font-weight: 400; }
.admin-quick-actions { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.admin-split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-subcard, .user-create-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: #fff;
  padding: 14px;
}
.admin-subcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.admin-subcard-head strong { font-size: 13.5px; }
.admin-subcard-head span { color: var(--muted); font-size: 11.5px; text-align: right; }
.success-message { background: #e9f7ef !important; color: #23623c !important; }
.import-form-stacked { display: grid !important; gap: 10px !important; align-items: stretch !important; }
.reset-subcard { margin-bottom: 14px; }
.reset-request-list { display: grid; gap: 8px; }
.reset-request-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--soft);
}
.reset-request-row:first-child { border-top: none; padding-top: 0; }
.reset-request-row strong { display: block; font-size: 12.5px; }
.reset-request-row span { color: var(--muted); font-size: 11px; }
.reset-request-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.reset-request-actions form, .access-actions form { margin: 0; }

.mini-link { color: var(--view-ink); font-size: 12px; font-weight: 700; background: none; border: none; padding: 0; }
.muted-action { color: var(--muted) !important; }
.danger-action { color: var(--red, #cf3f35) !important; }
.cleanup-scroll-list {
  display: grid;
  gap: 0;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}
.cleanup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 9px 0;
  border-top: 1px solid var(--soft);
}
.cleanup-row:first-child { border-top: none; padding-top: 0; }
.cleanup-row-title { min-width: 0; display: grid; gap: 3px; }
.cleanup-row-title strong,
.cleanup-row-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cleanup-row-title strong { font-size: 12.5px; line-height: 1.25; }
.cleanup-row-title span { color: var(--muted); font-size: 10.8px; }
.cleanup-row form { margin: 0; flex: 0 0 auto; }
.cleanup-asset-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cleanup-thumb {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--soft);
}
.cleanup-thumb img,
.cleanup-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cleanup-thumb span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.danger-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #f3c9cf;
  border-radius: 999px;
  background: #fee9ed;
  color: var(--red, #cf3f35);
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  text-decoration: none;
}
.danger-delete-button span {
  font-size: 18px;
  line-height: 1;
}
.danger-delete-button:hover { filter: brightness(0.96); }

.access-list { list-style: none; margin: 0; padding: 0; }
.access-list li { border-bottom: 1px solid var(--soft); }
.access-list li:last-child { border-bottom: none; }
.access-list strong { display: block; font-size: 12.5px; font-weight: 700; }
.access-list span { font-size: 11px; color: var(--muted); }
.access-editor-card {
  display: grid;
  gap: 10px;
  padding: 13px 0;
}
.user-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.access-editor-main { flex: 1; min-width: 0; display: grid; gap: 9px; }
.access-summary { display: block; line-height: 1.45; }
.access-edit-form { display: grid; gap: 10px; margin-top: 4px; }
.access-controls { gap: 8px; }
.access-controls select { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; color: var(--ink); }
.inline-check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--muted); font-size: 12px; font-weight: 700; }
.inline-check input { width: auto; }
.access-block { display: grid; gap: 7px; }
.access-block > span, .family-access summary, .user-access-details summary, .import-form label > span { color: var(--muted); font-size: 12px; font-weight: 850; }
.access-block small, .family-access small { color: var(--muted); font-size: 11px; }
.family-access { border: 1px solid var(--soft); border-radius: var(--radius-m); padding: 10px 12px; background: #fff; }
.family-access summary { cursor: pointer; }
.user-access-details {
  border: 1px solid var(--soft);
  border-radius: var(--radius-m);
  background: #fff;
  padding: 10px 12px;
}
.user-access-details summary { cursor: pointer; }
.user-access-details[open] { border-color: var(--line); }
.user-access-details[open] summary { margin-bottom: 10px; color: var(--ink); }
.family-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.compact-save { justify-self: start; min-height: 34px; }
.access-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.import-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.import-form label { display: grid; gap: 7px; flex: 1; min-width: 260px; }
.import-form input[type="file"] { min-height: 42px; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 8px 10px; background: #fff; color: var(--ink); }
.import-mapping-card { max-width: 940px; }
.mapping-form { display: grid; gap: 14px; }
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mapping-grid label { display: grid; gap: 7px; }
.mapping-grid label span { color: var(--muted); font-size: 12px; font-weight: 850; }
.mapping-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}
.mapping-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.summary-tag {
  display: inline-flex; align-items: center; min-height: 28px;
  max-width: 260px;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
  background: #fff; color: var(--ink); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.risk-pill { min-width: 42px; border-radius: 999px; padding: 4px 10px; text-align: center; color: white; background: var(--green); font-size: 11.5px; font-weight: 900; }
.admin-pill { background: var(--view); }

/* ============================================================
   Drawer
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(24,32,31,.32); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; width: min(620px, calc(100vw - 24px)); max-width: none; height: 100vh;
  background: #ffffff; box-shadow: -24px 0 48px rgba(24,32,31,.18);
  z-index: 21; overflow-y: auto; padding: 24px;
}
.drawer-close { position: absolute; top: 16px; right: 16px; border-radius: 12px; }
.drawer-img { width: 100%; height: clamp(170px, 28vh, 300px); border-radius: var(--radius-l); overflow: hidden; background: var(--soft); margin-bottom: 12px; }
.drawer-img img { width: 100%; height: 100%; object-fit: cover; }
.drawer-thumbs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; }
.drawer-thumb { flex-shrink: 0; width: 46px; height: 46px; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); padding: 0; background: var(--soft); }
.drawer-thumb:hover { border-color: var(--view); }
.drawer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drawer-gamme { color: var(--view-ink); font-size: 11px; font-weight: 900; margin-bottom: 4px; text-transform: uppercase; }
.drawer-title { font-size: 21px; font-weight: 900; margin: 0 0 16px; line-height: 1.18; }
.drawer-row { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-top: 1px solid var(--soft); font-size: 13px; }
.drawer-row span:first-child { color: var(--muted); }
.drawer-row span:last-child { text-align: right; overflow-wrap: anywhere; }
.drawer-text-block { padding: 13px 0; border-top: 1px solid var(--soft); }
.drawer-text-block h4 { margin: 0 0 6px; font-size: 11px; font-weight: 850; text-transform: uppercase; color: var(--muted); }
.drawer-text-block p { margin: 0; font-size: 13.2px; line-height: 1.62; }
.drawer-text-block p.inci { color: var(--muted); font-size: 12.2px; }
.drawer-desc p, .drawer-desc ul, .drawer-desc ol { margin: 0 0 9px; font-size: 13.2px; line-height: 1.62; }
.drawer-desc p:last-child { margin-bottom: 0; }
.drawer-desc ul, .drawer-desc ol { padding-left: 18px; }
.drawer-desc a { color: var(--view-ink); }
.communication-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.communication-tile { display: grid; gap: 6px; color: var(--ink); text-decoration: none; min-width: 0; }
.communication-preview {
  display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line);
  border-radius: var(--radius-m); overflow: hidden; background: var(--soft);
}
.communication-preview img, .communication-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.communication-file-icon { font-size: 12px; font-weight: 900; color: var(--muted); }
.communication-name { font-size: 10.5px; line-height: 1.25; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-status { min-height: 16px; margin: 8px 0 0; }
.drawer-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.drawer-actions button, .drawer-actions a { flex: none; min-height: 40px; display: flex; align-items: center; justify-content: center; }

/* ============================================================
   Communication library
   ============================================================ */
.communication-library-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.communication-library-header h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.2; }
.communication-library-header p { margin: 0; }
.communication-library-block {
  padding: 16px 0 20px;
  border-top: 1px solid var(--line);
}
.communication-library-block[hidden] { display: none; }
.communication-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.communication-library-grid .empty-state { grid-column: 1 / -1; }
.communication-library-card {
  position: relative;
  display: grid;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(24, 32, 31, 0.06);
}
.communication-library-card:hover { border-color: color-mix(in srgb, var(--view) 42%, var(--line)); }
.communication-library-card.is-orphan {
  border-style: dashed;
  background: #fffdf8;
}
.communication-library-link {
  display: grid;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
.communication-delete-form {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  margin: 0;
}
.communication-delete-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f3c9cf;
  border-radius: 999px;
  background: #fee9ed;
  color: var(--red, #cf3f35);
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(207, 63, 53, 0.16);
}
.communication-delete-button:hover {
  background: #cf3f35;
  border-color: #cf3f35;
  color: #fff;
}
.communication-library-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--soft);
  overflow: hidden;
}
.communication-library-preview img,
.communication-library-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.asset-type-pill {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.84);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}
.communication-library-body {
  display: grid;
  gap: 4px;
  padding: 10px 11px 12px;
}
.communication-library-name,
.communication-library-product,
.communication-library-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.communication-library-name { font-size: 12px; font-weight: 850; }
.communication-library-product { font-size: 11px; color: var(--ink); }
.communication-library-meta { font-size: 10.5px; color: var(--muted); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: none; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-wrap: wrap; }
  .brand h1 { font-size: 18px; }
  .topbar h2 { font-size: 26px; }
  .drawer { width: 100vw; max-width: none; padding: 18px; }
  .drawer-img { height: 180px; }
  .communication-library-header { flex-direction: column; }
  .communication-library-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .admin-split-grid { grid-template-columns: 1fr; }
  .user-card-top, .reset-request-row { flex-direction: column; align-items: stretch; }
  .access-actions, .reset-request-actions { justify-content: flex-start; }
}

/* ============================================================
   Auth (connexion) — repris du style bdd.yumi-beauty.com
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(221, 230, 226, 0.38)),
    #f6f8f7;
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.auth-card.import-mapping-card { width: min(940px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-card h2 { margin: 0 0 8px; color: var(--ink); font-size: 20px; }
.auth-hint { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.auth-form { display: grid; gap: 12px; }
.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  min-height: 42px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.auth-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  background: #fee9ed;
  color: #a34052;
  font-size: 12.5px;
}
.session-logout {
  border: none; background: none; padding: 0; margin-left: 8px;
  color: var(--muted); font-size: 11px; text-decoration: underline; cursor: pointer;
}

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 5px;
  background: var(--coral, #cf5c4a);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.admin-floating-button {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 18;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #111827;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 850;
  box-shadow: 0 16px 34px rgba(24, 32, 31, 0.22);
}
.admin-floating-button:hover,
.admin-floating-button.active { background: #fff; color: #111827; }

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #f3c9cf;
  background: #fee9ed;
  color: var(--red, #cf3f35);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  text-align: center;
}
.logout-button:hover { filter: brightness(0.97); }
.logout-button svg { width: 14px; height: 14px; flex-shrink: 0; }
