/* ============================================================================
   Harvest — iService look (light/dark) for the Team Roadmap "Tracking" aside.

   The Harvest aside boxes live in the roadmap's right column. Their widget frame
   (header + body) is already themed by the iService plugin's generic .widget-box
   rules; what stayed behind is the "Tracking" (Woche) module's INNER markup —
   #harvest-week and its .harvest-week-* / .hw-* children — which harvest.css
   paints in a fixed light-orange palette. On the dark theme those read as bright
   islands. This file re-maps only that neutral chrome (backgrounds, borders,
   grey chips, muted text) onto the shared iService tokens, so the module fits
   the theme in both modes.

   Like every plugin theme it only CONSUMES the tokens (--is-*, defined globally
   on <html> by the iService plugin) and is prefixed with
   [data-iservice-theme="iservice"], so the classic skin is untouched and the
   whole thing follows light/dark automatically because the tokens do.

   Kept SEMANTIC (deliberately NOT themed): the Harvest-orange play/stop control,
   the team "meeting" badge and the per-task colour bars + legend-chip fills —
   Harvest's own small palette, the counterpart of the theme's status-square
   colours. See the iService plugin's theme conventions.
   ============================================================================ */
:root {
	--harvest-color: #f97325;
}

[data-iservice-theme="iservice"] .iservice-tracked {
	background-color: var(--is-sunken);
	border: none;
	color: var(--harvest-color);
}

/* ---------------------------------------------------------------------------
   Harvest logo in the aside box headers: the source SVG (harvest.svg) is black,
   which reads on the classic orange header but nearly vanishes on the themed
   header — grey in light, dark in dark. Recolour it to the Harvest orange in
   BOTH modes: visible everywhere and a quiet brand cue for the whole group.
   Same filter idiom the tracked-hours icon (.iservice-harvest-icon) already
   uses; this chain turns black → the Harvest orange (lands on rgb(249,128,52),
   indistinguishable from #f97325 at 30×16). One rule covers both modes — orange
   reads on either header tone, so no per-mode variant is needed.
   --------------------------------------------------------------------------- */
[data-iservice-theme="iservice"] .iservice-harvest-icon,
[data-iservice-theme="iservice"] .fa-harvest,
[data-iservice-theme="iservice"] .harvest-aside-box .widget-title .fa-harvest {
	filter: brightness(0) saturate(100%) invert(46%) sepia(100%) saturate(207%) hue-rotate(340deg) brightness(97%) contrast(192%);
}

[data-iservice-theme="iservice"] .widget-box.harvest-aside-box .widget-title i {
	color: var(--harvest-color);
}

/* Module container — sits on the themed widget body instead of light orange. */
[data-iservice-theme="iservice"] #harvest-week {
	background: var(--is-surface);
	color: var(--is-fg);
}

/* Week total + per-day heads: the emphasised bands, one step sunken. */
[data-iservice-theme="iservice"] .harvest-week-total,
[data-iservice-theme="iservice"] .harvest-week-day-head {
	background: var(--is-surface-3);
	color: var(--is-fg);
}

/* Foldable day heads react on hover with a touch of the accent tint. */
[data-iservice-theme="iservice"] .harvest-week-day.is-toggleable>.harvest-week-day-head:hover {
	background: var(--is-accent-weak);
}

/* Legend strip above the list — blends with the body; only the divider is a token. */
[data-iservice-theme="iservice"] .harvest-week-legend {
	background: var(--is-surface);
	border-bottom-color: var(--is-border);
}

/* Legend chips keep their task colour (inline) — only the border rides the token. */
[data-iservice-theme="iservice"] .harvest-week-legend-chip {
	border-color: var(--is-border);
}

/* Row separators. */
[data-iservice-theme="iservice"] .harvest-week-day {
	border-top-color: var(--is-border);
}

[data-iservice-theme="iservice"] .harvest-week-entry {
	border-bottom-color: var(--is-border);
}

/* List rows behave like the roadmap's triage rows: surface base, sunken hover. */
[data-iservice-theme="iservice"] .harvest-week-entry:hover {
	background: var(--is-surface-3);
}

/* Muted secondary text. */
[data-iservice-theme="iservice"] .harvest-week-empty,
[data-iservice-theme="iservice"] .harvest-week-entry .hw-task,
[data-iservice-theme="iservice"] .harvest-week-entry .hw-note,
[data-iservice-theme="iservice"] .harvest-week-entry .hw-bug-meta {
	color: var(--is-fg-muted);
}

/* Grey chips (Mantis project · category, generic meta) → the inset "well" tone,
   mirroring the roadmap card's .iservice-card-meta chips. */
[data-iservice-theme="iservice"] .harvest-week-entry .hw-bug-project,
[data-iservice-theme="iservice"] .harvest-week-entry .hw-bug-category,
[data-iservice-theme="iservice"] .harvest-week-entry .hw-meta {
	background: var(--is-sunken);
	color: var(--is-fg-muted);
}

/* ---------------------------------------------------------------------------
   Billable / breakdown bar → the iService progress-bar look: the track is the
   sunken "well" with the theme radius, like .progress in the iService theme.
   The border stays (themed) so the white-in-light well is delineated on the
   near-white surface. The billable split rides the accent — full accent for
   billable, a lighter accent/page mix for non-billable — and the legend swatches
   follow. Breakdown bars keep their per-project/-task inline colours (semantic).
   --------------------------------------------------------------------------- */
[data-iservice-theme="iservice"] .harvest-aside-box .hb-bar {
	background: var(--is-sunken);
	border: none;
	border-radius: var(--is-radius);
	height: 16px;
}

[data-iservice-theme="iservice"] .harvest-aside-box .hb-dot {
	border-color: var(--is-border);
}

[data-iservice-theme="iservice"] .harvest-billable .hb-seg-billable,
[data-iservice-theme="iservice"] .harvest-billable .hb-dot-billable {
	background: var(--is-accent);
}

[data-iservice-theme="iservice"] .harvest-billable .hb-seg-non,
[data-iservice-theme="iservice"] .harvest-billable .hb-dot-non {
	background: color-mix(in srgb, var(--is-accent) 45%, var(--is-page));
}

[data-iservice-theme="iservice"] .harvest-billable .hb-value {
	font-size: 18px;
}

/* ---------------------------------------------------------------------------
   Statistics page: each chart sits in a .wrapper that harvest.css fills solid
   white — a glaring island on the themed (dark) surface. Drop the fill so the
   chart's transparent canvas shows the themed widget body instead, in both
   modes. (The roadmap aside charts use .harvest-stats-chart, which has no fill,
   so they already blend.)
   --------------------------------------------------------------------------- */
[data-iservice-theme="iservice"] .harvest-statistics .wrapper {
	background: transparent;
}

/* ---------------------------------------------------------------------------
   Right-click quick-action menu — appended to <body>, so it lives OUTSIDE the
   roadmap scope but still under the themed <html>.
   --------------------------------------------------------------------------- */
[data-iservice-theme="iservice"] .harvest-week-menu {
	background: var(--is-overlay);
	border: 1px solid var(--is-border);
	box-shadow: var(--is-shadow-h);
	color: var(--is-fg);
}

[data-iservice-theme="iservice"] .harvest-week-menu a {
	color: var(--is-fg);
}

[data-iservice-theme="iservice"] .harvest-week-menu a:hover {
	background: var(--is-accent-weak);
	color: var(--is-fg);
}

[data-iservice-theme="iservice"] .harvest-week-menu-sep {
	border-top-color: var(--is-border);
}

/* ---------------------------------------------------------------------------
   Tracking widget (.harvest) — shown on the issue view AND inside the floating
   .harvest-track-popup (opened from roadmap cards). harvest.css paints it a fixed
   peach (#ffe7d9) with an orange frame (#f97325); drop the orange and put it on
   the tokens so it fits the theme in both modes and both places.
   --------------------------------------------------------------------------- */
[data-iservice-theme="iservice"] .harvest {
	background: var(--is-surface);
	border-color: var(--is-border);
	border-radius: var(--is-radius);
	color: var(--is-fg);
}

[data-iservice-theme="iservice"] .bug-custom-field.harvest {
	color: var(--harvest-color);
}

/* Tracking-form buttons are bare <button class="save|save-track|cancel|delete|…">
   — NOT .btn — so the global button theme misses them and they render as pale
   default buttons. Give them the themed button look; the confirm actions (save /
   save & track / start) ride the accent. */
[data-iservice-theme="iservice"] .harvest button {
	background: var(--is-accent-weak);
	border: 1px solid var(--is-accent-weak);
	border-radius: var(--is-radius);
	color: var(--is-fg);
	margin-right: 5px;
	padding: 4px 10px;
}

[data-iservice-theme="iservice"] .harvest button:hover {
	background: var(--is-surface-3);
}

[data-iservice-theme="iservice"] .harvest button.save,
[data-iservice-theme="iservice"] .harvest button.save-track,
[data-iservice-theme="iservice"] .harvest button.start {
	background: var(--is-accent);
	border-color: var(--is-accent);
	color: #fff;
}

/* Dark: the accent is a light blue — flip the label to the dark page tone so it
   stays readable (same trick the global .btn-primary uses). */
[data-iservice-theme="iservice"][data-iservice-mode="dark"] .harvest button.save,
[data-iservice-theme="iservice"][data-iservice-mode="dark"] .harvest button.save-track,
[data-iservice-theme="iservice"][data-iservice-mode="dark"] .harvest button.start {
	color: var(--is-page);
}

/* The form table (<table class="track table table-bordered">) is now handled by
   the GLOBAL .table / .category rules in the iService plugin's theme (they beat
   ace's #fff !important cells) — nothing table-specific is needed here anymore. */

/* Tracking history list. */
[data-iservice-theme="iservice"] .harvest .trackings li {
	border-bottom-color: var(--is-border);
}

[data-iservice-theme="iservice"] .harvest .trackings li .notes {
	color: var(--is-fg-muted);
}

/* Floating tracking popup — the elevated overlay, like the other flyouts. */
[data-iservice-theme="iservice"] .harvest-track-popup {
	background: var(--is-overlay);
	border-color: var(--is-border);
	border-radius: var(--is-radius);
	color: var(--is-fg);
}

/* Inside the popup the .harvest form fills the frame — no nested card/border. */
[data-iservice-theme="iservice"] .harvest-track-popup .harvest {
	background: transparent;
	border: 0;
}

[data-iservice-theme="iservice"] .harvest-track-close {
	color: var(--is-fg-muted);
}

/* Searchable-select dropdown (project search) — a floating white list; put it on
   the overlay too, with themed zebra + lines + hover. */
[data-iservice-theme="iservice"] .searchBoxElement {
	background: var(--is-overlay);
	border-color: var(--is-border);
}

[data-iservice-theme="iservice"] .searchBoxElement li {
	border-bottom-color: var(--is-border);
}

[data-iservice-theme="iservice"] .searchBoxElement li:nth-child(even) {
	background-color: var(--is-surface-2);
}

[data-iservice-theme="iservice"] .searchBoxElement li:hover {
	background-color: var(--is-accent-weak) !important;
	color: var(--is-fg);
}