/* ============================================================
   TRAÇABILITÉ MÉDICAMENTS — Clinique de Bonsecours
   Rodrigue DOUCHEZ — refactor 2026
   Aesthetic: Medical precision · Clinical authority · Trusted data
   Font: IBM Plex Sans (body) + IBM Plex Mono (code/data)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:        #eef1f6;
  --bg-alt:    #e4e9f2;
  --surface:   #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #ecf0f8;

  --navy-950:  #060e24;
  --navy-900:  #0d1b3e;
  --navy-700:  #153069;
  --navy-600:  #1a3d8a;
  --navy-500:  #2050b5;
  --navy-400:  #4a78d4;
  --navy-200:  #b8ccf4;
  --navy-100:  #dce7fb;
  --navy-50:   #eef4ff;

  --teal-600:  #0d7377;
  --teal-500:  #0f9499;
  --teal-100:  #ccf2f4;
  --teal-50:   #e6fbfc;

  --primary:        var(--navy-600);
  --primary-hover:  var(--navy-700);
  --primary-active: var(--navy-900);
  --primary-soft:   var(--navy-50);

  --danger:         #c5172a;
  --danger-hover:   #a50e20;
  --danger-soft:    #fff0f1;
  --danger-border:  #fbbfc5;

  --warning:        #b45309;
  --warning-soft:   #fffbeb;
  --warning-border: #fcd34d;

  --success:        #047857;
  --success-soft:   #ecfdf5;
  --success-border: #6ee7b7;

  --text:      #0a1020;
  --text-2:    #2d3a52;
  --text-3:    #5c6a85;
  --text-4:    #96a3bc;

  --border:    #cdd5e4;
  --border-2:  #dde4f0;
  --border-3:  #ecf0f8;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(6,14,36,.05);
  --shadow-sm: 0 2px 8px rgba(6,14,36,.07), 0 1px 2px rgba(6,14,36,.04);
  --shadow:    0 4px 20px rgba(6,14,36,.09), 0 1px 4px rgba(6,14,36,.05);
  --shadow-lg: 0 8px 32px rgba(6,14,36,.12), 0 2px 8px rgba(6,14,36,.06);

  --transition: 140ms cubic-bezier(.4,0,.2,1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(32,80,181,.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(13,115,119,.07) 0%, transparent 55%);
}

/* ── LAYOUT ── */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px 56px;
}

/* ── APP HEADER ── */
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 22px;
}

.app-header .logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-500) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(26,61,138,.30);
}

.app-header .logo-cross {
  width: 22px;
  height: 22px;
  position: relative;
}

.app-header .logo-cross::before,
.app-header .logo-cross::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 2px;
}

.app-header .logo-cross::before {
  width: 6px; height: 22px;
  left: 8px; top: 0;
}

.app-header .logo-cross::after {
  width: 22px; height: 6px;
  left: 0; top: 8px;
}

.app-header-text { flex: 1; }

.app-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -.4px;
  line-height: 1.2;
}

.app-header p {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── TABS NAV ── */
.tabs-wrapper {
  margin-bottom: 22px;
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  text-decoration: none;
  padding: 8px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border: none;
  background: transparent;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab svg, .tab .tab-icon {
  width: 14px;
  height: 14px;
  opacity: .6;
  flex-shrink: 0;
}

.tab:hover:not(.active) {
  color: var(--text-2);
  background: var(--bg-alt);
}

.tab.active {
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-500) 100%);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(26,61,138,.28);
}

.tab.active svg, .tab.active .tab-icon { opacity: 1; }

/* ── STATS BAR ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy-500), var(--teal-500));
  border-radius: 1px 1px 0 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.stat:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat:hover::before { opacity: 1; }

.stat strong {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-700);
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 3px;
  font-family: 'IBM Plex Mono', monospace;
}

.stat span {
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 16px; }

.card h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .9px;
  margin-bottom: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2 .h2-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-3);
}

/* ── LAYOUT GRID ── */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.layout.two-one {
  grid-template-columns: 1.5fr 1fr;
}

/* ── FORM ELEMENTS ── */
label {
  display: block;
}

label > span, .field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 5px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-400);
  box-shadow: 0 0 0 3px rgba(74,120,212,.14);
}

input::placeholder, textarea::placeholder { color: var(--text-4); }
input[disabled] { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }

textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6a85' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.2fr 100px 100px 1fr;
  gap: 10px;
  align-items: end;
}

.form-grid.compact {
  grid-template-columns: 1fr 90px 90px 1fr;
}

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

/* ── BUTTONS ── */
button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-500) 100%);
  color: white;
  width: auto;
  letter-spacing: -.1px;
  box-shadow: 0 1px 3px rgba(6,14,36,.12);
}

button:hover, .button-link:hover {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-700) 100%);
  box-shadow: 0 4px 14px rgba(26,61,138,.24);
  transform: translateY(-1px);
}

button:active, .button-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(6,14,36,.12);
}

button.danger {
  background: var(--danger);
  box-shadow: 0 1px 3px rgba(197,23,42,.15);
}

button.danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 12px rgba(197,23,42,.22);
}

.secondary-link {
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.secondary-link:hover {
  background: var(--surface-2);
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.archive-btn {
  background: #d97706;
  box-shadow: 0 1px 3px rgba(217,119,6,.15);
}

.archive-btn:hover {
  background: #b45309;
  box-shadow: 0 4px 12px rgba(217,119,6,.22);
}

/* ── ACTIONS ── */
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.actions form { width: auto; }

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form input { flex: 1 1 150px; }

/* ── STACK / SPACING ── */
.stack > * + * { margin-top: 10px; }
.top-gap { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }

/* ── ITEM CARDS ── */
.item {
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 12px 15px;
  background: var(--surface-2);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.item strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.compact-item { padding: 9px 13px; }

/* ── TEXT UTILITIES ── */
.muted {
  color: var(--text-3);
  font-size: 12.5px;
}

code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11.5px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--navy-600);
  font-weight: 500;
}

/* ── ALERTS ── */
.alert {
  padding: 11px 15px;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn .18s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-success {
  background: var(--success-soft);
  color: #065f46;
  border-color: var(--success-border);
}

.alert-success::before { content: '✓'; font-weight: 800; color: var(--success); }

.alert-error {
  background: var(--danger-soft);
  color: #9b1120;
  border-color: var(--danger-border);
}

.alert-error::before { content: '!'; font-weight: 800; }

.error {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 5px;
  font-weight: 500;
}

/* ── PRODUCT BOX (GTIN IDENTIFIÉ) ── */
.product-box {
  margin-top: 12px;
  padding: 15px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy-50) 0%, #ddeaff 100%);
  border: 1.5px solid var(--navy-100);
}

.product-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--navy-500);
  margin-bottom: 8px;
}

.product-box-header .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

.product-box strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy-900);
  display: block;
  margin-top: 4px;
}

/* ── UNKNOWN BOX ── */
.unknown-box {
  padding: 15px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--warning-border);
  background: var(--warning-soft);
}

.unknown-box-header {
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 5px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.unknown-box-header::before {
  content: '⚠';
  font-size: 14px;
}

/* ── STATUS BADGES ── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status.open     { background: #dcfce7; color: #166534; }
.status.closed   { background: #fee2e2; color: #991b1b; }
.status.archived { background: #f3f4f6; color: #6b7280; }

/* ── CHIP ── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--navy-50);
  color: var(--navy-600);
  border: 1px solid var(--navy-100);
}

/* ── INLINE RADIO CHOICE ── */
.inline-choice-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(238,244,255,.85) 0%, rgba(255,255,255,.96) 100%);
}

.choice-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  align-self: center;
  min-width: 40px;
}

.choice-option {
  display: inline-flex;
  position: relative;
  margin: 0;
  width: auto;
  cursor: pointer;
}

.choice-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.choice-option span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}

.choice-option span::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  box-shadow: inset 0 0 0 3px #fff;
  transition: all var(--transition);
  flex-shrink: 0;
}

.choice-option input[type="radio"]:checked + span {
  border-color: var(--navy-600);
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-500) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(26,61,138,.22);
}

.choice-option input[type="radio"]:checked + span::before {
  background: #fff;
  border-color: #fff;
  box-shadow: inset 0 0 0 4px var(--navy-600);
}

/* ── PERIOD ROW ── */
.period-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── SEARCH META ── */
.search-meta {
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* ── COMPACT SCROLL AREA ── */
.compact-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── DIVIDER ── */
.manual-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── SECTION HEADINGS INSIDE CARDS ── */
.manual-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-700);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

/* ── TABLE (open_boxes) ── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 13.5px;
}

th {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border-2);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid var(--border-3);
  padding: 10px 12px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--surface-2); }

.product-name-td {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

/* ── DIALOG ── */
dialog {
  border: none;
  border-radius: var(--radius-xl);
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  box-shadow: var(--shadow-lg);
  outline: none;
}

dialog::backdrop {
  background: rgba(6,14,36,.48);
  backdrop-filter: blur(2px);
}

.dialog-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border-2);
}

.dialog-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
  border: none;
  padding: 0;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}

.dialog-body {
  padding: 18px 22px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border-3);
}

/* ── PAGE TOPBAR (open_boxes) ── */
.page-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -.3px;
}

/* ── BACK LINK ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.back-link:hover {
  color: var(--text-2);
  border-color: var(--border);
  background: var(--surface-2);
}

.back-link::before { content: '←'; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .layout, .stats { grid-template-columns: 1fr; }
  .layout.two-one { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .tabs { border-radius: var(--radius-lg); }
  .tab { padding: 8px 13px; font-size: 12.5px; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .period-row { grid-template-columns: 1fr; }
  .app-header h1 { font-size: 16px; }
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ── FOCUS ── */
:focus-visible {
  outline: 2px solid var(--navy-400);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── PRINT ── */
@media print {
  .tabs-wrapper, .actions, button, .back-link { display: none; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}

/* ── BOXLOG LOGO ─────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 20px;
}

.boxlog-logo {
  flex-shrink: 0;
}

.boxlog-logo-inner {
  position: relative;
  width: 48px;
  height: 44px;
  display: flex;
  align-items: flex-end;
}

/* La boîte */
.boxlog-box {
  width: 36px;
  height: 34px;
  position: relative;
  flex-shrink: 0;
}

.boxlog-box-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(135deg, var(--navy-500) 0%, var(--navy-400) 100%);
  border-radius: 3px 3px 0 0;
  /* rabat ouvert légèrement */
  transform-origin: bottom center;
  transform: perspective(40px) rotateX(-8deg);
}

.boxlog-box-top::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 100%;
  background: rgba(255,255,255,.18);
  border-radius: 2px;
}

.boxlog-box-front {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 26px;
  background: linear-gradient(160deg, var(--navy-700) 0%, var(--navy-900) 100%);
  border-radius: 0 0 4px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(6,14,36,.25);
}

/* Croix médicale sur la boîte */
.boxlog-cross {
  width: 12px;
  height: 12px;
  position: relative;
}

.boxlog-cross::before,
.boxlog-cross::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 1px;
  opacity: .9;
}

.boxlog-cross::before {
  width: 3px; height: 12px;
  left: 4.5px; top: 0;
}

.boxlog-cross::after {
  width: 12px; height: 3px;
  left: 0; top: 4.5px;
}

/* Laser scanner */
.boxlog-scanner {
  position: absolute;
  right: 0;
  bottom: 6px;
  width: 14px;
  height: 22px;
  background: linear-gradient(180deg, var(--teal-600) 0%, var(--teal-500) 100%);
  border-radius: 2px 4px 4px 2px;
  box-shadow: 0 2px 6px rgba(13,115,119,.35);
}

.boxlog-scanner::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--teal-500));
}

.boxlog-scanner::after {
  content: '';
  position: absolute;
  top: 4px; left: 3px; right: 3px; bottom: 4px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 1px;
}

/* Wordmark */
.boxlog-wordmark {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

.boxlog-word-box {
  color: var(--navy-900);
}

.boxlog-word-log {
  color: var(--teal-600);
}

/* ── Modale mouvement centrée ── */
#mvtModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
