/* Raporty – aktywność dzienna i ranking pracowników */
.reports-premium .rc-top-grid {
    align-items: stretch;
}

/* Podsumowanie nad wykresem */
.reports-premium .rc-activity-section .daily-chart-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.reports-premium .rc-activity-section .daily-chart-summary small {
    margin-top: 2px;
    color: #94a3b8;
    font-weight: 600;
}

.reports-premium .rc-activity-section .daily-chart-summary .is-total {
    border-color: #bfdbfe;
    background: linear-gradient(145deg, #eff6ff, #fff);
}

.reports-premium .rc-activity-section .daily-chart-summary .is-total strong { color: #1d4ed8; }

/* Wykres */
.rc-chart {
    position: relative;
    isolation: isolate;
    margin: 0 18px 18px;
    padding: 16px 12px 10px;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff, #f6f9fc);
}

.rc-chart-overlay {
    position: absolute;
    top: 16px;
    right: 12px;
    left: 12px;
    height: 190px;
    pointer-events: none;
}

.rc-gridline {
    position: absolute;
    z-index: 0;
    right: 0;
    left: 0;
    height: 0;
    border-top: 1px dashed #e2e8f0;
}

.rc-gridline.is-base { border-top: 1px solid #dbe3ee; }

.rc-gridline span {
    position: absolute;
    top: -11px;
    right: 0;
    padding: 0 3px;
    color: #a0aec0;
    background: #f8fafc;
    font-size: 7px;
    font-weight: 700;
    font-style: normal;
}

.rc-average {
    position: absolute;
    z-index: 3;
    right: 0;
    left: 0;
    height: 0;
    border-top: 1.5px dashed #f59e0b;
}

.rc-average span {
    position: absolute;
    top: -9px;
    left: 0;
    padding: 2px 6px;
    border-radius: 999px;
    color: #92400e;
    background: #fef3c7;
    box-shadow: 0 2px 6px rgba(180, 83, 9, .15);
    font-size: 7px;
    font-weight: 800;
    font-style: normal;
    white-space: nowrap;
}

.reports-premium .rc-chart .bar-chart {
    position: relative;
    z-index: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

.reports-premium .rc-chart .bar-chart-day {
    display: flex;
    flex-direction: column;
    /* Stary układ ustawia align-items: end, co w kolumnie zwężało słupek do zera. */
    align-items: stretch;
    gap: 6px;
    height: auto;
}

.rc-track {
    display: flex;
    align-items: flex-end;
    height: 190px;
    border-radius: 6px;
}

.bar-chart-day.is-weekend .rc-track {
    background: rgba(148, 163, 184, .09);
}

.reports-premium .rc-chart .bar-chart-day .bar {
    width: 100%;
    min-height: 3px;
    border-radius: 5px 5px 2px 2px;
    transition: filter .15s ease, transform .15s ease;
}

.reports-premium .rc-chart .bar-chart-day:not(.has-work) .bar {
    background: #dbe3ee;
    box-shadow: none;
}

.reports-premium .rc-chart .bar-chart-day.is-best .bar {
    background: linear-gradient(180deg, #4338ca, #6366f1);
    box-shadow: 0 8px 16px rgba(79, 70, 229, .25);
}

.reports-premium .rc-chart .bar-chart-day.is-future .bar {
    background: repeating-linear-gradient(135deg, #e2e8f0 0 3px, transparent 3px 6px);
    box-shadow: none;
}

.reports-premium .rc-chart .bar-chart-day.has-work:hover .bar,
.reports-premium .rc-chart .bar-chart-day.has-work:focus-visible .bar {
    filter: brightness(1.08);
    transform: scaleY(1.02);
    transform-origin: bottom;
}

.reports-premium .rc-chart .bar-chart-day small { color: #64748b; }
.reports-premium .rc-chart .bar-chart-day.is-weekend small { color: #b0bccb; }
.reports-premium .rc-chart .bar-chart-day.is-future small { color: #cbd5e1; }

.rc-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #edf2f7;
    color: #7c8b9e;
    font-size: 7.5px;
    font-weight: 700;
}

.rc-chart-legend span { display: inline-flex; gap: 5px; align-items: center; }
.rc-chart-legend i { display: block; width: 9px; height: 9px; border-radius: 3px; }
.rc-chart-legend .is-bar { background: linear-gradient(180deg, #2563eb, #60a5fa); }
.rc-chart-legend .is-best { background: linear-gradient(180deg, #4338ca, #6366f1); }
.rc-chart-legend .is-average { height: 0; border-top: 2px dashed #f59e0b; border-radius: 0; }
.rc-chart-legend .is-weekend { background: rgba(148, 163, 184, .2); }

/* Ranking dopasowany do wysokości wykresu */
.rc-ranking-section {
    display: flex;
    flex-direction: column;
}

.rc-ranking-scroll {
    position: relative;
    flex: 1 1 auto;
    min-height: 320px;
}

.rc-ranking-list {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: start;
    gap: 2px;
    padding: 10px 10px 22px;
    overflow-y: auto;
    scrollbar-width: thin;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
}

.rc-rank {
    display: grid;
    grid-template-columns: 18px 26px minmax(0, 1fr) auto;
    gap: 3px 9px;
    align-items: center;
    padding: 9px 6px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s ease;
}

.rc-rank:last-child { border-bottom: 0; }
.rc-rank:hover { border-radius: 10px; background: #f8fafc; }

.rc-rank-pos {
    color: #94a3b8;
    font-size: 8.5px;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rc-rank.is-top .rc-rank-pos {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    color: #fff;
    background: #94a3b8;
    font-size: 8px;
}

.rc-rank.is-top:nth-child(1) .rc-rank-pos { background: linear-gradient(145deg, #f59e0b, #d97706); }
.rc-rank.is-top:nth-child(2) .rc-rank-pos { background: linear-gradient(145deg, #94a3b8, #64748b); }
.rc-rank.is-top:nth-child(3) .rc-rank-pos { background: linear-gradient(145deg, #c2884f, #9a6436); }

.rc-rank-avatar {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: #1d4ed8;
    background: #e0e9ff;
    font-size: 8px;
    font-weight: 800;
}

.rc-rank.is-top .rc-rank-avatar {
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #6366f1);
}

.rc-rank-main {
    display: flex;
    gap: 6px;
    align-items: baseline;
    min-width: 0;
}

.rc-rank-main strong {
    overflow: hidden;
    color: #1e293b;
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rc-rank-main small {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 7.5px;
}

.rc-rank-total {
    color: #0f172a;
    font-size: 9.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rc-rank.is-top .rc-rank-total { color: #1d4ed8; }

.rc-rank-bar {
    grid-column: 3 / -1;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.rc-rank-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #93c5fd, #3b82f6);
}

.rc-rank.is-top .rc-rank-bar i { background: linear-gradient(90deg, #6366f1, #2563eb); }

.rc-rank-tags {
    display: flex;
    flex-wrap: wrap;
    grid-column: 3 / -1;
    gap: 3px 10px;
    margin-top: 2px;
}

.rc-rank-tags span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    color: #64748b;
    font-size: 7.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: default;
}

.rc-rank-tags i {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
}

.rc-rank-tags .icon { width: 9px; height: 9px; }
.rc-rank-tags .is-overtime i { background: #7c3aed; }
.rc-rank-tags .is-late { color: #b91c1c; }
.rc-rank-tags .is-early i { background: #0d9488; }
.rc-rank-tags .is-manual { color: #b45309; }

/* Link do historii zmian danego pracownika */
.rc-rank-tags a.is-manual {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    margin: -2px 0;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fffbeb;
    box-shadow: inset 0 0 0 1px #fde68a;
    font-size: 7.5px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.rc-rank-tags a.is-manual:hover,
.rc-rank-tags a.is-manual:focus-visible {
    color: #fff;
    background: #d97706;
    box-shadow: none;
    outline: 0;
}

.rc-rank-tags a.is-manual .icon:last-child {
    width: 8px;
    height: 8px;
    transition: transform .15s ease;
}

.rc-rank-tags a.is-manual:hover .icon:last-child { transform: translateX(2px); }

/* Obiekty i stanowiska – udział w czasie pracy */
.reports-premium .report-grid.lower-grid {
    align-items: start;
}

.rc-share {
    display: grid;
    gap: 2px;
    padding: 12px 16px 16px;
}

.rc-share-stack {
    display: flex;
    gap: 2px;
    height: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.rc-share-stack i {
    display: block;
    min-width: 3px;
    height: 100%;
}

.rc-share-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.rc-share-row:last-child { border-bottom: 0; }

.rc-share-dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--share-color);
}

.rc-share-main { min-width: 0; }

.rc-share-main strong {
    display: block;
    overflow: hidden;
    color: #1e293b;
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rc-share-main small {
    display: block;
    overflow: hidden;
    color: #94a3b8;
    font-size: 7.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rc-share-value {
    display: flex;
    gap: 6px;
    align-items: baseline;
    white-space: nowrap;
}

.rc-share-value b {
    color: #0f172a;
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
}

.rc-share-value small {
    min-width: 30px;
    padding: 1px 5px;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    font-size: 7.5px;
    font-weight: 800;
    text-align: center;
}

.rc-share-bar {
    grid-column: 2 / -1;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #f1f5f9;
}

.rc-share-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--share-color);
}

.rc-share-empty {
    margin: 12px 16px 16px;
    padding: 20px;
    border: 1px dashed #dbe4f0;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 9px;
    text-align: center;
}

/* Jeden obiekt – zamiast samotnego wiersza kafelki ze statystykami */
.rc-single {
    display: grid;
    gap: 10px;
    padding: 12px 16px 16px;
}

.rc-single-head {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: linear-gradient(145deg, #eff6ff, #fff);
}

.rc-single-icon {
    display: grid;
    flex: 0 0 32px;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.rc-single-icon .icon { width: 15px; height: 15px; }

.rc-single-head > div { flex: 1 1 auto; min-width: 0; }
.rc-single-head strong { display: block; color: #0f172a; font-size: 10px; }
.rc-single-head small { color: #64748b; font-size: 7.5px; }
.rc-single-head > b { color: #1d4ed8; font-size: 13px; font-variant-numeric: tabular-nums; }

.rc-single-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.rc-single-stats > div {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    background: #fbfcfe;
}

.rc-single-stats small { color: #94a3b8; font-size: 7.5px; font-weight: 700; }
.rc-single-stats strong { color: #0f172a; font-size: 11px; font-variant-numeric: tabular-nums; }
.rc-single-stats .is-overtime strong { color: #6d28d9; }
.rc-single-stats .is-late strong { color: #b91c1c; }
.rc-single-stats .is-early strong { color: #0f766e; }

@media (max-width: 640px) {
    .rc-single-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Notatka przy zamykaniu miesiąca */
.reports-premium .rp-close-note > span:first-child {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.reports-premium .rp-close-note small {
    font-weight: 600;
}

.rp-close-input {
    position: relative;
    display: block;
}

.rp-close-input > .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 14px;
    height: 14px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.reports-premium .report-period-action .rp-close-input input {
    height: 40px;
    padding: 0 12px 0 34px;
    border: 1px solid #d6e2ef;
    border-radius: 11px;
    outline: 0;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    font-size: 9.5px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.reports-premium .report-period-action .rp-close-input input:hover { border-color: #b8cbe4; }

.reports-premium .report-period-action .rp-close-input input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.reports-premium .report-period-action .button {
    border-radius: 11px;
}

/* Miesięczna karta pracy – ograniczona wysokość, nagłówek zostaje widoczny */
.reports-premium .report-table-scroll {
    max-height: 560px;
    overflow: auto;
    scrollbar-width: thin;
}

.reports-premium .report-table-scroll .data-table thead th {
    position: sticky;
    z-index: 2;
    top: 0;
    box-shadow: inset 0 -1px 0 #dce6f4;
}

@media (max-width: 1100px) {
    .rc-ranking-scroll { min-height: 0; }
    .rc-ranking-list { position: static; max-height: 460px; }
    .reports-premium .rc-activity-section .daily-chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
    .rc-ranking-scroll { min-height: 0; }
    .rc-ranking-list { position: static; max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
    .reports-premium .report-table-scroll { max-height: none; overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
    .reports-premium .rc-chart .bar-chart-day .bar { transition: none; }
}
