/* Voceo palette override — the Leads Manager's scheme, across the native CRM.
 *
 * Loaded after the bundle, so it wins on document order without touching
 * voceo-skin.css or the build. The skin maps every Twenty accent and "blue"
 * token to one 12-step --voceo-* scale; redefining that scale moves Tasks,
 * Notes, People, Settings and every other native page at once.
 *
 * Reversible by retagging the image: nothing in the source tree changed, so
 * a rebuild from the fork does not have to know this file exists.
 *
 * Step 9 is the brand (#8b5cf6 / #a78bfa), 11 is text on the page ground,
 * and 1-8 are the tints the CRM fills rows and chips with.
 */

.light {
  --voceo-1: #fdfbff;
  --voceo-2: #faf7ff;
  --voceo-3: #f2ecff;
  --voceo-4: #e9e0fe;
  --voceo-5: #ded0fd;
  --voceo-6: #d0befc;
  --voceo-7: #bfa6fa;
  --voceo-8: #a786f8;
  --voceo-9: #8b5cf6;
  --voceo-10: #7c3aed;
  --voceo-11: #6d28d9;
  --voceo-12: #36166e;
  --t-background-transparent-blue: #8b5cf612;
}

.dark {
  --voceo-1: #141021;
  --voceo-2: #191328;
  --voceo-3: #211a38;
  --voceo-4: #282046;
  --voceo-5: #2f2653;
  --voceo-6: #3b2f69;
  --voceo-7: #4c3d84;
  --voceo-8: #644fa8;
  --voceo-9: #a78bfa;
  --voceo-10: #b9a3fc;
  --voceo-11: #cfc0fd;
  --voceo-12: #e6dcfe;
  --t-background-transparent-blue: #a78bfa57;
}

/* ------------------------------------------------------------------ ground
 *
 * The Leads Manager sits on a light blue with its panels floating on it. The
 * native pages sat on Twenty's grey. These three rules bring them together.
 *
 * `--t-gray-scale-gray3` is the app shell's background and — checked across
 * the whole front end — it is used in exactly ONE file, DefaultLayout.tsx.
 * So moving it moves the ground and nothing else.
 */
.light {
  --t-gray-scale-gray3: #e9f0fb;
  /* Every border in the CRM, cooled to match. Twenty's greys under a blue
     ground read as a colour cast rather than a choice. */
  --t-border-color-light: #e4eaf2;
  --t-border-color-medium: #d3dce8;
}

.dark {
  --t-gray-scale-gray3: #1b1e24;
  --t-border-color-light: #333841;
  --t-border-color-medium: #434a55;
}

/* ----------------------------------------------------- the workspace panel
 *
 * The border wraps the WORKSPACE — the area to the right of the nav drawer,
 * where the table of tasks or notes lives — so the native pages match the
 * Leads Manager, which draws its own panels the same way.
 *
 * `.s1yw1b4p` is DefaultLayout's StyledMainContainer. An earlier attempt used
 * `StyledPageContainer > div:last-child` and matched nothing useful: that
 * container holds ONE child, the drag-drop provider, which in turn holds the
 * drawer and the page. Guessing at structure was the mistake.
 *
 * HOW TO FIND THIS AGAIN after a front-end rebuild. Linaria writes the
 * component's own name next to its generated class in the JS bundle, so the
 * answer is in the build rather than inferred from it:
 *
 *   curl -s <host>/assets/index-*.js | grep -o 'name:"StyledMainContainer",class:"[a-z0-9]*"'
 *
 * If it stops matching, the workspace loses its border and nothing else: the
 * colours above are token-level and keep working regardless.
 */
.s1yw1b4p,
html body .s1yw1b4p {
  background: var(--t-background-primary) !important;
  border: 1px solid var(--t-border-color-medium) !important;
  border-radius: 14px !important;
  /* The blue ground shows as a frame rather than only as a backdrop. */
  margin: 10px 10px 10px 0 !important;
}

/* NO `overflow: clip` HERE. It was here until 6 Nov 2026 and it is what made
 * the top band and the left band of a table go blank on hover.
 *
 * Every record table pins two things with `position: sticky` and a z-index of
 * its own: the header row along the top, and the first column down the left
 * (see `.s16b0281 div.header-cell...` and `div.table-cell-0-0` in the
 * bundle). The browser gives each of those its own layer to paint.
 *
 * `overflow: clip` TOGETHER WITH `border-radius` makes this element clip its
 * descendants to a ROUNDED rectangle. Those pinned layers then have to be
 * masked through that rounded corner on every repaint, and a repaint is
 * exactly what hovering a row causes. When the mask loses its raster the
 * layer paints nothing, and what vanishes is precisely the header band and
 * the first-column band — the L-shaped hole in the 6 Nov screenshot.
 *
 * Dropping the clip costs nothing visible: the page inside already scrolls in
 * its own container, so there is nothing to clip, and the corners stay round
 * because the border and the radius are still here. Keep it that way. */


/* ---------------------------------------------------------- Ask Nora
 *
 * The pill keeps its shape and its turning ring — both are in the skin and
 * both still work — and takes the scheme's violet. `data-ask-ai` is a real
 * attribute in the markup rather than a generated class, so this one is not
 * tied to a build.
 */
button[data-ask-ai],
[data-ask-ai-wrapper] button,
[data-ask-ai-wrapper] a {
  box-shadow: 0 1px 2px rgb(76 29 149 / 0.32) !important;
}

button[data-ask-ai]::after,
[data-ask-ai-wrapper] button::after,
[data-ask-ai-wrapper] a::after {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

button[data-ask-ai]::before,
[data-ask-ai-wrapper] button::before,
[data-ask-ai-wrapper] a::before {
  background: conic-gradient(
    from var(--voceo-ring-angle),
    #6d28d9 0deg,
    #ffffff 50deg,
    #c4b5fd 85deg,
    #6d28d9 150deg,
    #6d28d9 190deg,
    #ede9fe 235deg,
    #a78bfa 270deg,
    #6d28d9 330deg
  );
}

button[data-ask-ai]:hover,
[data-ask-ai-wrapper] button:hover,
[data-ask-ai-wrapper] a:hover {
  box-shadow:
    0 1px 2px rgb(76 29 149 / 0.32),
    0 0 14px rgb(139 92 246 / 0.55) !important;
}

button[data-ask-ai] svg,
[data-ask-ai-wrapper] svg {
  color: #ffffff !important;
}

/* ------------------------------------------------------- column dividers
 *
 * Read from the SOURCE this time, not inferred from the bundle, which is
 * what four earlier attempts did.
 *
 * `RecordTableCellStyleWrapper` gives every body cell `className={cx(
 * 'table-cell', widthClassName)}` and the header cells get 'header-cell'.
 * Those are REAL class names, not linaria hashes, so unlike every selector
 * before this one they survive a front-end rebuild.
 *
 * The same component already sets `border-right: 1px solid <light>` by
 * default and turns it off only via `[data-without-right-border]`, which
 * just two callers pass: the row checkbox and the trailing empty cell. So
 * the dividers were never missing — they were drawn in
 * `--t-border-color-light`, which this file had set to #e4eaf2, and at that
 * weight on white they are not there as far as an eye is concerned.
 *
 * Hence `medium`, the colour the row dividers read as. Honouring
 * `[data-without-right-border]` keeps Twenty's own intent: no line after
 * the checkbox, none against the right edge.
 *
 * `StyledRecordTableTd` — chased for three attempts — turned out to be the
 * FIRST ROW'S FIRST COLUMN only. One cell in the whole table, which is
 * exactly the one line that kept showing up.
 */
.table-cell:not([data-without-right-border]),
.header-cell:not([data-without-right-border]) {
  border-right: 1px solid var(--t-border-color-medium) !important;
}

/* The first row's first cell, which is a different component.
 *
 * `RecordTableCellFirstRowFirstColumn` draws that one cell instead of
 * `RecordTableCellStyleWrapper`, because it is the sticky corner and
 * carries its own z-index. It is classed `table-cell-0-0`, not
 * `table-cell`, so the rule above never reached it and one cell in every
 * table on the site kept a divider nobody could see.
 *
 * It asks for its border in `theme.border.color.light` like every other
 * cell did, and its only caller never turns the border off, so there is
 * no `[data-without-right-border]` case to honour here. */
.table-cell-0-0 {
  border-right: 1px solid var(--t-border-color-medium) !important;
}

/* ---------------------------------------------------------------------------
 * The column-header strip of every native record table, in a light violet.
 *
 * `.s1jb8d3w` is `RecordTableHeader`'s StyledHeaderContainer — the sticky
 * row carrying the column names. Read out of the DEPLOYED stylesheet, not
 * guessed:
 *
 *   docker exec voceo-crm-server sh -lc 'cd .../front/assets &&
 *     tr "}" "\n" < useCombinedFindManyRecords-*.css
 *       | grep position:sticky | grep flex-direction:row'
 *
 * Re-derive it the same way if the base image is ever rebuilt; Linaria
 * hashes the class from the rule's contents, so it only moves when that
 * component's own CSS changes.
 *
 * ⚠ This sets the VARIABLE on the strip, it does not paint a background.
 * The header cells each draw `background-color: var(--t-background-primary)`
 * themselves, so painting only the container would leave white cells on a
 * red strip. Scoping the variable makes the cells inherit the new colour,
 * while their hover and resize states — which ask for `secondary` and
 * `tertiary` — keep working untouched.
 *
 * --voceo-3 is the third step of the same violet scale as everything else, so
 * it follows the theme: a pale lilac on light, a deep indigo on dark.
 */
.s1jb8d3w {
  --t-background-primary: var(--voceo-3);
}

/* ---------------------------------------------------------------------------
 * The selected item in the left panel: a solid violet pill with white text
 * and icon, like a primary button, instead of violet text on a pale tint.
 *
 * Classes read out of the DEPLOYED bundle (Linaria writes each component's
 * name beside its class), not guessed:
 *   .ssah544   NavigationDrawerItem's StyledItem   (the row itself)
 *   .s1blnvxp  its StyledIcon
 *   .salp3gg   its StyledItemLabel
 *   grep -o 'name:"StyledItem",class:"[a-z0-9]*"' <the chunk holding
 *   StyledNavigationDrawerItemContainer>
 *
 * Twenty marks the selected row with aria-current ("page" for a link, "true"
 * for a folder holding the current page). Row-button items carry it on an
 * inner element, hence the :has(). Scoped to the drawer's own class because
 * page tabs use aria-current too.
 *
 * If a rebuild moves the class, the row simply falls back to Twenty's own
 * selected look: nothing breaks.
 */
.light { --voceo-nav-active: #6d28d9; --voceo-nav-active-hover: #5b21b6; }
.dark  { --voceo-nav-active: #7c3aed; --voceo-nav-active-hover: #6d28d9; }

.ssah544[aria-current],
.ssah544:has([aria-current]) {
  background: var(--voceo-nav-active) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgb(76 29 149 / 0.25);
}
.ssah544[aria-current]:hover,
.ssah544:has([aria-current]):hover {
  background: var(--voceo-nav-active-hover) !important;
  color: #ffffff !important;
}
.ssah544[aria-current] .s1blnvxp,
.ssah544[aria-current] .salp3gg,
.ssah544[aria-current] svg,
.ssah544:has([aria-current]) .s1blnvxp,
.ssah544:has([aria-current]) .salp3gg,
.ssah544:has([aria-current]) svg {
  color: #ffffff !important;
  stroke: currentColor;
}

/* ---------------------------------------------------------------------------
 * Leads Manager: the "Suggested next action" button (Email or Call) in a
 * muted teal instead of violet, so it reads apart from the violet card it
 * sits in and the blue Engagement brief beside it. Chosen on 15 Nov 2026.
 *
 * The Leads Manager draws into the host page with inline styles and one
 * class, `vx-act`, on every action button. The primary ones carry
 * `background: rgb(139, 92, 246)` inline; `:has(svg)` keeps the "Any stage"
 * filter chip (same look, no icon) violet. If the app changes that colour,
 * the rule stops matching and the button simply goes back to violet.
 */
button.vx-act[style*="background: rgb(139, 92, 246)"]:has(svg) {
  background: #2f7d74 !important;
  border-color: #2f7d74 !important;
  color: #ffffff !important;
}
button.vx-act[style*="background: rgb(139, 92, 246)"]:has(svg):hover {
  background: #276a62 !important;
  border-color: #276a62 !important;
}

/* ---------------------------------------------------------------------------
 * Leads Manager: the share bar under each "Your pipeline" number, at full
 * strength in calm but clear colours (chosen 15 Nov 2026). The app draws
 * them at half opacity in muted tones, which read as faded.
 *
 * Each segment is a `button.vx-tile`, direct children of one grid, in this
 * order: All leads, Untouched, Follow-ups, Interested, Applied,
 * Not interested, Unreachable. The bar is `.vx-share` inside it. If the app
 * ever reorders the segments the colours follow position, not meaning:
 * re-check this list.
 */
.vx-tile .vx-share { opacity: 1 !important; }
.vx-tile:nth-child(2) .vx-share { background: #64748b !important; } /* Untouched: slate */
.vx-tile:nth-child(3) .vx-share { background: #f59e0b !important; } /* Follow-ups: amber */
.vx-tile:nth-child(4) .vx-share { background: #8b5cf6 !important; } /* Interested: violet */
.vx-tile:nth-child(5) .vx-share { background: #10b981 !important; } /* Applied: emerald */
.vx-tile:nth-child(6) .vx-share { background: #f43f5e !important; } /* Not interested: rose */
.vx-tile:nth-child(7) .vx-share { background: #38bdf8 !important; } /* Unreachable: sky */
/* The selected segment sits on violet: its track is drawn white at 28%, so
   the bar turns solid white to stay visible. */
.vx-tile [style*="rgba(255, 255, 255, 0.28)"] > .vx-share { background: #ffffff !important; }

/* ------------------------------------------------------------- view badge
 *
 * A sidebar row that points at a VIEW is not drawn as one icon. Twenty draws
 * the OBJECT's icon and puts the VIEW's icon in a small badge over its
 * bottom-right corner — NavigationMenuItemIconWithOverlay, class `.s1ua4r09`
 * in the deployed build, 12x14 at bottom:-5px right:-6px, with its own
 * background and its own icon colour.
 *
 * The selected-row rule above whitens EVERY svg in the row so the icon and
 * the label read on the violet pill. It caught the badge too, and a white
 * 12px glyph on the badge's light grey background is an empty white tile
 * stuck to the corner of the icon — which is exactly what it looked like.
 *
 * Hand the badge back its own colour. It sits on its own background rather
 * than on the violet, so it needs no help to be legible. If a rebuild moves
 * the class the badge simply goes back to being white-on-white: no worse
 * than before this rule, and nothing else is affected.
 */
.ssah544[aria-current] .s1ua4r09 svg,
.ssah544:has([aria-current]) .s1ua4r09 svg {
  color: var(--t-gray-scale-gray10) !important;
}

/* ---------------------------------------------------------------------------
 * THE TABLE CARD MUST NOT CLIP ITS CONTENTS.
 *
 * This is the fix for the blank cells, the grey rectangles and the flicker
 * reported on Partners, Payments and Leads through November 2026.
 *
 * .s1fa8tkp is StyledTableCard, added by our own ui-redesign patch
 * (RecordIndexTableContainer.tsx). It carried `border-radius` AND
 * `overflow: hidden` together. Inside it Twenty pins table cells with
 * `position: sticky` — 24 declarations across 8 components, times the 240 row
 * slots the table recycles — so a rounded clip around a few hundred pinned
 * layers forces Chrome to re-cut every one of them to the corner curve on
 * every repaint. It cannot keep up and composites the frame with tiles still
 * unpainted. Those missing tiles ARE the grey rectangles and the empty cells;
 * Chrome's own frame reports said `has_missing_content = true`.
 *
 * It is the same trigger this file already documents for the panel on 6 Nov
 * 2026 ("Why there is no overflow: clip on the panel"). That fix took the clip
 * out of the CSS; the identical clip stayed in the table card's source.
 *
 * Both properties are removed because that is the combination that was
 * actually tested. `overflow` is the load-bearing half — a radius with no clip
 * costs nothing to composite — but the cells inside are
 * background.primary (white) against a tinted page ground, so a kept radius
 * would show four white square corners poking past the curve.
 *
 * ⚠ THIS IS THE QUICK FIX, AND IT IS KEYED ON A HASH. The permanent fix is in
 * twenty-fork/ui-redesign/voceo-ui-redesign.patch, which no longer adds either
 * property. Once an image is built from that patch, this rule is redundant and
 * can be dropped. Until then, if the table card component is ever rebuilt the
 * class changes and this rule silently stops matching. Re-read it with:
 *   docker exec voceo-crm-server sh -c \
 *     'grep -rho "\.[a-z0-9]*{[^}]*}" /app/packages/twenty-server/dist/front/assets/RecordIndexPage-*.css' \
 *     | grep "border-radius.*overflow:hidden"
 * (NOT from /assets/index-*.js — the record index is a lazy chunk and the
 * class is not in the entry bundle. Checked 18 Nov 2026.)
 *
 * If the rounded look is wanted back, round the header row's top corners and
 * the last row's bottom corners, or mask the four corners with a
 * radial-gradient overlay — never by clipping this container. See
 * docs/FIX-TABLE-BLANK-CELLS-AND-FLICKER.md section 9b.
 */
.s1fa8tkp {
  overflow: visible !important;
  border-radius: 0 !important;
}
