/* FruitSync — Plan plantare v2 */
.pv-overlay { position: fixed; inset: 0; z-index: 950; background: var(--bg); overflow: hidden; }
.pv-overlay.hidden { display: none; }
.pv-shell { display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 18px 24px; box-sizing: border-box; }

.pv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pv-title h2 { margin: 2px 0; font-size: 1.5rem; }
.pv-sub, .pv-muted { color: var(--muted); font-size: 0.86rem; }
.pv-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-head-actions .ghost-button, .pv-head-actions .primary-button { padding: 0 14px; }
.ghost-button.active { background: var(--accent); color: #fff; }

.pv-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pv-tool { display: flex; align-items: center; gap: 6px; }
.pv-label { font-size: 0.78rem; font-weight: 750; color: var(--muted); }
.pv-search { margin-left: auto; }
.pv-search input { width: 120px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); }
.pv-zoom .ghost-button { width: 38px; min-height: 36px; padding: 0; }
.pv-zoom span { width: 46px; text-align: center; font-size: 0.8rem; font-weight: 750; color: var(--muted); }

.pv-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); align-self: flex-start; }
.pv-seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.pv-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

.pv-body { display: flex; gap: 14px; flex: 1; min-height: 0; }
.pv-mapcard { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pv-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pv-total { font-size: 0.85rem; margin-right: 6px; }
.pv-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 0.78rem; font-weight: 650; }
.pv-chip em { font-style: normal; color: var(--muted); font-weight: 500; }
.pv-chip.on { border-color: var(--ink); background: var(--surface-2); }
.pv-sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; box-sizing: border-box; }
.pv-sw.empty { border: 1.5px dashed #8b8e9a; }
.pv-hint { margin: 0; font-size: 0.8rem; color: var(--muted); }

.pv-map { --z: 18px; flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.pv-grid { display: flex; flex-direction: column; gap: calc(var(--z) * 0.35 + 2px); width: max-content; }
.pv-row { display: flex; align-items: center; gap: 2px; height: var(--z); }
.pv-ruler { height: 14px; position: sticky; top: -10px; z-index: 2; background: var(--surface-2); }
.pv-ruler span { flex: none; width: var(--z); font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
.pv-ruler .pv-rowlbl-sp, .pv-rowlbl { flex: none; width: 42px; margin-right: 6px; }
.pv-rowlbl { position: sticky; left: -12px; z-index: 1; height: 100%; min-height: 0; padding: 0 6px 0 0; border: 0; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; text-align: right; }
.pv-rowlbl:hover, .pv-rowlbl.on { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); color: var(--ink); }
.pv-rowlen { flex: none; padding-left: 6px; font-size: 11px; color: var(--muted); }
.pv-off { flex: none; width: calc(var(--off) * (var(--z) + 2px) - 2px); height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px); }

.pv-cell { position: relative; flex: none; width: var(--z); height: var(--z); min-height: 0; padding: 0; border: 0; border-radius: calc(var(--z) / 5); box-sizing: border-box; cursor: pointer; }
.pv-cell:hover { filter: brightness(1.12); }
.pv-cell:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.pv-cell.empty { border: 1.5px dashed #8b8e9a; }
.pv-cell.dim { opacity: 0.15; }
.pv-cell.dim-soft { opacity: 0.45; }
.pv-cell.sel { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--ink); z-index: 1; }
.pv-cell.msel { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--accent-2); }
.pv-dot { position: absolute; top: -2px; right: -2px; width: max(5px, calc(var(--z) / 2.6)); height: max(5px, calc(var(--z) / 2.6)); border-radius: 50%; border: 1px solid var(--surface); }
.pv-num { font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 0 2px rgba(0, 0, 0, 0.5); }
.pv-cell.empty .pv-num { color: var(--muted); text-shadow: none; }

.pv-side { flex: none; width: 400px; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pv-side h3 { margin: 0; font-size: 1.1rem; }
.pv-side p { margin: 0; }
.pv-side .eyebrow { margin: 0; }
.pv-fiche-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pv-pos { font-size: 1.7rem !important; font-weight: 850; }
.pv-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 750; white-space: nowrap; }
.pv-badge.empty { border: 1.5px dashed #8b8e9a; }
.pv-nav { display: flex; gap: 6px; }
.pv-nav .ghost-button { min-height: 36px; padding: 0 10px; font-size: 0.8rem; font-weight: 750; }
.pv-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); }
.pv-tab { min-height: 34px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-weight: 750; font-size: 0.85rem; }
.pv-tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.pv-tabbody { display: flex; flex-direction: column; gap: 12px; }

.pv-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pv-form label, .pv-entry { display: flex; flex-direction: column; gap: 5px; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.pv-form .span-2 { grid-column: 1 / -1; }
.pv-side input, .pv-side select { height: 36px; padding: 0 10px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 0.86rem; font-weight: 500; }
.pv-side input[type="color"] { width: 44px; padding: 2px; }
.pv-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 0.85rem; line-height: 1.45; }
.pv-inline { display: flex; gap: 8px; }
.pv-inline > * { flex: 1; }
.pv-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.pv-wrap .ghost-button { min-height: 36px; padding: 0 12px; font-size: 0.82rem; }
.pv-small { font-size: 0.78rem; }
.pv-ok { color: var(--ok); font-size: 0.82rem; font-weight: 650; }
.pv-kv { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 0.86rem; }
.pv-kv div { display: flex; justify-content: space-between; gap: 8px; }
.pv-kv dt { color: var(--muted); }
.pv-kv dd { margin: 0; font-weight: 750; text-align: right; }

.pv-timeline { list-style: none; margin: 0; padding: 0; }
.pv-timeline li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.pv-timeline li > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pv-date { flex: none; width: 82px; font-size: 0.78rem; font-weight: 750; color: var(--muted); }
.pv-x { flex: none; width: 28px; height: 28px; min-height: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 1rem; }
.pv-x:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.pv-pill { align-self: flex-start; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 750; background: color-mix(in srgb, var(--accent-2) 16%, var(--surface)); color: var(--accent-2); }
.pv-pill.t-status { background: color-mix(in srgb, #8166a3 18%, var(--surface)); color: #8166a3; }
.pv-pill.t-tratament, .pv-pill.plan { background: color-mix(in srgb, var(--warning) 20%, var(--surface)); color: color-mix(in srgb, var(--warning) 60%, var(--ink)); }
.pv-pill.t-nlocuire, .pv-pill.done, .pv-pill.h-plant { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.pv-pill.h-parcel { background: color-mix(in srgb, var(--accent-3) 18%, var(--surface)); color: var(--accent-3); }

.pv-list { display: flex; flex-direction: column; gap: 8px; }
.pv-task { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.85rem; }
.pv-task > div { display: flex; justify-content: space-between; gap: 8px; }

.pv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pv-tiles div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 8px; background: var(--surface-2); }
.pv-tiles span, .pv-tiles em { font-size: 0.72rem; font-style: normal; color: var(--muted); font-weight: 650; }
.pv-tiles strong { font-size: 1rem; }

.pv-brushes { display: flex; flex-direction: column; gap: 6px; }
.pv-brush-row { display: flex; gap: 6px; }
.pv-brush-row .pv-brush { flex: 1; }
.pv-brush { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-weight: 650; text-align: left; }
.pv-brush .pv-sw { width: 18px; height: 18px; border-radius: 4px; }
.pv-brush.on { border: 2px solid var(--ink); background: var(--surface); }
.pv-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.8rem; color: var(--muted); }
.pv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pv-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; box-sizing: border-box; }
.pv-legend i.empty { border: 1.5px dashed #8b8e9a; }

.pv-cfg-table { display: flex; flex-direction: column; gap: 4px; }
.pv-cfg-row { display: grid; grid-template-columns: 44px repeat(3, minmax(0, 1fr)) 30px; gap: 6px; align-items: center; font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.pv-cfg-row input, .pv-cfg-row select { height: 32px !important; padding: 0 8px !important; }
.pv-cfg-head { font-size: 0.72rem; font-weight: 750; }

/* ciornă / salvare */
.pv-dirty { display: inline-block; margin-top: 4px; font-size: 0.78rem; font-weight: 700; color: var(--ok); }
.pv-dirty.on { color: var(--warning); }
.pv-head-actions button:disabled { opacity: 0.45; cursor: default; }
.pv-dialog-back { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(20, 21, 28, 0.45); }
.pv-dialog-back.hidden { display: none; }
.pv-dialog { width: min(460px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.pv-dialog h3 { margin: 0; font-size: 1.15rem; }
.pv-dialog p { margin: 0; color: var(--muted); line-height: 1.5; }
.pv-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pv-dialog-actions button { padding: 0 14px; }
.pv-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.pv-rowlbl.chg { box-shadow: inset 0 0 0 2px var(--warning); color: var(--ink); }
.pv-side input.chg, .pv-side select.chg { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, var(--surface)); }
.pv-revert { width: 30px; height: 32px; min-height: 0; padding: 0; border: 1px solid var(--warning); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 1rem; font-weight: 800; }
.pv-revert:hover { background: color-mix(in srgb, var(--warning) 20%, var(--surface)); }
.pv-warn { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.pv-warn .ghost-button { min-height: 36px; padding: 0 12px; font-size: 0.82rem; }
.pv-new { font-style: normal; font-size: 0.65rem; color: var(--accent-2); }
.pv-pill.pend { background: color-mix(in srgb, var(--warning) 22%, var(--surface)); color: color-mix(in srgb, var(--warning) 55%, var(--ink)); }

@media (max-width: 760px) {
  .pv-shell { height: auto; min-height: 100%; padding: 10px 10px 60px; gap: 8px; }
  .pv-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .pv-head { align-items: center; gap: 8px; }
  .pv-title h2 { font-size: 1.1rem; }
  .pv-title .eyebrow, .pv-sub { display: none; }
  .pv-head-actions { gap: 6px; }
  .pv-head-actions .ghost-button, .pv-head-actions .primary-button { min-height: 36px; padding: 0 10px; font-size: 0.78rem; }
  .pv-toolbar { gap: 6px; padding: 6px; }
  .pv-toolbar .pv-label { display: none; }
  .pv-seg button { padding: 0 10px; }
  .pv-search { margin-left: 0; flex: 1; }
  .pv-search input { flex: 1; width: auto; }
  .pv-body { flex-direction: column; flex: none; }
  .pv-mapcard { padding: 8px; }
  .pv-chips { flex-wrap: nowrap; overflow-x: auto; }
  .pv-map { flex: none; height: 42vh; }
  .pv-side { width: auto; overflow: visible; }
  .pv-pos { font-size: 1.35rem !important; }
  .pv-nav .ghost-button { flex: 1; min-height: 44px; }
  .pv-tabs { overflow-x: auto; }
  .pv-cell { min-width: 0; }
}
