/* PRTY OS — Event Planning Sheet (Event Workspace tab: sheet). Dense spreadsheet-style sections built on the
   shared .tbl table primitive (css/components.css) and .panel (css/base.css) — this file only adds the sheet-specific
   bits: the fx (currency-conversion) inline cell, the break-even strip, the compact Columns menu, and the P&L totals
   / scenario blocks. */

.eps { display: flex; flex-direction: column; gap: var(--s-5, 20px); }
.eps-panel--full { width: 100%; }

/* ---- fx (currency conversion) inline cell ---- */
.eps-fx { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.eps-fx__rate { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); }
.eps-fx__override, .eps-fx__actual {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); font-size: var(--fs-11); font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1;
}
.eps-fx__override:hover, .eps-fx__actual:hover { border-color: var(--brand, var(--accent, #6a5cff)); color: var(--brand, var(--accent, #6a5cff)); background: color-mix(in srgb, var(--brand, var(--accent, #6a5cff)) 10%, var(--bg-2)); }

/* ---- travel/hotel: ONE collapsed current amount (item 1) ---- */
.eps-travelhotel { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }

/* ---- per-field audit history badge (item 1/3: "collapse to one field, keep the previous value") ---- */
.eps-fieldhist { position: relative; display: inline-flex; }
.eps-fieldhist__btn {
  display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text-3); cursor: pointer; line-height: 1;
}
.eps-fieldhist__btn:hover { border-color: var(--brand, var(--accent, #6a5cff)); color: var(--brand, var(--accent, #6a5cff)); }
.eps-fieldhist__panel { position: absolute; right: 0; top: 100%; margin-top: 4px; min-width: 180px; padding: 6px; z-index: 60; display: flex; flex-direction: column; gap: 4px; }
.eps-fieldhist__row { display: flex; flex-direction: column; padding: 4px 6px; border-radius: 6px; gap: 1px; }
.eps-fieldhist__row:hover { background: var(--bg-2); }

/* ---- compact "2300–0030" set-time cell (item 1) ---- */
.eps-settime--compact {
  border: 1px solid transparent; background: transparent; color: var(--text-1); font-variant-numeric: tabular-nums;
  font-size: var(--fs-13); padding: 3px 6px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.eps-settime--compact:hover { border-color: var(--line); background: var(--bg-2); }
.eps-settime--editing { align-items: center; }
.eps-settime__done { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); cursor: pointer; }

/* ---- ticket revenue: break-even strip ---- */
.eps-be { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg-2); font-size: var(--fs-13); }
.eps-be__label { color: var(--text-3); }
.eps-be__value { font-weight: 600; }

/* ---- ticket revenue: capacity / allocation / forecast / break-even row of stat figures ---- */
.eps-be-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.eps-fig { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 8px; background: var(--bg-2); min-width: 120px; flex: 1 1 140px; }
.eps-fig__label { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.eps-fig__value { font-weight: 600; font-size: var(--fs-14); }
.eps-fig__value .input { padding: 2px 6px; }
@media (max-width: 560px) { .eps-be-row { flex-direction: column; } .eps-fig { min-width: 0; } }

/* ---- Approx. rates editor (item 2 — reuses the Columns menu's panel styling) ---- */
.eps-approxrates { position: relative; display: inline-block; }

/* ---- Columns menu (Artists / Other Costs sections) ---- */
.eps-colmenu { position: relative; display: inline-block; }
.eps-colmenu__panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; width: 260px; max-height: 360px; overflow: auto; padding: 10px; }
.eps-colmenu__row { padding: 4px 0; justify-content: space-between; }
.eps-colmenu__move { background: none; border: none; padding: 2px; cursor: pointer; color: var(--text-3); }
.eps-colmenu__move:disabled { opacity: 0.3; cursor: default; }

/* ---- dense sheet tables: tighter cell padding than the default .tbl ---- */
.eps-sheet td { padding: 2px 8px; }
.eps-sheet input.input--sm, .eps-sheet select.input--sm { height: 26px; }

/* ---- Other event costs: full-width spreadsheet rows grouped into named, collapsible sections ---- */
.eps-cost-table { width: 100%; }
.eps-cost-sec__head td { background: var(--bg-2); border-top: 1px solid var(--line); padding: 6px 8px; }
.eps-cost-sec__btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-weight: 600; font-size: var(--fs-13); color: var(--text-1); padding: 2px 0; }
.eps-cost-sec__count { color: var(--text-3); font-weight: 500; font-size: var(--fs-12); }
.eps-cost-sec__empty { padding: 8px; }
.eps-cost-sec__total td { border-top: 2px solid var(--line); font-weight: 700; padding: 8px; }

/* ---- Highlight strip (top of sheet): single aligned row on wide screens, compact grid below 900px ---- */
.eps-hl { display: flex; flex-wrap: nowrap; gap: 0; overflow-x: auto; align-items: stretch; }
.eps-hl__cell { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1 1 0; min-width: 88px; max-width: 100%; border-right: 1px solid var(--line); overflow: hidden; }
.eps-hl__cell:last-child { border-right: none; }
.eps-hl__label { font-size: var(--fs-11); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.03em; white-space: normal; line-height: 1.25; overflow-wrap: break-word; }
.eps-hl__value { font-weight: 700; font-size: var(--fs-16); font-variant-numeric: tabular-nums; color: var(--c, var(--text-1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eps-hl__sub { font-size: var(--fs-11); color: var(--text-3); overflow-wrap: break-word; }
.eps-hl__warn { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--amber, #b7791f) 12%, transparent); color: var(--amber, #b7791f); font-size: var(--fs-13); }

/* ---- item 6: ticket-review Resolve panel ---- */
.eps-resolve { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); }
.eps-resolve__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.eps-resolve__issues { margin: 0 0 8px; padding-left: 18px; font-size: var(--fs-13); }
.eps-resolve__actions textarea.input { font: inherit; resize: vertical; }
.eps-resolve__history { margin-top: 10px; }
.eps-resolve__histrow { padding: 4px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .eps-hl { flex-wrap: wrap; overflow-x: visible; }
  .eps-hl__cell { flex: 1 1 45%; min-width: 130px; border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .eps-hl__cell { flex: 1 1 100%; }
}

/* ---- P&L totals ---- */
.eps-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.eps-totals__row { display: contents; }
.eps-totals__label { color: var(--text-3); font-size: var(--fs-13); }
.eps-totals__value { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.eps-totals__warn { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--red, #d9534f) 12%, transparent); color: var(--red, #d9534f); font-size: var(--fs-13); }

/* ---- What-if scenarios ---- */
.eps-scenarios { display: flex; flex-direction: column; gap: 6px; }
.eps-scenario-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); }
.eps-scenario-row__name { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); }
.eps-scenario-edit { padding: 12px; }

@media (max-width: 640px) {
  .eps-colmenu__panel { right: auto; left: 0; width: 220px; }
  .eps-totals { grid-template-columns: 1fr; }
  .eps-totals__value { text-align: left; }
  .eps-fx { justify-content: flex-start; }
}
