/* =====================================================================
   PSL Achats & Inventaire — interface calquée sur Odoo 18 (thème bleu)
   --primary / --secondary : définies dans Paramètres › Entreprise
   ===================================================================== */
:root {
  --primary: #1E5AA8;
  --secondary: #F59E0B;
  --primary-dark: color-mix(in srgb, var(--primary) 82%, #000);
  --primary-soft: color-mix(in srgb, var(--primary) 14%, #fff);
  --primary-softer: color-mix(in srgb, var(--primary) 7%, #fff);
  --body-bg: #F8F9FA;
  --white: #FFFFFF;
  --text: #495057;
  --heading: #212529;
  --muted: #6C757D;
  --border: #DEE2E6;
  --border-light: #E9ECEF;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --success: #28A745; --info: #17A2B8; --warning: #F0AD4E; --danger: #DC3545;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, "Noto Sans", Arial, sans-serif;
  --navbar-h: 46px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--body-bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { margin: 0; color: var(--heading); font-weight: 500; }
small { font-size: 12px; }
.ico { flex: none; display: inline-block; vertical-align: middle; }
.o-muted, .muted { color: var(--muted); }
[hidden] { display: none !important; }

/* =====================================================================
   BARRE DE NAVIGATION
   ===================================================================== */
.o-navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: stretch; height: var(--navbar-h);
  background: var(--primary); border-bottom: 1px solid var(--primary-dark);
  color: rgba(255,255,255,.9); padding: 0 4px 0 0;
}
.o-nav-btn, .o-nav-entry {
  display: inline-flex; align-items: center; height: var(--navbar-h);
  padding: 0 9px; background: transparent; border: 0; color: rgba(255,255,255,.9);
  font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.o-nav-btn:hover, .o-nav-entry:hover, .o-dd.open > .o-nav-btn, .o-dd.open > .o-nav-entry {
  background: rgba(0,0,0,.12); color: #fff;
}
.o-apps-toggle { padding: 0 14px; }
.o-menu-brand {
  display: inline-flex; align-items: center; padding: 0 11px 0 2px;
  font-size: 16.8px; color: rgba(255,255,255,.9); white-space: nowrap;
}
.o-menu-brand:hover { color: #fff; }
.o-menu-sections { display: flex; align-items: stretch; flex: 1 1 0; min-width: 0; }
.o-systray { display: flex; align-items: center; margin-left: auto; gap: 2px; }
.o-company { font-size: 13px; padding: 0 10px; white-space: nowrap; text-transform: uppercase; opacity: .9; }
.o-user-btn { padding: 0 8px; }
.o-avatar {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 4px;
  background: var(--secondary); color: #fff; font-size: 12px; font-weight: 600;
}

/* menus déroulants (navbar et ailleurs) */
.o-dd { position: relative; display: flex; }
.o-dd-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 1000;
  min-width: 180px; max-height: calc(100vh - 60px); overflow-y: auto;
  padding: 8px 0; background: #fff; border: 1px solid rgba(0,0,0,.15);
  border-radius: 0 0 4px 4px; box-shadow: 0 6px 12px rgba(0,0,0,.18); color: var(--heading);
}
.o-dd.open > .o-dd-menu { display: block; }
.o-dd-right > .o-dd-menu { left: auto; right: 0; min-width: 240px; }
.o-dd-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 20px; min-height: 30px;
  color: var(--heading); white-space: nowrap; font-size: 14px;
}
.o-dd-item:hover, .o-dd-item:focus { background: var(--gray-200); color: var(--heading); outline: none; }
.o-dd-item.active { background: var(--primary-soft); }
.o-dd-grouped { padding-left: 32px; }
.o-dd-header { padding: 8px 20px 2px; font-size: 12px; font-weight: 700; color: var(--heading); white-space: nowrap; }
.o-dd-divider { height: 0; margin: 6px 0; border-top: 1px solid var(--border-light); }
.o-dd-user { display: flex; flex-direction: column; padding: 4px 20px 6px; }
.o-dd-user small { color: var(--muted); }
.o-app-entry { padding: 6px 20px; }
.o-app-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; color: #fff; }

/* =====================================================================
   PANNEAU DE CONTRÔLE
   ===================================================================== */
.o-control-panel {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(280px, 520px) minmax(0,1fr);
  align-items: center; gap: 8px 16px; padding: 8px 16px;
  background: #fff; border-bottom: 1px solid var(--border);
}
.o-cp-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.o-cp-buttons { display: flex; gap: 4px; flex: none; }
.o-cp-center { min-width: 0; }
.o-cp-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.o-breadcrumb { min-width: 0; line-height: 1.25; }
.o-bc-current { font-size: 16.8px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-breadcrumb-multi .o-bc-current { font-size: 14px; color: var(--heading); }
.o-bc-parents { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-bc-sep { color: var(--muted); margin: 0 4px; }

/* recherche */
.o-searchview {
  position: relative; display: flex; align-items: center; height: 35px;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
}
.o-searchview:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.o-search-icon { display: grid; place-items: center; width: 32px; color: var(--muted); flex: none; }
.o-search-facets { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.o-facet {
  display: inline-flex; align-items: stretch; flex: none; max-width: 60%;
  background: var(--gray-200); border-radius: 3px; font-size: 12.5px; overflow: hidden;
}
.o-facet-icon { display: grid; place-items: center; padding: 0 5px; background: var(--primary); color: #fff; }
.o-facet-label { padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--heading); }
.o-facet-remove { display: grid; place-items: center; padding: 0 5px; color: var(--muted); }
.o-facet-remove:hover { color: var(--danger); }
.o-search-input { flex: 1; min-width: 80px; height: 100%; border: 0; outline: 0; padding: 0 6px; font: inherit; background: transparent; }
.o-search-toggle {
  display: grid; place-items: center; width: 32px; height: 100%; flex: none;
  border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--heading); cursor: pointer;
  border-radius: 0 4px 4px 0;
}
.o-search-toggle:hover { background: var(--gray-200); }
.o-search-panel {
  display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 90;
  padding: 12px 16px; background: #fff; border: 1px solid rgba(0,0,0,.15); border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,.15);
}
.o-searchview.panel-open .o-search-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; }
.o-search-panel h4 { font-size: 13px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.o-search-panel a { display: block; padding: 3px 0; color: var(--heading); }
.o-search-panel a:hover { color: var(--primary); }
.o-search-panel a.selected::before { content: "✓ "; color: var(--primary); }

/* pagination */
.o-pager { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text); }
.o-btn-group { display: inline-flex; }
.o-btn-group .o-btn { border-radius: 0; }
.o-btn-group .o-btn:first-child { border-radius: 4px 0 0 4px; }
.o-btn-group .o-btn:last-child { border-radius: 0 4px 4px 0; margin-left: 1px; }

/* =====================================================================
   BOUTONS, BADGES, NOTIFICATIONS
   ===================================================================== */
.o-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 33px; padding: 5px 10px; border: 1px solid transparent; border-radius: 4px;
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1.5; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.o-btn:focus-visible, .o-input:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
.o-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.o-btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.o-btn-secondary { background: var(--gray-300); border-color: var(--gray-300); color: #343A40; }
.o-btn-secondary:hover { background: #CED4DA; border-color: #CED4DA; color: #212529; }
.o-btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.o-btn-outline:hover { background: var(--primary); color: #fff; }
.o-btn-link { background: transparent; color: var(--primary); padding-left: 4px; padding-right: 4px; }
.o-btn-link:hover { color: var(--primary-dark); text-decoration: underline; }
.o-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.o-btn-icon { width: 33px; padding: 0; }
.o-btn-block { width: 100%; }
.o-btn.active { background: #C1C9D0; border-color: #C1C9D0; }

.o-badge {
  display: inline-block; padding: 3px 9.75px; border-radius: 800px;
  font-size: 11.9px; font-weight: 500; line-height: 1.1; white-space: nowrap; color: #fff; background: #6C757D;
}
.o-badge-neutral { background: var(--gray-200); color: var(--heading); }
.o-badge-primary { background: var(--primary); }
.o-badge-info    { background: var(--info); }
.o-badge-success { background: var(--success); }
.o-badge-warning { background: var(--warning); color: #212529; }
.o-badge-danger  { background: var(--danger); }

.o-notifications { position: fixed; top: calc(var(--navbar-h) + 10px); right: 12px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 24px)); }
.o-notification {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: #fff;
  border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); color: var(--heading); animation: o-slide .25s ease-out;
}
.o-notification span { flex: 1; }
.o-notification-success { border-left-color: var(--success); }
.o-notification-warning { border-left-color: var(--warning); }
.o-notification-danger  { border-left-color: var(--danger); }
.o-notification-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; }
@keyframes o-slide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.o-alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; border: 1px solid transparent; }
.o-alert ul { margin: 0; padding-left: 18px; }
.o-alert-danger  { background: #F8D7DA; border-color: #F5C2C7; color: #842029; }
.o-alert-warning { background: #FFF3CD; border-color: #FFE69C; color: #664D03; }
.o-alert-info    { background: #CFF4FC; border-color: #9EEAF9; color: #055160; }
.o-alert-success { background: #D1E7DD; border-color: #A3CFBB; color: #0A3622; }

/* =====================================================================
   CONTENU
   ===================================================================== */
.o-content { min-height: calc(100vh - var(--navbar-h) - 52px); }
.o-content-bare { min-height: 100vh; }

/* ---------- vue liste ---------- */
.o-list-wrap { background: #fff; overflow-x: auto; }
.o-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.o-list th, .o-list td { padding: 8px 5px 8px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border-light); }
.o-list thead th {
  position: sticky; top: 0; background: #fff; color: var(--heading); font-weight: 500;
  border-bottom: 1px solid var(--border); white-space: nowrap; height: 40px;
}
.o-list tbody tr { height: 40px; }
.o-list tbody tr:hover td { background: var(--primary-softer); }
.o-list .o-row-link { cursor: pointer; }
.o-list .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 16px; }
.o-list .o-list-empty td { text-align: center; color: var(--muted); padding: 48px 16px; height: auto; }
.o-list tfoot td { font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.o-cell-main { color: var(--heading); }
.o-cell-sub { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- vue formulaire ---------- */
.o-form { padding: 8px 16px 32px; }
.o-form-statusbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  max-width: 1140px; margin: 0 auto 8px;
}
.o-statusbar-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.o-statusbar-status { display: flex; margin-left: auto; }
.o-arrow {
  position: relative; display: inline-flex; align-items: center; height: 33px;
  padding: 6px 12px 6px 22px; background: var(--gray-300); color: #000; font-weight: 500; font-size: 14px;
  margin-left: 2px; white-space: nowrap;
}
.o-arrow::after {
  content: ""; position: absolute; right: -10px; top: 0; z-index: 1;
  border-top: 16.5px solid transparent; border-bottom: 16.5px solid transparent; border-left: 10px solid var(--gray-300);
}
.o-arrow::before {
  content: ""; position: absolute; left: 0; top: 0;
  border-top: 16.5px solid transparent; border-bottom: 16.5px solid transparent; border-left: 10px solid #F8F9FA;
}
.o-arrow:first-child { border-radius: 4px 0 0 4px; padding-left: 14px; margin-left: 0; }
.o-arrow:first-child::before { display: none; }
.o-arrow:last-child { border-radius: 0 4px 4px 0; padding-right: 14px; }
.o-arrow:last-child::after { display: none; }
.o-arrow-current { background: var(--primary-soft); color: var(--primary-dark); }
.o-arrow-current::after { border-left-color: var(--primary-soft); }

.o-sheet {
  position: relative; max-width: 1140px; margin: 0 auto; padding: 24px 32px 32px;
  background: #fff; border: 1px solid var(--border); border-radius: 4px;
}
.o-button-box { display: flex; justify-content: flex-end; flex-wrap: wrap; margin: -24px -32px 16px; border-bottom: 1px solid var(--border); }
.o-stat-btn {
  display: flex; align-items: center; gap: 8px; min-width: 130px; height: 44px; padding: 0 14px;
  border-left: 1px solid var(--border); color: var(--heading); background: #fff;
}
.o-stat-btn:hover { background: var(--gray-200); color: var(--heading); }
.o-stat-btn .o-stat-value { font-weight: 600; line-height: 1; }
.o-stat-btn .o-stat-text { font-size: 12.5px; line-height: 1.2; color: var(--muted); }
.o-ribbon {
  position: absolute; top: 58px; right: -8px; padding: 3px 18px; background: var(--danger); color: #fff; z-index: 2;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.o-form-title { margin-bottom: 16px; }
.o-form-title .o-form-label-small { display: block; font-size: 14px; color: var(--heading); font-weight: 500; }
.o-form-title h1 { font-size: 26.9px; font-weight: 500; line-height: 1.3; color: var(--heading); }
.o-form-title input.o-input { font-size: 26.9px; font-weight: 500; height: auto; padding: 2px 4px; }
.o-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.o-group-1 { grid-template-columns: minmax(0, 1fr); }
.o-inner-group { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); align-content: start; column-gap: 12px; }
.o-group-title {
  grid-column: 1 / -1; margin: 18px 0 8px; padding-bottom: 4px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--heading); border-bottom: 1px solid var(--border);
}
.o-label { padding: 6px 0; font-weight: 500; color: var(--heading); line-height: 1.4; }
.o-label .req { color: var(--danger); margin-left: 2px; }
.o-field { padding: 2px 0 6px; min-width: 0; }
.o-field-static { padding: 6px 0; color: var(--heading); }
.o-help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.o-input {
  width: 100%; height: 31px; padding: 2px 4px; font: inherit; font-size: 14px; color: var(--heading);
  background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
}
.o-input:hover { border-bottom-color: #ADB5BD; }
.o-input:focus { outline: 0; border-bottom-color: var(--primary); box-shadow: 0 1px 0 var(--primary); }
select.o-input { cursor: pointer; padding-right: 20px; }
textarea.o-input { height: auto; min-height: 60px; resize: vertical; border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; }
.o-input[type=file] { border: 0; height: auto; padding: 4px 0; }
.o-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 6px 0; }
.o-checks-col { flex-direction: column; gap: 6px; }
.o-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--heading); }
.o-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.o-color { display: flex; gap: 20px; padding: 4px 0; }
.o-color label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.o-color input { width: 38px; height: 28px; padding: 1px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; }
.o-logo-preview { padding: 8px; border: 1px dashed var(--border); border-radius: 4px; margin-bottom: 6px; max-width: 220px; }
.o-logo-preview img { max-width: 100%; max-height: 70px; display: block; }

/* onglets */
.o-notebook { margin-top: 24px; }
.o-nb-headers { display: flex; gap: 2px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.o-nb-tab {
  padding: 8px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0;
  background: transparent; color: var(--heading); font: inherit; cursor: pointer; margin-bottom: -1px;
}
.o-nb-tab:hover { border-color: var(--gray-200) var(--gray-200) var(--border); }
.o-nb-tab.active { background: #fff; border-color: var(--border) var(--border) #fff; color: #000; }
.o-nb-page { padding: 16px 0 0; }
.o-nb-page:not(.active) { display: none; }

/* historique (chatter) */
.o-chatter { max-width: 1140px; margin: 16px auto 0; }
.o-chatter-title { font-size: 13px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.o-message { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-light); }
.o-message .o-avatar { flex: none; width: 32px; height: 32px; font-size: 14px; background: var(--primary); }
.o-message-head { font-size: 13px; }
.o-message-head strong { color: var(--heading); margin-right: 6px; }
.o-message-head time { color: var(--muted); font-size: 12px; }
.o-message-body { color: var(--text); }

/* ---------- accueil ---------- */
.o-home { max-width: 1040px; margin: 0 auto; padding: 40px 16px 48px; }
.o-home-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 28px 12px; justify-items: center; }
.o-home-app { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 118px; padding: 8px 4px; border-radius: 8px; color: var(--heading); text-align: center; }
.o-home-app:hover { background: rgba(0,0,0,.04); color: var(--heading); }
.o-home-app:hover .app-icon { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.o-home-app-name { font-size: 14px; line-height: 1.25; }
.app-icon {
  display: grid; place-items: center; border-radius: 12px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--app) 82%, #fff), var(--app));
  box-shadow: 0 2px 6px rgba(0,0,0,.14); transition: transform .15s, box-shadow .15s;
}
.o-home-section { margin-top: 44px; }
.o-home-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.o-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.o-task {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff;
  border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 4px; color: var(--heading);
}
.o-task:hover { background: var(--primary-softer); color: var(--heading); }
.o-task-count { font-size: 20px; font-weight: 600; min-width: 30px; text-align: center; color: var(--primary); }
.o-task-warning { border-left-color: var(--warning); }
.o-task-danger  { border-left-color: var(--danger); }
.o-task-info    { border-left-color: var(--primary); }

/* ---------- états vides ---------- */
.o-nocontent { max-width: 520px; margin: 72px auto; padding: 0 16px; text-align: center; color: var(--muted); }
.o-nocontent .ico { color: #ADB5BD; }
.o-nocontent h2 { color: var(--heading); font-size: 20px; margin: 14px 0 6px; }
.o-nocontent .o-btn { margin-top: 14px; }

/* ---------- connexion (style page de connexion Odoo) ---------- */
body.o-bare { background: var(--body-bg); }
.o-login { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; }
.o-login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 32px 28px 24px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.o-login-brand { text-align: center; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.o-login-brand img { max-height: 130px; max-width: 280px; }
.o-login-mark { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 700; font-size: 22px; }
.o-login-brand h1 { font-size: 18px; margin-top: 12px; }
.o-login-brand p { margin: 2px 0 0; color: var(--muted); }
.o-login label { display: block; font-weight: 500; color: var(--heading); margin-bottom: 4px; }
.o-login .o-login-field { margin-bottom: 14px; }
.o-login input[type=text], .o-login input[type=password] {
  width: 100%; height: 38px; padding: 6px 12px; font: inherit; color: var(--heading);
  border: 1px solid #CED4DA; border-radius: 4px; background: #fff;
}
.o-login input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary) 25%, transparent); }
.o-login .o-btn { height: 38px; }
.o-login-footer { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* ---------- installation ---------- */
.o-install { max-width: 760px; margin: 24px auto; padding: 0 16px; }
.o-install .o-sheet { margin-bottom: 16px; }
.o-checklist { list-style: none; margin: 0; padding: 0; }
.o-checklist li { display: flex; gap: 8px; padding: 4px 0; }
.ok { color: var(--success); } .ko { color: var(--danger); } .warn { color: #B7791F; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  .o-control-panel { grid-template-columns: minmax(0,1fr) auto; }
  .o-cp-center { grid-column: 1 / -1; order: 3; }
  .o-company { display: none; }
}
@media (max-width: 767px) {
  .o-menu-sections { overflow-x: auto; scrollbar-width: none; }
  .o-menu-sections::-webkit-scrollbar { display: none; }
  .o-menu-sections .o-dd { position: static; }
  .o-menu-sections .o-dd-menu { left: 8px; right: 8px; top: var(--navbar-h); position: fixed; }
  .o-group { grid-template-columns: 1fr; }
  .o-inner-group { grid-template-columns: 1fr; }
  .o-label { padding-bottom: 0; }
  .o-sheet { padding: 16px; }
  .o-button-box { margin: -16px -16px 12px; }
  .o-form { padding: 8px 8px 24px; }
  .o-control-panel { padding: 8px; }
  .o-statusbar-status { margin-left: 0; overflow-x: auto; max-width: 100%; }
}

/* formulaire d'installation */
.o-install .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px 32px; }
.o-install .field { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.o-install .field > span { font-weight: 500; color: var(--heading); }
.o-install .field small { color: var(--muted); }
.o-install .field input { height: 31px; padding: 2px 4px; font: inherit; color: var(--heading); border: 0; border-bottom: 1px solid var(--border); background: transparent; }
.o-install .field input:focus { outline: 0; border-bottom-color: var(--primary); box-shadow: 0 1px 0 var(--primary); }
@media (max-width: 767px) { .o-install .grid-2 { grid-template-columns: 1fr; } }
.o-field > .o-check:only-child { padding-top: 6px; }
.o-list td { white-space: nowrap; }
.o-list td.o-wrap { white-space: normal; }

/* ---------- lignes éditables (one2many) ---------- */
.o-lines { background: transparent; }
.o-lines th { position: static; }
.o-lines td { white-space: normal; padding-top: 4px; padding-bottom: 4px; }
.o-lines tbody tr:hover td { background: transparent; }
.o-lines .o-input { height: 30px; }
.o-lines input.num { text-align: right; }
.o-line-remove { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; }
.o-line-remove:hover { color: var(--danger); background: #F8D7DA; }
.o-add-line { margin: 6px 0 0 8px; }
.o-lines-total { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 0; border-top: 1px solid var(--border); margin-top: 8px; color: var(--heading); }
.o-text-danger { color: var(--danger) !important; }
.o-attachment { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-light); }

/* ---------- boîte de dialogue ---------- */
.o-dialog { border: 0; border-radius: 6px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 16px 48px rgba(0,0,0,.3); color: var(--text); }
.o-dialog::backdrop { background: rgba(0,0,0,.45); }
.o-dialog header { padding: 14px 20px; font-size: 17px; color: var(--heading); border-bottom: 1px solid var(--border); }
.o-dialog-body { padding: 16px 20px; }
.o-dialog-body .o-label { display: block; padding-top: 0; }
.o-dialog footer { display: flex; gap: 6px; padding: 12px 20px; border-top: 1px solid var(--border); }

/* ---------- indicateurs et tableau de bord ---------- */
.o-kpis { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.o-kpi { display: flex; flex-direction: column; min-width: 150px; padding: 8px 14px; border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 12.5px; background: #fff; }
.o-kpi span { font-size: 20px; font-weight: 600; color: var(--heading); }
a.o-kpi:hover { background: var(--primary-softer); color: var(--muted); }
.o-kpi-danger { border-left-color: var(--danger); } .o-kpi-warning { border-left-color: var(--warning); } .o-kpi-success { border-left-color: var(--success); }
.o-dashboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding: 16px; max-width: 1400px; }
.o-card { background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 4px; }
.o-card-head { padding: 12px 16px 4px; }
.o-card-head h3 { font-size: 16px; color: var(--primary); }
.o-card-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px 16px; }
.o-check-on { color: var(--primary); }
.o-color-chip { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid var(--border); }
.o-search-panel label { display: block; margin: 4px 0; font-size: 12.5px; }
.o-best { background: #D1E7DD !important; font-weight: 600; }
.o-section-title { font-size: 15px; font-weight: 600; color: var(--heading); margin: 22px 0 8px; }
.o-totals { margin-left: auto; width: min(360px, 100%); margin-top: 12px; }
.o-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.o-totals .o-total-main { border-top: 1px solid var(--border); font-weight: 600; font-size: 16px; color: var(--heading); padding-top: 8px; }
.o-stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.o-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.o-stars label { font-size: 24px; line-height: 1; color: #CED4DA; cursor: pointer; }
.o-stars input:checked ~ label, .o-stars label:hover, .o-stars label:hover ~ label { color: #F0AD4E; }
.o-stars input:disabled + label { cursor: default; }
.o-stars input:focus-visible + label { outline: 2px solid var(--primary); }
.o-apply-all { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.o-dialog-lg { width: min(820px, calc(100vw - 32px)); }
.o-sheet > .o-alert ~ .o-button-box { margin-top: 0; border-top: 1px solid var(--border); }
@media (max-width: 767px) {
  .o-sheet table.o-lines, .o-sheet .o-list-wrap { display: block; max-width: 100%; overflow-x: auto; }
  .o-stat-btn { min-width: 0; flex: 1 1 45%; }
}

/* =====================================================================
   COLONNES OPTIONNELLES, SIGNATURE, CONFORMITÉ
   ===================================================================== */
.o-col-hidden { display: none !important; }
th.o-optional-toggle { position: relative; width: 34px; padding: 0 6px !important; text-align: right; }
.o-optional-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; display: inline-grid; place-items: center; }
.o-optional-btn:hover { color: var(--primary); background: var(--primary-softer); }
.o-optional-menu {
  display: none; position: absolute; right: 0; top: 100%; z-index: 20; min-width: 200px; padding: 8px 12px;
  background: #fff; border: 1px solid rgba(0,0,0,.15); border-radius: 4px; box-shadow: 0 6px 12px rgba(0,0,0,.15);
  text-align: left; font-weight: 400;
}
.o-optional-toggle.open .o-optional-menu { display: grid; gap: 6px; }
.o-btn-sm { height: 24px; padding: 0 6px; font-size: 13px; }
.o-radio { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: var(--heading); cursor: pointer; }
.o-radio input { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; }
.o-signature-pad { width: 100%; height: 170px; border: 1px dashed #ADB5BD; border-radius: 6px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.o-signature-img { display: block; max-width: 260px; max-height: 110px; padding: 6px; border: 1px solid var(--border-light); border-radius: 4px; background: #fff; }
.o-signature-box { display: flex; flex-direction: column; gap: 4px; }
.o-signature-box small { color: var(--muted); }
.o-dialog-body .o-signature-pad { margin: 6px 0; }
.o-line-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 8px; margin-top: 4px; }
.o-line-detail .o-input { height: 28px; font-size: 13px; }
.o-line-ref { display: block; color: var(--muted); font-size: 12.5px; }
.o-line-ref b { color: var(--heading); font-weight: 500; }
.o-section { margin-top: 24px; }
.o-section-title { font-size: 15px; font-weight: 600; color: var(--heading); margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.o-choice { display: grid; grid-template-columns: minmax(140px, 22%) minmax(0, 1fr); gap: 6px 16px; align-items: start; max-width: 820px; }
.o-choice textarea.o-input { min-height: 72px; }
.o-choice .o-label { padding-top: 8px; }
.o-soft-panel { background: var(--primary-softer); border: 1px solid var(--primary-soft); border-radius: 6px; padding: 14px 16px; }
.o-kv { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.o-steps-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.o-progress { height: 6px; border-radius: 3px; background: var(--gray-200); overflow: hidden; min-width: 60px; }
.o-progress > span { display: block; height: 100%; background: var(--primary); }

/* totaux type Odoo, alignés à droite sous les lignes */
.o-totals { margin-left: auto; width: min(360px, 100%); margin-top: 14px; }
.o-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.o-totals .o-total-main { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; font-weight: 700; color: var(--heading); font-size: 15px; }
.o-totals .o-paid { font-style: italic; color: var(--muted); }

/* =====================================================================
   TABLEAU DE BORD
   ===================================================================== */
.tb { --good: #1F9D55; --warn: #E0A100; --bad: #D64545; --bar: var(--primary); --line: #2683C6; max-width: 1440px; margin: 0 auto; padding: 18px 20px 40px; }
.tb-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tb-head h1 { font-size: 22px; font-weight: 600; color: var(--heading); }
.tb-head p { margin: 2px 0 0; color: var(--muted); }
.tb-filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.tb-filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.tb-filters select, .tb-filters input { height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; background: #fff; font: inherit; font-size: 13.5px; color: var(--heading); min-width: 150px; }
.tb-filters input[type=date] { min-width: 0; }
.tb-perso { display: inline-flex; align-items: center; gap: 6px; }
.tb-tasks { margin: 4px 0 14px; }
.tb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tb-tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tb-tabs a:hover { color: var(--heading); }
.tb-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.tb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tb-kpi {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 14px 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); overflow: hidden;
}
.tb-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.tb-kpi.good::before { background: var(--good); } .tb-kpi.warn::before { background: var(--warn); } .tb-kpi.bad::before { background: var(--bad); }
.tb-kpi-label { font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); line-height: 1.3; min-height: 31px; }
.tb-kpi-value { font-size: 30px; font-weight: 700; color: var(--heading); line-height: 1.15; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.tb-kpi-detail { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.tb-kpi-badge { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--primary-soft); color: var(--primary-dark); }
.tb-kpi.good .tb-kpi-badge { background: #E3F4EA; color: #146C3B; }
.tb-kpi.warn .tb-kpi-badge { background: #FFF4D6; color: #7A5A00; }
.tb-kpi.bad .tb-kpi-badge { background: #FDE7E7; color: #A12626; }
.tb-kpi.good .tb-kpi-value { color: var(--good); } .tb-kpi.warn .tb-kpi-value { color: #C68A00; } .tb-kpi.bad .tb-kpi-value { color: var(--bad); }

.tb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tb-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); min-width: 0; }
.tb-card header { margin-bottom: 10px; }
.tb-card h2 { font-size: 15px; font-weight: 600; color: var(--heading); }
.tb-card header p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tb-empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: 13px; background: var(--body-bg); border-radius: 8px; }

.tb-svg { width: 100%; height: auto; display: block; overflow: visible; }
.tb-svg .tb-bar { fill: var(--bar); }
.tb-svg .tb-bar.good { fill: var(--good); } .tb-svg .tb-bar.warn { fill: var(--warn); } .tb-svg .tb-bar.bad { fill: var(--bad); }
.tb-svg .tb-axis { stroke: #ADB5BD; stroke-width: 1; }
.tb-svg .tb-grid { stroke: #EEF0F2; stroke-width: 1; }
.tb-svg .tb-val { font-size: 12px; font-weight: 700; fill: var(--heading); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round; }
.tb-svg .tb-lab { font-size: 11.5px; fill: var(--muted); text-anchor: middle; }
.tb-svg .tb-lab.strong { font-weight: 700; fill: #111; font-size: 11.5px; }
.tb-svg .tb-lab-bg { fill: #fff; }
.tb-svg .tb-ref { stroke-width: 2.5; }
.tb-svg .tb-ref.good { stroke: var(--good); } .tb-svg .tb-ref.bad { stroke: var(--bad); } .tb-svg .tb-ref.warn { stroke: var(--warn); }
.tb-svg .tb-pill rect { fill: var(--good); }
.tb-svg .tb-pill.bad rect { fill: var(--bad); } .tb-svg .tb-pill.warn rect { fill: var(--warn); }
.tb-svg .tb-pill text { fill: #fff; font-size: 11.5px; font-weight: 700; text-anchor: middle; }
.tb-svg .tb-line { fill: none; stroke: var(--line); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.tb-svg .tb-mark path { stroke: var(--line); stroke-width: 2.4; stroke-linecap: round; }

.tb-hbars { --lw: 150px; --vw: 64px; --g: 10px; display: grid; gap: 8px; position: relative; }
.tb-hbar { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr) var(--vw); align-items: center; gap: var(--g); font-size: 13px; height: 20px; }
.tb-hbar-lab { color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.tb-hbar-track { position: relative; height: 14px; background: #EEF1F4; border-radius: 7px; }
.tb-hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--bar); min-width: 2px; }
.tb-hbar-fill.good { background: var(--good); } .tb-hbar-fill.warn { background: var(--warn); } .tb-hbar-fill.bad, .tb-hbar-fill.neg { background: var(--bad); }
.tb-hbar-val { font-variant-numeric: tabular-nums; color: var(--heading); font-weight: 700; white-space: nowrap; text-align: right; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.tb-vref { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2.5px solid var(--good); pointer-events: auto;
  left: calc(var(--lw) + var(--g) + (100% - var(--lw) - var(--vw) - 2 * var(--g)) * var(--p) - 1px); }
.tb-vref.bad { border-left-color: var(--bad); } .tb-vref.warn { border-left-color: var(--warn); }
.tb-legend { margin-top: 12px; font-size: 12px; color: var(--heading); font-weight: 600; display: flex; align-items: center; gap: 16px; justify-content: flex-end; flex-wrap: wrap; }
.tb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tb-legend-line { display: inline-block; width: 18px; border-top: 2.5px solid var(--good); }
.tb-legend-line.bad { border-top-color: var(--bad); } .tb-legend-line.warn { border-top-color: var(--warn); }

.tb-funnel { display: grid; gap: 8px; }
.tb-funnel-row { display: grid; grid-template-columns: minmax(110px, 26%) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; }
.tb-funnel-track { background: transparent; }
.tb-funnel-bar { display: flex; align-items: center; justify-content: flex-end; height: 26px; padding: 0 8px; border-radius: 6px; background: var(--primary); color: #fff; font-weight: 700; font-size: 12.5px; min-width: 28px; }
.tb-funnel-rate { font-size: 12px; color: var(--muted); }

.tb-table-wrap { overflow-x: auto; }
.tb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tb-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-light); color: var(--heading); }
.tb-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-table tr:last-child td { border-bottom: 0; }
.tb-bad { color: var(--bad, #D64545); } .tb-good { color: var(--good, #1F9D55); } .tb-warn { color: #C68A00; }

@media (max-width: 991px) { .tb-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575px) {
  .tb { padding: 12px 10px 32px; }
  .tb-kpi-value { font-size: 25px; }
  .tb-hbars { --g: 8px; }
  .tb-funnel-row { grid-template-columns: 1fr; gap: 3px; }
}

a.tb-kpi { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.tb-kpi:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .12); transform: translateY(-1px); color: inherit; }
.tb-live { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 2px !important; }
.tb-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #1F9D55; box-shadow: 0 0 0 3px rgba(31, 157, 85, .18); }

/* ---------- Import d'inventaire ---------- */
ol.o-import-steps, .o-sheet ol.o-steps { padding-left: 20px; margin: 6px 0 18px; display: grid; gap: 12px; }
.o-inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.o-upload-box { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px; border: 2px dashed var(--border); border-radius: 10px; background: var(--body-bg); }
.o-upload-box input[type=file] { max-width: 420px; background: #fff; }
.o-list-compact th, .o-list-compact td { padding: 5px 8px; font-size: 12.5px; }
.o-import-errors table { margin-top: 10px; background: #fff; }
.o-import-map tr.o-import-mapped td { background: #F2F8F4; }
.o-import-map tr.o-import-mapped td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.o-inv-ecart-plus { color: var(--success); font-weight: 600; } .o-inv-ecart-moins { color: var(--danger); font-weight: 600; }
.o-inv-totaux { display: flex; gap: 22px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; font-size: 13.5px; }
.o-inv-totaux strong { font-variant-numeric: tabular-nums; }
.o-list td.num { white-space: nowrap; }
.o-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.o-dot.good { background: #1F9D55; } .o-dot.bad { background: #D64545; } .o-dot.warn { background: #E0A100; }
.o-input-unit { display: inline-flex; align-items: center; gap: 6px; }
.o-input-unit .o-input { width: 90px; text-align: right; }
.o-input-unit span { color: var(--muted); font-size: 12.5px; min-width: 14px; text-align: left; }
.tb-svg .tb-dot { fill: var(--line); stroke: #fff; stroke-width: 2; }
.tb-svg .tb-proj { stroke: var(--line); stroke-width: 2; stroke-dasharray: 6 5; opacity: .75; }
.tb-svg .tb-proj-lab { font-size: 11px; fill: var(--line); text-anchor: end; font-style: italic; font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.tb-svg .tb-zone { font-size: 11.5px; font-weight: 700; text-anchor: end; }
.tb-svg .tb-zone.good { fill: var(--good); } .tb-svg .tb-zone.bad { fill: var(--bad); }
.tb-fixed { display: flex; align-items: center; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--body-bg); color: var(--heading); font-size: 13.5px; }

/* ---------- Droits d'accès ---------- */
.o-rights { display: grid; gap: 16px; margin-top: 8px; }
.o-rights-app { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.o-rights-app > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--body-bg); border-bottom: 1px solid var(--border); }
.o-rights-app h3 { font-size: 15px; font-weight: 600; color: var(--heading); margin: 0; }
.o-rights-all { font-size: 12.5px; color: var(--muted); }
.o-rights-table th.o-rights-col, .o-rights-table td.o-rights-col { text-align: center; width: 104px; }
.o-rights-table td { vertical-align: middle; }
.o-rights-table input[type=checkbox], .o-rights-special input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); }
.o-rights-special { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 18px; padding: 12px 14px; }
.o-rights-app > .o-list-wrap + .o-rights-special { border-top: 1px dashed var(--border); }
.o-tags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.o-tag { display: inline-block; padding: 3px 10px; border-radius: 14px; background: var(--primary-soft, #E8F0FB); color: var(--primary-dark, #174A8B); font-size: 12.5px; text-decoration: none; }
.o-tag-muted { opacity: .55; }
.o-super-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: #F59E0B; color: #1F2937 !important; font-size: 12px; font-weight: 700; margin-right: 10px; text-decoration: none; white-space: nowrap; }
.o-input-title { font-size: 26px; font-weight: 500; border: 0; border-bottom: 1px solid var(--border); padding: 2px 0; width: 100%; max-width: 640px; background: transparent; color: var(--heading); }
.o-input-title:focus { outline: none; border-bottom-color: var(--primary); }

/* =====================================================================
   FINITIONS (ordinateur)
   ===================================================================== */
.o-navbar { box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.o-burger { display: none; }
.o-control-panel { box-shadow: 0 1px 0 rgba(16, 24, 40, .03); }
.o-sheet { border-radius: 8px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.o-list-wrap { border-top: 1px solid var(--border-light); }
.o-list thead th { background: #FBFBFC; font-size: 13px; letter-spacing: .01em; }
.o-list tbody tr:nth-child(even) td { background: #FCFCFD; }
.o-list tbody tr:hover td { background: var(--primary-softer); }
.o-btn { border-radius: 6px; }
.o-btn-primary { box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.o-dd-menu { border-radius: 0 0 8px 8px; }
.o-dialog { border-radius: 10px; }
.o-kpi { border-radius: 8px; }
.o-badge { letter-spacing: .01em; }
.o-arrow-current { font-weight: 600; }

/* ---------- tiroir de menu (téléphone) ---------- */
.o-drawer-backdrop { position: fixed; inset: 0; z-index: 1190; background: rgba(15, 23, 42, .45); opacity: 0; transition: opacity .2s; }
.o-drawer-backdrop.open { opacity: 1; }
.o-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1200; width: min(320px, 86vw); overflow-y: auto;
  background: #fff; box-shadow: 4px 0 24px rgba(15, 23, 42, .25); transform: translateX(-100%); transition: transform .22s ease-out;
  padding-bottom: 24px; -webkit-overflow-scrolling: touch;
}
.o-drawer.open { transform: none; }
.o-drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 1; }
.o-drawer-head .o-avatar { width: 36px; height: 36px; font-size: 16px; border-radius: 8px; }
.o-drawer-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.o-drawer-head small { color: rgba(255, 255, 255, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-drawer-x { border: 0; background: rgba(255, 255, 255, .15); color: #fff; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.o-drawer-section { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.o-drawer-app { display: flex; align-items: center; gap: 10px; padding: 10px 16px 6px; font-size: 16px; font-weight: 600; color: var(--heading); }
.o-drawer-group { padding: 12px 16px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.o-drawer-sub { padding: 8px 16px 2px 28px; font-size: 12.5px; font-weight: 600; color: var(--heading); }
.o-drawer-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; color: var(--heading); font-size: 15px; }
.o-drawer-item:active, .o-drawer-item:hover { background: var(--primary-softer); color: var(--heading); }
.o-drawer-item.active { background: var(--primary-soft); font-weight: 600; }
.o-drawer-indent { padding-left: 28px; }
body.o-drawer-lock { overflow: hidden; }

/* =====================================================================
   TÉLÉPHONE ET PETITE TABLETTE
   ===================================================================== */
@media (max-width: 767px) {
  body { font-size: 15px; }
  :root { --navbar-h: 52px; }
  /* barre du haut : bouton menu + nom de l'application, le reste passe dans le tiroir */
  .o-burger { display: inline-flex; padding: 0 12px; }
  .o-apps-menu, .o-menu-sections, .o-company, .o-super-badge { display: none !important; }
  .o-menu-brand { font-size: 17px; font-weight: 500; padding-left: 0; overflow: hidden; text-overflow: ellipsis; }
  .o-systray { flex: none; }

  /* panneau de contrôle : fil d'Ariane, boutons, recherche sur toute la largeur */
  .o-control-panel { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .o-cp-left { order: 1; width: 100%; flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .o-cp-buttons { overflow-x: auto; scrollbar-width: none; }
  .o-cp-buttons::-webkit-scrollbar { display: none; }
  .o-cp-center { order: 2; flex: 1 1 100%; }
  .o-cp-right { order: 3; width: 100%; justify-content: space-between; }
  .o-cp-right:empty { display: none; }
  .o-bc-parents { font-size: 12.5px; }
  .o-bc-current { font-size: 18px; font-weight: 500; }
  .o-searchview { height: 42px; }
  .o-searchview.panel-open .o-search-panel { grid-template-columns: 1fr; max-height: 60vh; overflow-y: auto; }
  .o-btn { height: 38px; padding: 6px 12px; }
  .o-btn-sm { height: 30px; }
  .o-input { height: 38px; font-size: 16px; }   /* 16 px : pas de zoom automatique sur iPhone */
  select.o-input, textarea.o-input { font-size: 16px; }
  .o-notifications { top: calc(var(--navbar-h) + 8px); left: 12px; right: 12px; width: auto; }

  /* listes : une carte par enregistrement, comme la vue mobile d'Odoo */
  .o-list-wrap { background: transparent; border-top: 0; padding: 10px 10px 16px; overflow: visible; }
  table.o-list-cards, table.o-list-cards tbody, table.o-list-cards tr, table.o-list-cards td { display: block; width: 100%; }
  table.o-list-cards thead { display: none; }
  table.o-list-cards tbody tr {
    position: relative; margin-bottom: 10px; padding: 10px 14px; height: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  }
  table.o-list-cards tbody tr:nth-child(even) td, table.o-list-cards tbody tr:hover td { background: transparent; }
  table.o-list-cards tbody tr.o-row-link:active { background: var(--primary-softer); }
  table.o-list-cards td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 3px 0; border: 0; white-space: normal; text-align: right; min-height: 0; font-size: 14px;
  }
  table.o-list-cards td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; max-width: 45%; }
  table.o-list-cards td:empty, table.o-list-cards td.o-col-hidden, table.o-list-cards td.o-optional-toggle { display: none !important; }
  table.o-list-cards td:first-child { display: block; text-align: left; font-size: 16px; font-weight: 600; color: var(--heading); padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border-light); }
  table.o-list-cards td:first-child::before { display: none; }
  table.o-list-cards td.num { padding-right: 0; }
  table.o-list-cards .o-list-empty td { display: block; text-align: center; border: 0; }
  table.o-list-cards .o-list-empty td::before, table.o-list-cards tfoot { display: none; }
  table.o-list-cards .o-list-empty { background: transparent !important; border: 0 !important; box-shadow: none !important; }
  table.o-list-cards tfoot { display: block; }

  /* formulaires */
  .o-form { padding: 10px 10px 28px; }
  .o-form-statusbar { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .o-statusbar-buttons { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; max-width: 100%; min-width: 0; }
  .o-form-title h1, .o-bc-current { overflow-wrap: anywhere; }
  .o-sheet p { overflow-wrap: anywhere; }
  .o-statusbar-buttons::-webkit-scrollbar { display: none; }
  .o-statusbar-status { width: 100%; justify-content: flex-end; }
  .o-statusbar-status .o-arrow:not(.o-arrow-current) { display: none; }    /* seule l'étape en cours, comme Odoo mobile */
  .o-statusbar-status .o-arrow-current { border-radius: 16px; padding: 6px 14px; }
  .o-statusbar-status .o-arrow-current::before, .o-statusbar-status .o-arrow-current::after { display: none; }
  .o-sheet { padding: 16px 14px 20px; border-radius: 10px; }
  .o-button-box { margin: -16px -14px 12px; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
  .o-stat-btn { flex: none; min-width: 120px; }
  .o-form-title h1, .o-form-title input.o-input, .o-input-title { font-size: 22px; }
  .o-ribbon { top: 50px; right: -6px; font-size: 11px; padding: 2px 12px; }
  .o-inner-group .o-label { padding: 8px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
  .o-inner-group .o-field, .o-inner-group .o-field-static { padding: 2px 0 6px; }
  .o-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 24px); }
  .o-dialog footer { flex-wrap: wrap; }
  .o-dialog footer .o-btn { flex: 1 1 auto; }
  .o-kpis { padding: 10px; gap: 8px; }
  .o-kpi { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .o-choice { grid-template-columns: 1fr; }
  .o-tasks { grid-template-columns: 1fr 1fr; }
  .o-task { padding: 10px; gap: 8px; font-size: 13.5px; }
  .o-home { padding: 24px 12px 40px; }
  .o-home-apps { grid-template-columns: repeat(3, 1fr); gap: 18px 6px; }
  .o-home-app { width: 100%; }
  .o-rights-table td.o-rights-col { justify-content: space-between; }
  .o-rights-special { grid-template-columns: 1fr; }

  /* tableau de bord */
  .tb { padding: 12px 10px 32px; }
  .tb-head { flex-direction: column; align-items: stretch; }
  .tb-head h1 { font-size: 19px; }
  .tb-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tb-filters label { min-width: 0; }
  .tb-filters select, .tb-filters input { min-width: 0; width: 100%; height: 38px; font-size: 15px; }
  .tb-perso { grid-column: 1 / -1; }
  .tb-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tb-kpi { padding: 12px 12px 12px 16px; }
  .tb-kpi-label { font-size: 11px; min-height: 0; }
  .tb-kpi-value { font-size: 24px; }
  .tb-card { padding: 12px 12px 14px; border-radius: 10px; }
  .tb-scroll { overflow-x: auto; margin: 0 -4px; -webkit-overflow-scrolling: touch; }
  .tb-scroll .tb-svg { min-width: 540px; }
  .tb-hbars { --g: 8px; }
  .tb-hbar { font-size: 12.5px; }
  .tb-legend { justify-content: flex-start; }
  .tb-table-wrap { margin: 0 -4px; }
}
@media (max-width: 380px) {
  .o-tasks, .tb-kpis { grid-template-columns: 1fr; }
  .tb-filters { grid-template-columns: 1fr; }
}

/* étape en cours de la barre de statut : couleur du thème (même couleur que la bannière du haut) */
.o-arrow { background: #E9ECEF; color: #6C757D; font-weight: 500; }
.o-arrow::after { border-left-color: #E9ECEF; }
.o-arrow.o-arrow-current { background: var(--primary); color: #fff; font-weight: 600; }
.o-arrow.o-arrow-current::after { border-left-color: var(--primary); }
.o-statusbar-status .o-arrow-current { box-shadow: 0 1px 3px rgba(16, 24, 40, .2); }
.tb-grid > .tb-wide { grid-column: 1 / -1; }
