/* ===== Grafy a výkazy (úvodní stránka) ===== */
:root {
  --rp-hours: #007AFF; --rp-travelHours: #32ADE6; --rp-km: #FF9500;
  --rp-value: #5856D6; --rp-work: #007AFF; --rp-travel: #32ADE6; --rp-transport: #FF9500;
  --rp-material: #34C759; --rp-other: #AF52DE;
  --rp-invoiced: #007AFF; --rp-paid: #34C759; --rp-unpaid: #FF3B30;
}
@media (prefers-color-scheme: dark) {
  :root {
    --rp-hours: #0A84FF; --rp-travelHours: #64D2FF; --rp-km: #FF9F0A;
    --rp-value: #7D7AFF; --rp-work: #0A84FF; --rp-travel: #64D2FF; --rp-transport: #FF9F0A;
    --rp-material: #30D158; --rp-other: #BF5AF2;
    --rp-invoiced: #0A84FF; --rp-paid: #30D158; --rp-unpaid: #FF453A;
  }
}
html.dark {
  --rp-hours: #0A84FF; --rp-travelHours: #64D2FF; --rp-km: #FF9F0A;
  --rp-value: #7D7AFF; --rp-work: #0A84FF; --rp-travel: #64D2FF; --rp-transport: #FF9F0A;
  --rp-material: #30D158; --rp-other: #BF5AF2;
  --rp-invoiced: #0A84FF; --rp-paid: #30D158; --rp-unpaid: #FF453A;
}

/* Přepínač Souhrn / Grafy */
.ov-tabs { margin-top: 12px; }

.rp-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 8px; }
.rp-nav-label { text-align: center; display: flex; flex-direction: column; align-items: center; line-height: 1.25; text-transform: capitalize; }
.rp-today { font-size: var(--font-size-xs); text-decoration: none; text-transform: none; }
.rp-arrow { width: 44px; height: 44px; border: none; border-radius: 50%; background: none; color: var(--blue); font-size: 30px; line-height: 1; cursor: pointer; }
.rp-arrow:active { background: var(--bg-tertiary); }
.rp-arrow:disabled { color: var(--text-quaternary); cursor: default; }

.rp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rp-chips::-webkit-scrollbar { display: none; }
.rp-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: none; border-radius: 18px; background: var(--bg-secondary); color: var(--text-secondary); font-size: var(--font-size-sm); font-weight: 500; cursor: pointer; box-shadow: var(--card-shadow); white-space: nowrap; }
.rp-chip i, .rp-dot, .rp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.rp-dot { margin-right: 8px; }
.rp-chip.active { background: var(--blue); color: #fff; }

.rp-card { padding: 14px 12px 12px; }
.rp-title { font-size: var(--font-size-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; padding: 0 4px; }
.rp-readout { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 4px 4px 0; }
.rp-readout span { color: var(--text-secondary); font-size: var(--font-size-sm); }
.rp-readout strong { font-size: var(--font-size-xl); letter-spacing: -0.4px; text-transform: none; }
.rp-sub { min-height: 1.3em; padding: 0 4px 6px; font-size: var(--font-size-xs); color: var(--text-tertiary); }
.rp-svg { display: block; width: 100%; max-width: 920px; max-height: 560px; margin: 0 auto; height: auto; -webkit-tap-highlight-color: transparent; }
.rp-grid { stroke: var(--separator); stroke-width: 0.6; }
.rp-axis { stroke: var(--text-quaternary); }
.rp-tick { fill: var(--text-tertiary); font-size: 9.5px; font-family: var(--font); }
.rp-unit { fill: var(--text-tertiary); font-size: 9.5px; font-weight: 600; font-family: var(--font); }
.rp-bar { transition: opacity 0.15s; }
.rp-bar.rp-dim { opacity: 0.35; }
.rp-hit { cursor: pointer; }
.rp-empty { position: absolute; left: 0; right: 0; top: 118px; text-align: center; color: var(--text-tertiary); font-size: var(--font-size-sm); z-index: 1; pointer-events: none; }
.rp-card { position: relative; }
.rp-chart-empty { opacity: 0.5; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 4px 0; font-size: var(--font-size-xs); color: var(--text-secondary); }
.rp-legend span { display: inline-flex; align-items: center; gap: 6px; }

.rp-row { cursor: pointer; }
.rp-row.sel { background: var(--blue-light); }
.rp-row .card-row-value { white-space: nowrap; }
.rp-delta { margin-left: 8px; font-size: var(--font-size-xs); font-weight: 600; color: var(--text-tertiary); }
.rp-note { padding: 0 32px 8px; font-size: var(--font-size-xs); color: var(--text-tertiary); line-height: 1.4; }

.rp-details { margin: 8px 16px 16px; background: var(--bg-secondary); border-radius: var(--radius-md); overflow: hidden; }
.rp-details > summary { padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; }
.rp-details > summary::-webkit-details-marker { display: none; }
.rp-details > summary::after { content: '›'; float: right; color: var(--text-quaternary); font-size: 22px; line-height: 1; transition: transform 0.15s; }
.rp-details[open] > summary::after { transform: rotate(90deg); }
.rp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 0.5px solid var(--separator); }
.rp-table { border-collapse: collapse; font-size: var(--font-size-xs); min-width: 100%; }
.rp-table th, .rp-table td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 0.5px solid var(--separator); font-variant-numeric: tabular-nums; }
.rp-table thead th { color: var(--text-tertiary); font-weight: 600; position: sticky; top: 0; background: var(--bg-secondary); }
.rp-table tbody th { text-align: left; font-weight: 500; position: sticky; left: 0; background: var(--bg-secondary); }
.rp-table thead th:first-child { text-align: left; position: sticky; left: 0; z-index: 1; }
.rp-table .rp-total th, .rp-table .rp-total td { font-weight: 700; border-bottom: none; }

/* Žebříček zákazníků */
.rp-rank-chips { padding-top: 0; }
.rp-rank-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 0.5px solid var(--separator); }
.rp-pos { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-tertiary); color: var(--text-secondary); font-size: var(--font-size-xs); font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.rp-rank-main { flex: 1; min-width: 0; }
.rp-rank-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rp-rank-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-rank-top strong { white-space: nowrap; }
.rp-bar-track { height: 6px; border-radius: 3px; background: var(--bg-tertiary); margin: 6px 0 4px; overflow: hidden; }
.rp-bar-fill { height: 100%; border-radius: 3px; }
.rp-rank-sub { font-size: var(--font-size-xs); color: var(--text-tertiary); }
.rp-more { display: block; width: 100%; padding: 14px; border: none; background: none; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
