/**
 * LogiFunus portal : light B&W theme + layout safety net
 * Ensures auth/login + app remain usable even if base CSS fails to load.
 */
@import url("https://fonts.cdnfonts.com/css/century-gothic");

:root {
  --lf-bg: #ffffff;
  --lf-card: #ffffff;
  --lf-ink: #111111;
  --lf-muted: #333333;
  --lf-line: #111111;
  --lf-soft: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--lf-bg) !important;
  color: var(--lf-ink) !important;
  font-family: "Century Gothic", CenturyGothic, AppleGothic, Manrope, system-ui, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

#app, #app.hidden, .main, .content, .topbar {
  background: var(--lf-bg) !important;
  color: var(--lf-ink) !important;
}

.hidden, [hidden] { display: none !important; }

/* ---------- Auth / login ---------- */
.auth-screen {
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 32px 16px !important;
  background: var(--lf-bg) !important;
}
.auth-card {
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
  background: var(--lf-card) !important;
  color: var(--lf-ink) !important;
  border: 1px solid var(--lf-line) !important;
  padding: 36px 32px !important;
  box-shadow: 0 8px 30px rgba(0,0,0,.06) !important;
}
.auth-card .brand {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  margin-bottom: 22px !important;
}
.auth-card .brand-logo {
  display: block !important;
  height: 40px !important;
  width: auto !important;
  max-width: 180px !important;
}
.auth-title {
  margin: 0 0 8px !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--lf-ink) !important;
  letter-spacing: -0.02em;
}
.auth-sub {
  margin: 0 0 22px !important;
  color: var(--lf-muted) !important;
  font-size: 0.92rem !important;
  line-height: 1.5 !important;
}
.auth-card .field {
  display: block !important;
  margin-bottom: 14px !important;
}
.auth-card .field label {
  display: block !important;
  margin-bottom: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  color: var(--lf-muted) !important;
}
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input:not([type="checkbox"]):not([type="radio"]),
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
input:not([type="checkbox"]):not([type="radio"]):not(.ts-hidden-accessible):not(.lm-select-native),
select:not(.ts-hidden-accessible):not(.lm-select-native):not(.ts-done),
.input {
  width: 100% !important;
  height: 44px !important;
  padding: 10px 12px !important;
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #111 !important;
  border-radius: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  font-size: 15px !important;
  outline: none !important;
  box-shadow: none !important;
}
textarea,
.field textarea,
.auth-card textarea,
.line-more-grid textarea {
  width: 100% !important;
  height: auto !important;
  min-height: 72px !important;
  padding: 10px 12px !important;
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #111 !important;
  border-radius: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  font-size: 15px !important;
  outline: none !important;
  box-shadow: none !important;
  resize: vertical !important;
  line-height: 1.4 !important;
  overflow: auto !important;
}
.auth-remember input[type="checkbox"],
input[type="checkbox"],
input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  accent-color: #111 !important;
  cursor: pointer !important;
  display: inline-block !important;
  position: relative !important;
  vertical-align: middle !important;
  box-shadow: none !important;
  outline: none !important;
}
.auth-card input:focus {
  border-color: #111 !important;
  box-shadow: 0 0 0 2px rgba(0,0,0,.08) !important;
}
.auth-remember {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 4px 0 18px !important;
  font-size: 13px !important;
  color: var(--lf-muted) !important;
  cursor: pointer;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.auth-remember input { width: 16px !important; height: 16px !important; }
.auth-remember span { opacity: .75; }
.auth-switch {
  margin-top: 16px !important;
  text-align: center !important;
  font-size: 13.5px !important;
  color: var(--lf-muted) !important;
}
.auth-switch a, .auth-back {
  color: #111 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  cursor: pointer;
}
.auth-back {
  display: inline-block !important;
  margin-top: 14px !important;
  width: 100% !important;
  text-align: center !important;
  font-size: 13px !important;
}
#authMsg {
  margin-bottom: 12px;
  font-size: 13px;
  color: #b71c1c;
}

/* ---------- Buttons (fix thin black bar) ---------- */
.btn,
button.btn,
.btn-primary,
.btn-ghost,
.btn-secondary,
.btn-light {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 12px 18px !important;
  line-height: 1.2 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}
.btn-block, .btn.btn-block, #aBtn {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
}
.btn-primary, #aBtn {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #000 !important;
}
.btn-primary:hover, #aBtn:hover {
  background: #222 !important;
}
.btn-ghost, .btn-light, .btn-secondary {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #111 !important;
}
.btn-sm {
  min-height: 34px !important;
  padding: 8px 12px !important;
  font-size: 11px !important;
}

/* ---------- App shell ---------- */
.sidebar, aside.sidebar {
  background: #ffffff !important;
  color: #111 !important;
  border-right: 1px solid var(--lf-line) !important;
}
.sidebar .brand {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  position: relative !important;
  overflow: visible !important;
  min-height: 52px !important;
  padding: 12px 14px 10px !important;
}
.sidebar .brand-logo,
.sidebar .brand-logo-full,
.sidebar .brand img {
  height: auto !important;
  width: auto !important;
  max-height: 38px !important;
  max-width: 168px !important;
  display: block !important;
  flex-shrink: 0 !important;
  object-fit: contain !important;
  object-position: left center !important;
}
.sidebar .brand-mark {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0 !important;
  position: absolute !important;
  left: -9999px !important;
}
#app.sidebar-collapsed .sidebar .brand {
  justify-content: center !important;
  padding: 12px 0 16px !important;
}
#app.sidebar-collapsed .sidebar .brand-logo,
#app.sidebar-collapsed .sidebar .brand-logo-full,
#app.sidebar-collapsed .sidebar .brand img {
  display: none !important;
}
#app.sidebar-collapsed .sidebar .brand-mark {
  display: flex !important;
  visibility: visible !important;
  position: static !important;
  left: auto !important;
  width: 36px !important;
  height: 36px !important;
  font-size: 12px !important;
  align-items: center !important;
  justify-content: center !important;
  background: #111 !important;
  color: #fff !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  flex-shrink: 0 !important;
  overflow: visible !important;
}
.sidebar-close-mobile {
  display: none !important;
}
@media (max-width: 980px) {
  .sidebar.open .sidebar-close-mobile {
    display: flex !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #e5e5e5 !important;
    background: #fff !important;
    color: #111 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }
}
.nav-back-btn.is-disabled {
  opacity: 0.35 !important;
  pointer-events: none !important;
}
.nav-back-btn:not(.is-disabled) {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.sidebar a, .sidebar .nav-item, aside.sidebar a {
  color: #333 !important;
}
.sidebar a.active, .sidebar .nav-item.active,
aside.sidebar a.active {
  background: transparent !important;
  color: #111 !important;
}
.lf-acc-items .nav-item.active,
#portalSwitch .lf-acc-items .nav-item.active {
  background: transparent !important;
  color: #111 !important;
  font-weight: 800 !important;
  box-shadow: inset 2px 0 0 #111 !important;
}
.topbar {
  background: #fff !important;
  border-bottom: 1px solid var(--lf-line) !important;
  z-index: 11000 !important;
  position: sticky !important;
}
.card, .stat-card, .panel, .modal, .modal-content, .table-wrap {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid var(--lf-line) !important;
  border-radius: 0 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
}
h1, h2, h3, h4, .title, strong, .crumb { color: #111 !important; }
p, .muted, .cell-soft { color: var(--lf-muted) !important; }

input, select, textarea {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #ccc !important;
  border-radius: 0 !important;
}

/* Notifications panel on auth shouldn't steal layout */
#auth ~ #notifPanel,
.auth-screen + #notifPanel,
body > #notifPanel {
  /* keep default when app open */
}

/* Notifications: hidden until opened (avoid leak on login screen) */
.notif-backdrop { display: none !important; }
.notif-backdrop.open { display: block !important; }
.notif-panel {
  display: none !important;
  position: fixed !important;
  top: 68px !important;
  right: 16px !important;
  width: min(360px, calc(100vw - 32px)) !important;
  background: #fff !important;
  border: 1px solid #e5e5e5 !important;
  z-index: 200 !important;
  box-shadow: 0 12px 40px rgba(0,0,0,.12) !important;
}
.notif-panel.open { display: block !important; }

/* Funeral module helpers */
.lf-page-head{display:flex;align-items:flex-start;justify-content:flex-start;gap:16px;margin-bottom:18px;flex-wrap:wrap;max-width:1120px}
.lf-page-head .lf-actions{margin-left:auto}
.lf-page-head .lf-actions:empty{display:none}
.lf-page-head h2{margin:0;font-size:1.35rem}
.lf-page-head p{margin:6px 0 0;color:#666;font-size:.92rem}
.lf-badge{display:inline-flex;align-items:center;padding:3px 8px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;border:1px solid #111;background:#fff;color:#111}
.lf-badge.warn{background:#111;color:#fff}
.lf-badge.ok{background:#e8f5e9;border-color:#2e7d32;color:#1b5e20}
.lf-badge.danger{background:#ffebee;border-color:#c62828;color:#b71c1c}
.lf-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.lf-grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}
@media(max-width:900px){.lf-grid2,.lf-grid3{grid-template-columns:1fr}}
.lf-countdown{padding:12px 14px;border:1px solid #111;background:#fff;margin-bottom:14px;font-weight:700}
.lf-countdown.soon{background:#111;color:#fff}
.lf-tabs{display:flex;gap:0;border-bottom:1px solid #e5e5e5;margin-bottom:16px;flex-wrap:wrap}
.lf-tab{padding:10px 14px;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border:none;background:transparent;color:#666;cursor:pointer;border-bottom:2px solid transparent}
.lf-tab.active{color:#111;border-bottom-color:#111}
.lf-empty{padding:40px 20px;text-align:center;color:#888;border:1px dashed #ccc;background:#fff}
.lf-table{width:100%;border-collapse:collapse;background:#fff}
.lf-table th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#666;padding:12px;border-bottom:1px solid #e5e5e5;background:#fafafa}
.lf-table td{padding:12px;border-bottom:1px solid #eee;font-size:13.5px;color:#111;vertical-align:middle}
.lf-table tr{cursor:pointer}
.lf-table tr:hover td{background:#f7f7f7}
.lf-actions{display:flex;gap:8px;flex-wrap:wrap}
.card,.btn,button,input,select,textarea,.modal,.badge{border-radius:0!important}

/* ---------- Nuclear: kill LogiDrink orange + rounded corners ---------- */
:root,
html,
body,
#app,
.auth-screen {
  --accent: #111111 !important;
  --accent-deep: #000000 !important;
  --accent-soft: #f0f0f0 !important;
  --orange: #111111 !important;
  --orange-deep: #000000 !important;
  --orange-soft: #f0f0f0 !important;
  --orange-glow: rgba(17, 17, 17, 0.18) !important;
  --navy: #111111 !important;
  --navy-2: #111111 !important;
  --navy-3: #111111 !important;
  --navy-ink: #111111 !important;
  --blue: #111111 !important;
  --blue-bg: #f0f0f0 !important;
  --green: #111111 !important;
  --green-bg: #f0f0f0 !important;
  --amber: #111111 !important;
  --amber-bg: #f0f0f0 !important;
  --ink: #111111 !important;
  --ink-2: #111111 !important;
  --muted: #333333 !important;
  --soft: #333333 !important;
  --line: #111111 !important;
  --line-2: #111111 !important;
  --bg: #ffffff !important;
  --bg-soft: #ffffff !important;
  --surface: #ffffff !important;
  --radius: 0 !important;
  --radius-sm: 0 !important;
  --radius-md: 0 !important;
  --radius-lg: 0 !important;
  --radius-xl: 0 !important;
}

*, *::before, *::after {
  border-radius: 0 !important;
}

.brand-mark,
.auth-card .brand-mark {
  background: #111 !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
  width: 36px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  letter-spacing: .04em !important;
}
#app:not(.sidebar-collapsed) .sidebar .brand-mark {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

.brand-name,
.brand-name b,
.brand-name span,
.auth-card .brand-name,
.auth-card .brand-name b,
.auth-title,
h1, h2, h3 {
  color: #111 !important;
}

.mfa-provider,
.mfa-opt,
[data-mfa-provider],
.auth-mfa-card .choice,
.auth-mfa-card .opt,
.auth-mfa-card button.selected,
.auth-mfa-card .selected {
  border-color: #111 !important;
  background: #fff !important;
  color: #111 !important;
  box-shadow: none !important;
}

.auth-mfa-card .selected,
.mfa-provider.is-selected,
.mfa-opt.active {
  background: #f5f5f5 !important;
  border-color: #111 !important;
}

.mfa-apps {
  display: grid !important;
  gap: 10px !important;
  margin: 0 0 16px !important;
}
.mfa-app-btn {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  padding: 14px 16px !important;
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #ccc !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}
.mfa-app-btn strong { display: block !important; color: #111 !important; }
.mfa-app-btn span { color: #666 !important; font-size: 12px !important; }
.mfa-app-btn.active,
.mfa-app-btn:hover {
  border-color: #111 !important;
  background: #f5f5f5 !important;
  color: #111 !important;
}
.mfa-hint a { color: #111 !important; font-weight: 700 !important; text-decoration: underline !important; }
.mfa-hint { color: #666 !important; }

.btn-primary,
#aBtn,
.btn.accent {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
  box-shadow: none !important;
}
.sidebar .nav-item.active,
#portalSwitch .nav-item.active {
  background: transparent !important;
  color: #111 !important;
}

.auth-back,
.auth-switch a,
a.auth-back {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #111 !important;
  border-radius: 0 !important;
  padding: 10px 14px !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}

.stat-val.accent,
[style*="color:var(--orange)"],
[style*="color: var(--orange)"] {
  color: #111 !important;
}

.bar-fill,
.toprow:first-child .rank {
  background: #111 !important;
  color: #fff !important;
}

/* Hide drink leftovers if any CSS still paints orange squares */
.brand-mark:empty { display: none !important; }

/* ---------- Force square UI (nav pills, search, tabs, tom-select) ---------- */
.nav-grp-btn,
.nav-item,
.nav-item.active,
.sidebar .nav-item,
.topbar-search,
.topbar-search input,
#globalSearch,
.search-box,
.lf-tab,
.lf-tabs,
.lf-badge,
.account-box,
.account-card,
.user-box,
#logout,
.btn,
button,
.card,
.modal,
.modal-content,
.auth-card,
.kpi,
.stat-card,
.dash-hero,
.ts-wrapper,
.ts-control,
.ts-dropdown,
.tom-select .ts-control,
.settings-nav a,
.settings-nav button,
.page-tabs a,
.page-tabs button,
.hub-tab,
.pill,
.chip {
  border-radius: 0 !important;
}

#gotoLivreur,
.ld-top-livreur {
  display: none !important;
}
#hubSubnav.page-subnav,
.page-subnav {
  display: none !important;
}
#portalSwitch.portal-switch.lf-acc {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}
#portalSwitch.portal-switch.lf-acc .lf-acc-grp {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
}

.settings-save-bar {
  position: static !important;
  bottom: auto !important;
  margin: 20px 0 0 !important;
  padding: 16px !important;
  background: #f5f5f5 !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 0 !important;
  justify-content: flex-start !important;
  box-shadow: none !important;
}
.settings-save-bar .btn-primary {
  min-width: 0 !important;
  box-shadow: none !important;
}
.settings-pane,
.settings-card,
.settings-body,
.card-body {
  padding: 16px !important;
  overflow: visible !important;
}

/* Invoice lines: align qty/price/vat with designation row */
table.lines tbody td {
  vertical-align: top !important;
}
table.lines td.line-prod {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}
table.lines td.line-prod select,
table.lines td.line-prod input,
table.lines td.line-prod textarea {
  width: 100% !important;
  margin: 0 !important;
}
table.lines td.num input,
table.lines td.num select {
  width: 100% !important;
  min-width: 64px !important;
}

/* Tom Select: kill empty left slot / weird inner bar */
.ts-wrapper.single .ts-control {
  padding: 8px 10px !important;
  gap: 0 !important;
}
.ts-wrapper.single .ts-control > div,
.ts-wrapper.single .ts-control .item {
  margin: 0 !important;
  padding: 0 !important;
}
.ts-wrapper .ts-control .ts-clear-button,
.ts-control .clear-button {
  display: none !important;
}
.ts-dropdown,
.ts-dropdown .option {
  border-radius: 0 !important;
}

.lf-empty,
.rich-empty,
.empty {
  border-radius: 0 !important;
}

/* Modales : uniquement .open, toujours centrées */
.overlay {
  opacity: 0 !important;
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.overlay.open,
body > .overlay.open {
  opacity: 1 !important;
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
  top: 60px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px 16px !important;
}
.overlay.open .modal,
body > .overlay.open > .modal {
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0 auto !important;
}

.lf-pane { display: block; }
.lf-pane[hidden] { display: none !important; }
.lf-tabs { position: sticky; top: 0; background: #fff; z-index: 3; }
.lf-stepper { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.lf-step {
  border: 1px solid #111; background: #fff; color: #111; padding: 8px 12px;
  font-size: 12px; font-weight: 700; cursor: pointer; text-align: left;
}
.lf-step.on { background: #111; color: #fff; border-color: #111; }
.lf-table.lf-static tr { cursor: default; }
.lf-help { color: #666; font-size: 13px; margin: 0 0 12px; }
.lf-trace { position: relative; padding-left: 18px; }
.lf-trace::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: #111; }
.lf-trace-item { position: relative; padding: 0 0 18px 8px; }
.lf-trace-item:last-child { padding-bottom: 0; }
.lf-trace-dot { position: absolute; left: -16px; top: 6px; width: 8px; height: 8px; background: #111; }

#portalSwitch .portal-pill::before { display: none !important; content: none !important; }

/* ---------- Content centered, no huge header gap ---------- */
.main > .content, .content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#view, .page-body {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}
#hubSubnav.page-subnav,
.page-subnav {
  display: none !important;
}
.page-head, .dash-hero, .card-head, .lf-page-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 12px 20px !important;
  flex-wrap: wrap !important;
}
.page-head > .actions,
.page-head-actions,
.dash-hero-actions,
.card-head > .actions,
.card-actions,
.lf-page-head .lf-actions,
#topActions {
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.page-head-actions:empty,
.dash-hero-actions:empty,
.card-actions:empty,
.lf-actions:empty,
#topActions:empty {
  display: none !important;
}

/* ---------- Icons always ink on light squares ---------- */
.nav-ic,
.page-subnav .nav-ic,
.page-subnav .page-tab .nav-ic,
#nav .nav-ic,
.settings-nav button svg,
.qt-ico,
.kpi-ico {
  color: #111 !important;
  background: #f0f0f0 !important;
}
.lf-acc-items .nav-item.active .nav-ic,
#portalSwitch .nav-item.active .nav-ic {
  background: #f0f0f0 !important;
  color: #111 !important;
}
.nav-ic svg,
.page-subnav .nav-ic svg,
.qt-ico svg,
.kpi-ico svg,
.settings-nav button svg,
.lf-acc-items .nav-item.active .nav-ic svg {
  stroke: currentColor !important;
  fill: none !important;
  color: #111 !important;
  opacity: 1 !important;
  display: block !important;
  width: 16px !important;
  height: 16px !important;
}
.qt-ico { --c: #111 !important; }
.quick-tile .qt-ico,
.kpi .kpi-ico {
  background: #f0f0f0 !important;
  color: #111 !important;
}

/* ---------- Checkboxes: black box, white inner when checked ---------- */
input[type="checkbox"],
input[type="radio"],
.bulk-send-modal input[type="checkbox"],
.bulk-send-modal input[type="radio"],
.overlay input[type="checkbox"],
.overlay input[type="radio"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: relative !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  border: 2px solid #111 !important;
  background: #fff !important;
  accent-color: #111 !important;
  box-shadow: none !important;
  outline: none !important;
}
input[type="radio"] { border-radius: 50% !important; }
input[type="checkbox"]:checked,
.bulk-send-modal input[type="checkbox"]:checked {
  background: #111 !important;
  border-color: #111 !important;
}
input[type="checkbox"]:checked::after,
.bulk-send-modal input[type="checkbox"]:checked::after {
  content: "" !important;
  position: absolute !important;
  display: block !important;
  left: 5px !important;
  top: 1px !important;
  width: 5px !important;
  height: 9px !important;
  border: solid #fff !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
  box-sizing: border-box !important;
}
input[type="radio"]:checked,
.bulk-send-modal input[type="radio"]:checked {
  background: #fff !important;
  border-color: #111 !important;
  box-shadow: inset 0 0 0 4px #111 !important;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
.bulk-send-modal input[type="checkbox"]:focus,
.bulk-send-modal input[type="radio"]:focus {
  outline: none !important;
  border-color: #111 !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111 !important;
}
.bulk-send-modal .bulk-chan label:has(input:checked),
.bulk-send-modal .bulk-chan label.is-on,
.bulk-send-modal .dest-modes label:has(input:checked),
.bulk-send-modal .dest-modes label.is-on {
  border-color: #111 !important;
  background: #f5f5f5 !important;
}
.bulk-send-modal {
  max-width: 560px !important;
  margin: 0 auto !important;
}

/* ---------- Black / white only: kill navy, blue, leftover gray-blue ---------- */
.panel-dark,
.rich-empty .panel-dark {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid #111 !important;
  box-shadow: none !important;
}
.panel-dark h4,
.panel-dark h3,
.panel-dark h2 {
  color: #fff !important;
}
.panel-dark p,
.panel-dark .lm-arr {
  color: rgba(255,255,255,.78) !important;
  border-color: rgba(255,255,255,.78) !important;
}
.panel-dark .btn,
.panel-dark .btn-primary {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #fff !important;
}
.quick-tile,
.rich-empty .quick-tile {
  background: #fff !important;
  border: 1px solid #111 !important;
  box-shadow: none !important;
}
.quick-tile:hover {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
  transform: none !important;
}
.quick-tile:hover .qt-ico,
.quick-tile:hover b,
.quick-tile:hover span {
  background: #fff !important;
  color: #111 !important;
}
.badge,
.lf-badge,
.b-info, .badge.b-info,
.b-ok, .badge.b-ok,
.b-warn, .badge.b-warn,
.b-draft, .badge.b-draft,
.badge-navy {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #111 !important;
}
.b-red, .badge.b-red,
.lf-badge.warn,
.lf-badge.danger {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}
.kpi, .stat-card, .card, .rich-empty, .empty, .lf-empty {
  background: #fff !important;
  border-color: #111 !important;
  box-shadow: none !important;
}
.card-body > .rich-empty {
  border: none !important;
}

/* ---------- Tom Select / lm-select: one black frame, no inner ghost select ---------- */
select.ts-hidden-accessible,
.ts-hidden-accessible,
select.lm-select-native,
.lm-select-native,
.lm-select > select,
.ts-wrapper > select {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
}
.ts-wrapper,
.lm-select {
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
  border: 1px solid #111 !important;
  background: #fff !important;
}
.ts-wrapper.input-hidden .ts-control > input:not([type="checkbox"]):not([type="radio"]) {
  position: absolute !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  opacity: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.ts-control input:not([type="checkbox"]):not([type="radio"]),
.ts-wrapper input:not([type="checkbox"]):not([type="radio"]),
.ts-dropdown input:not([type="checkbox"]):not([type="radio"]),
.ts-dropdown .dropdown-input {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit !important;
  color: #111 !important;
}
.ts-wrapper .ts-control,
.tom-select .ts-control,
.lm-select-btn {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: #fff !important;
  color: #111 !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 8px 12px !important;
  width: 100% !important;
}
.lm-select.open .lm-select-btn,
.lm-select-btn:focus,
.ts-wrapper.focus .ts-control,
.ts-control:focus-within {
  border: none !important;
  box-shadow: none !important;
}
.ts-dropdown,
.lm-select-menu,
body > .lm-select-menu,
.overlay .lm-select-menu {
  border: 1px solid #111 !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
.ts-dropdown .dropdown-header,
.ts-dropdown .dropdown-input-wrap,
.ts-dropdown .dropdown-input,
.ts-dropdown-content::before {
  display: none !important;
}
.ts-dropdown .option,
.lm-select-opt {
  color: #111 !important;
  background: #fff !important;
  border-radius: 0 !important;
}
.ts-dropdown .option.active,
.ts-dropdown .option.selected,
.lm-select-opt.on,
.lm-select-opt:hover {
  background: #111 !important;
  color: #fff !important;
}

/* Options ligne (note / remise): cadre propre, plus de textarea coupée */
.line-more-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 88px !important;
  gap: 8px !important;
  align-items: stretch !important;
  overflow: visible !important;
  background: #fff !important;
  border: 1px solid #111 !important;
  padding: 10px !important;
}
.line-more-grid textarea {
  min-height: 72px !important;
  height: auto !important;
  resize: vertical !important;
}
.line-more-grid input[type="number"] {
  height: 44px !important;
  align-self: start !important;
}
.line-more > summary { color: #111 !important; }

/* Number fields: hide leaked spinners inside tight cells */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
input[type="number"] { -moz-appearance: textfield !important; appearance: textfield !important; }

/* ---------- Sidebar: no black block on sublinks, LF mark only when collapsed ---------- */
#app:not(.sidebar-collapsed) .sidebar .brand-mark,
#app:not(.sidebar-collapsed) aside.sidebar .brand-mark {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
#app.sidebar-collapsed .sidebar .brand-mark {
  display: flex !important;
  visibility: visible !important;
  position: static !important;
  left: auto !important;
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  opacity: 1 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  background: #111 !important;
  color: #fff !important;
}
.sidebar .brand img,
.sidebar .brand-logo,
.sidebar .brand-logo-full {
  height: auto !important;
  width: auto !important;
  max-height: 40px !important;
  max-width: 176px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}
.lf-acc-items .nav-item.active,
#portalSwitch .lf-acc-items .nav-item.active,
.sidebar .lf-acc-items .nav-item.active,
aside.sidebar .lf-acc-items .nav-item.active {
  background: transparent !important;
  color: #111 !important;
  border: none !important;
  box-shadow: inset 2px 0 0 #111 !important;
  font-weight: 800 !important;
}
.lf-acc-items .nav-item.active .nav-ic,
#portalSwitch .lf-acc-items .nav-item.active .nav-ic {
  background: #f0f0f0 !important;
  color: #111 !important;
}

/* Factures / devis : actions de ligne sans débordement */
.row-act {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  justify-content: flex-end !important;
  max-width: 280px;
}

