/*
 * Habillage du CRM Welcomeurope, dans l'esprit de HubSpot.
 *
 * Servi par le proxy d'interface (infra/interface/nginx.conf) et ajouté à la
 * page : le cœur de Twenty n'est pas modifié. Twenty dessine son interface à
 * partir de variables CSS publiques (--t-…), qu'on redéfinit ici.
 *
 * Palette : texte #333333, accent #023b3d, fond #F0F0F0, menu #333333.
 * Police : Lexend Deca (licence OFL), hébergée avec le CRM.
 */

@font-face {
  font-family: 'Lexend Deca';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(polices/lexend-deca-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lexend Deca';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(polices/lexend-deca-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- police, dans les deux thèmes ---- */
html.light,
html.dark {
  --t-font-family: 'Lexend Deca', Inter, sans-serif;
}
html,
body {
  font-family: var(--t-font-family);
}

/* ---- thème clair ----
 * « html.light » l'emporte sur le « .light » de Twenty, quel que soit l'ordre
 * de chargement des feuilles de style. */
html.light {
  --t-font-color-primary: #333333;

  /* Fond de l'application, autour des cartes blanches. */
  --t-gray-scale-gray3: #f0f0f0;

  /* Accent (sélection, boutons principaux, liens, focus) : vert sapin #023b3d. */
  --t-color-blue: #023b3d;
  --t-color-blue1: #fbfcfc;
  --t-color-blue2: #f3f7f7;
  --t-color-blue3: #e6ebec;
  --t-color-blue4: #d9e2e2;
  --t-color-blue5: #ccd8d8;
  --t-color-blue6: #bbcacb;
  --t-color-blue7: #9fb4b5;
  --t-color-blue8: #819d9e;
  --t-color-blue9: #023b3d;
  --t-color-blue10: #012f31;
  --t-color-blue11: #023b3d;
  --t-color-blue12: #012122;

  --t-accent-primary: #ccd8d8;
  --t-accent-secondary: #ccd8d8;
  --t-accent-tertiary: #e6ebec;
  --t-accent-quaternary: #f3f7f7;
  --t-accent-accent3570: #819d9e;
  --t-accent-accent4060: #819d9e;
  --t-accent-accent1: #fbfcfc;
  --t-accent-accent2: #f3f7f7;
  --t-accent-accent3: #e6ebec;
  --t-accent-accent4: #d9e2e2;
  --t-accent-accent5: #ccd8d8;
  --t-accent-accent6: #bbcacb;
  --t-accent-accent7: #9fb4b5;
  --t-accent-accent8: #819d9e;
  --t-accent-accent9: #023b3d;
  --t-accent-accent10: #012f31;
  --t-accent-accent11: #023b3d;
  --t-accent-accent12: #012122;

  --t-border-color-blue: #9fb4b5;
  --t-background-transparent-blue: #023b3d14;
}

/* ---- menu de gauche : colonne sombre, comme la barre de HubSpot ---- */
html [data-click-outside-id='navigation-drawer'] {
  background: #333333;
  /* Champs et boutons du menu (accueil, nouveau chat, recherche). */
  --t-background-primary: #3d3d3d;
  --t-background-secondary: #424242;
  --t-background-tertiary: #4a4a4a;
  --t-font-color-primary: #ffffff;
  --t-font-color-secondary: #e6e6e6;
  --t-font-color-tertiary: #bdbdbd;
  --t-font-color-light: #9e9e9e;
  --t-font-color-extra-light: #808080;
  --t-background-transparent-lighter: rgba(255, 255, 255, 0.04);
  --t-background-transparent-light: rgba(255, 255, 255, 0.08);
  --t-background-transparent-medium: rgba(255, 255, 255, 0.14);
  --t-background-transparent-strong: rgba(255, 255, 255, 0.22);
  --t-background-transparent-secondary: rgba(255, 255, 255, 0.06);
  --t-background-transparent-primary: rgba(255, 255, 255, 0.1);
  --t-border-color-light: rgba(255, 255, 255, 0.08);
  --t-border-color-medium: rgba(255, 255, 255, 0.14);
  --t-border-color-strong: rgba(255, 255, 255, 0.22);
  --t-gray-scale-gray9: #bdbdbd;
  --t-gray-scale-gray10: #d0d0d0;
  --t-gray-scale-gray11: #e6e6e6;
  --t-gray-scale-gray12: #ffffff;
  color: #ffffff;
}

/* ---- fiche d'un enregistrement : colonne de gauche en cartes blanches sur fond gris ----
 * Repères stables de Twenty : le panneau gauche (« page-layout-left-panel ») et le
 * bloc des champs (« record-fields-widget »). */
html.light div:has(> [id^='scroll-wrapper-page-layout-left-panel']) {
  background: #f0f0f0;
}
html.light div:has(> [id^='scroll-wrapper-page-layout-left-panel']) > div:not([id]),
html.light [data-testid='record-fields-widget'] {
  box-sizing: border-box;
  width: calc(100% - 24px);
  margin: 12px 12px 0;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
}
html.light [data-testid='record-fields-widget'] {
  margin-bottom: 12px;
  padding: 8px 10px 10px;
  overflow: hidden;
}

/* ---- fiche : historique à gauche, fiches associées à droite (façon HubSpot) ----
 * Les widgets sont marqués par habillage.js (data-habillage-type). Sur un écran
 * étroit, les cartes restent sous l'historique. */
@media (min-width: 1200px) {
  html div:has(> div > .widget[data-habillage-type='TIMELINE']) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 34%);
    grid-auto-rows: min-content;
    column-gap: 16px;
    align-items: start;
  }
  html div:has(> div > .widget[data-habillage-type='TIMELINE']) > div {
    grid-column: 2;
    min-width: 0;
  }
  html div:has(> div > .widget[data-habillage-type='TIMELINE']) > div:has(> .widget[data-habillage-type='TIMELINE']) {
    grid-column: 1;
    grid-row: 1 / span 20;
  }
}
html.light div:has(> div > .widget[data-habillage-type='TIMELINE']) .widget[data-habillage-type='FIELD'] {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  margin: 12px 12px 0 0;
  padding: 4px 8px 8px;
}
