/* Area D – Reports, export (DATEV) (docs/AREAS.md). Only page-specific rules – shared look comes from theme.css / app.css / components.css.
   Charts are plain CSS bars (no library); colours from tokens, light/dark. No all-caps labels, no thick coloured borders. */
.rp-filters .report-bar { padding-bottom: 18px; }
.rp-filters .rp-emp { flex: 1 1 220px; max-width: 300px; }
.rp-filters .rp-custom { gap: 6px; } .rp-filters .rp-custom .input { width: 150px; }
.rp-body { display: flex; flex-direction: column; gap: var(--gap, 16px); margin-top: var(--gap, 16px); }
.rp-body .grid { gap: var(--gap, 16px); }
.rp-kpis .kpi .val small { font-size: 14px; font-weight: 500; color: var(--text-3); }
.rp-body .pos, .ex-top .pos { color: var(--success); } .rp-body .neg, .ex-top .neg { color: var(--danger); }
.rp-body .tbl .mini { display: block; }

/* weekly hours: vertical bars, target as a dashed marker */
.rp-weeks { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 6px; }
.rp-week { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.rp-col { position: relative; flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.rp-bar { display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, var(--surface)) 100%); }
.rp-bar.over { background: linear-gradient(180deg, var(--brand-600, var(--primary)) 0%, var(--primary) 100%); }
.rp-target { position: absolute; left: -3px; right: -3px; height: 0; border-top: 2px dashed var(--text-3); }
.rp-week small { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.rp-lg-bar, .rp-lg-target { display: inline-block; width: 12px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.rp-lg-bar { background: var(--primary); } .rp-lg-target { height: 0; border-top: 2px dashed var(--text-3); border-radius: 0; vertical-align: 3px; }

/* overtime by team: horizontal bars, diverging around zero when there are negative values */
.rp-teams { display: flex; flex-direction: column; gap: 14px; }
.rp-team { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.rp-team-name small { font-size: 11px; }
.rp-track { position: relative; height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.rp-fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--primary); }
.rp-fill.neg { background: var(--danger); opacity: .8; }
.rp-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--border-strong); }
.rp-team b { font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }

/* 8-hour average: small bar with the limit marker */
.rp-avg { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.rp-avg-bar { position: relative; width: 70px; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rp-avg-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--success); }
.rp-avg-bar span.neg { background: var(--danger); }
.rp-avg-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text-3); }

/* more reports */
.rp-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.rp-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none !important; background: var(--surface); }
.rp-link:hover { background: var(--surface-2); border-color: var(--border-strong); }
.rp-link > .icon:first-child { stroke: var(--primary); flex: none; }
.rp-link span { display: flex; flex-direction: column; min-width: 0; flex: 1; } .rp-link small { color: var(--text-3); font-size: var(--fs-xs); }

/* monthly timesheet */
.rp-ts tr.rp-weekend td { background: var(--surface-2); color: var(--text-3); }
.rp-ts .mini { display: inline; }

/* export */
.ex-note { margin-bottom: var(--gap, 16px); }
.ex-top { margin-bottom: var(--gap, 16px); align-items: start; }
.ex-picked { margin-top: 8px; } .ex-picked:empty { display: none; }
.ex-picked .chip .icon { width: 12px; height: 12px; }
.ex-wage .num { font-variant-numeric: tabular-nums; }
.ex-check { list-style: none; margin: 8px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: var(--radius); background: var(--surface-2); font-size: var(--fs-sm); }
.ex-item small { display: block; margin-top: 2px; }
.ex-item.ex-ok .icon { stroke: var(--success); } .ex-item.ex-warn { background: var(--warning-bg); } .ex-item.ex-warn .icon { stroke: var(--warning); }
.ex-item.ex-error { background: var(--danger-bg); } .ex-item.ex-error .icon { stroke: var(--danger); }
.ex-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.ex-preview > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 2px; }
.ex-preview b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ex-wedit { display: flex; flex-direction: column; gap: 10px; }
.ex-wrow { display: grid; grid-template-columns: minmax(150px, 1.2fr) 90px minmax(120px, 1.4fr) auto; gap: 10px; align-items: center; }
.ex-wrow > div:first-child { display: flex; flex-direction: column; } .ex-wrow small { font-size: var(--fs-xs); }

@media (max-width: 720px) {
  .rp-body .rp-hs, .ex-hist .ex-hs { display: none; }
  .rp-filters .rp-emp { max-width: none; flex-basis: 100%; }
  .rp-filters .report-bar > select.input, .rp-filters .report-bar > .search-in { flex: 1 1 100%; max-width: none; width: 100%; }
  .rp-filters .rp-custom { flex: 1 1 100%; } .rp-filters .rp-custom .input { width: auto; flex: 1; min-width: 0; }
  .rp-weeks { height: 160px; gap: 3px; }
  .rp-team { grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 8px; }
  .rp-avg-bar { display: none; }
  .ex-wrow { grid-template-columns: 1fr 80px; } .ex-wrow [data-desc] { grid-column: 1 / -1; }
  .ex-preview b { font-size: 16px; }
}
