* {
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-size: 13px;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #f8fafc;
}

/* ============================================================
   REPORT HEADER BAR
   ============================================================ */

.report-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 16px;
  background: #1e293b;
  color: #e2e8f0;
  flex-shrink: 0;
  border-bottom: 2px solid #1D75E8;
}

.report-title {
  font-size: 13px;
  color: #cbd5e1;
  white-space: nowrap;
}

.report-title strong {
  color: #93c5fd;
}

.filter-stats {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  background: #0f172a;
  padding: 3px 10px;
  border-radius: 4px;
}

.filter-stats .fs-shown {
  color: #4ade80;
  font-weight: 700;
}

.filter-stats .fs-hidden {
  color: #f87171;
}

.report-time {
  font-size: 12px;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
}

.legend-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.legend-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

.expand-all-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #94a3b8;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.expand-all-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

.search-input {
  background: #0f172a;
  border: 1px solid #475569;
  color: #e2e8f0;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  outline: none;
  width: 200px;
  flex-shrink: 0;
}

.search-input::placeholder {
  color: #64748b;
}

.search-input:focus {
  border-color: #1D75E8;
  background: #1e293b;
}

/* ============================================================
   LEGENDA MODAL
   ============================================================ */

.legend-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
}

.legend-overlay[hidden] {
  display: none;
}

.legend-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  width: 580px;
  max-width: 96vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legend-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.legend-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.legend-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.legend-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.legend-modal-body {
  overflow-y: auto;
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.legend-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin: 0 0 6px;
}

.legend-section-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px;
  line-height: 1.5;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #374151;
}

.legend-item ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.legend-item li {
  margin-bottom: 2px;
}

.legend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 56px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  letter-spacing: 0.04em;
}

.legend-badge--ok    { background: #30ae67; }
.legend-badge--info  { background: #1D75E8; }
.legend-badge--error { background: #D80032; }

.legend-badge-group {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  align-items: center;
  padding-top: 1px;
}

.legend-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.legend-count--ok    { background: #30ae67; }
.legend-count--info  { background: #1D75E8; }
.legend-count--error { background: #D80032; }

.legend-exceeded-group {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
  min-width: 100px;
}

.legend-exceeded {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.legend-exceeded--info  { color: #1D75E8; background: #eff6ff; }
.legend-exceeded--error { color: #D80032; background: #fff1f2; }

.legend-inline-info  { color: #1D75E8; font-weight: 600; }
.legend-inline-error { color: #D80032; font-weight: 600; }

.copy-link-btn {
  background: #334155;
  border: 1px solid #475569;
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-link-btn:hover {
  background: #475569;
}

/* ============================================================
   TABLE WRAPPER & TABLE
   ============================================================ */

.report-table-wrap {
  flex: 1;
  overflow: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

/* Sticky header */
.report-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.report-table th {
  padding: 9px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #374151;
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #d1d5db;
  white-space: nowrap;
  user-select: none;
}

.report-table th img {
  max-width: 50%;
}

.report-table th.col-name {
  text-align: left;
}

.report-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
  text-align: center;
}

.report-table td.col-name {
  text-align: left;
}

/* Column widths */
.col-name  { min-width: 260px; }
.col-num   { width: 88px; }
.col-alert { width: 46px; }
.col-stav  { width: 20%; max-width: 25%; min-width: 160px; }
.col-ok { background: #30ae67 !important; color: white !important; }
.col-info { background: #1D75E8 !important; color: white !important; }
.col-error { background: #D80032 !important; color: white !important; }
.col-bullet-ok { background: #30ae67 !important; }
.col-bullet-info { background: #1D75E8 !important; }
.col-bullet-error { background: #D80032 !important; }




/* ============================================================
   NAME CELL INNER LAYOUT
   ============================================================ */

.col-name-inner {
  display: flex;
  align-items: center;
  gap: 7px;
}

.col-name-inner .issue-label {
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}

.jira-link-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: #9ca3af;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.col-name-inner:hover .jira-link-icon,
.jira-link-icon:focus {
  opacity: 1;
}

.jira-link-icon:hover {
  color: #1D75E8;
}

/* ============================================================
   EXPAND BUTTON
   ============================================================ */

.expand-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  background: white;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #6b7280;
  transition: transform 0.15s ease, background 0.1s;
}

.expand-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.expand-btn.expanded {
  transform: rotate(90deg);
}

.expand-placeholder {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ============================================================
   EPIC ROWS
   ============================================================ */

.row-epic {
  background: #eaeae9;
  cursor: pointer;
}

.row-epic td {
  font-weight: 600;
}

.row-epic:hover {
  background: #e0e0de;
}

/* ============================================================
   STORY ROWS
   ============================================================ */

.row-story {
  background: white;
  display: none; /* hidden until parent epic is expanded */
}

.row-story:hover {
  background: #f8fafc;
}

.row-story td {
  font-weight: 400;
}

.story-name-inner a {
  color: #374151;
}

/* Status-based left border on story rows */
.row-story--ok      { border-left: 3px solid transparent; }
.row-story--info    { border-left: 3px solid #1D75E8; }
.row-story--error   { border-left: 3px solid #D80032; }

/* DONE stories — only the name is dimmed/struck-through, numbers keep their colors */
.row-story--done .issue-label { color: #9ca3af; text-decoration: line-through; }

.story-done-badge {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  background: #e5e7eb;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* NO CHARGE stories */
.row-story--no-charge {
  background: #fffbeb;
}

.row-story--no-charge:hover {
  background: #fef3c7;
}

.story-no-charge-badge {
  font-size: 10px;
  font-weight: 600;
  color: #92400e;
  background: #fde68a;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Highlighted TIME cell for stories */
.col-time-highlight {
  background: #eff6ff;
  color: #1D75E8;
  font-weight: 600;
}

/* Exceeded time cell */
.col-exceeded--info  { color: #1D75E8; font-weight: 600; white-space: nowrap; }
.col-exceeded--error { color: #D80032; font-weight: 600; white-space: nowrap; }

/* ============================================================
   ALERT COUNT CELLS
   ============================================================ */

.col-alert {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.col-alert.has-value {
  background: #e5e7eb;
  font-weight: 700;
}

td.col-alert[data-story-filter]:not(.col-ok):not(.col-info):not(.col-error) {
  cursor: default;
}

/* Sortable columns */
th[data-sort-col] {
  cursor: pointer;
}

th[data-sort-col]:hover {
  background: #e5e7eb;
}

.sort-arrow {
  display: inline-block;
  width: 10px;
  text-align: center;
  font-size: 9px;
  margin-left: 2px;
  vertical-align: middle;
  color: #94a3b8;
}

th.sort-asc  .sort-arrow::after { content: '▲'; color: #374151; }
th.sort-desc .sort-arrow::after { content: '▼'; color: #374151; }

/* Global epic filter (thead) */
th[data-filter] {
  cursor: pointer;
  transition: opacity 0.15s;
}

th[data-filter]:hover {
  opacity: 0.8;
}

th[data-filter].filter-active {
  box-shadow: inset 0 0 0 2px white;
}

th[data-filter].filter-inactive {
  opacity: 0.35;
}

/* Per-epic story filter (td buňky s hodnotou > 0) */
td[data-story-filter].col-ok,
td[data-story-filter].col-info,
td[data-story-filter].col-error {
  cursor: pointer;
  transition: opacity 0.15s;
}

td[data-story-filter].col-ok:hover,
td[data-story-filter].col-info:hover,
td[data-story-filter].col-error:hover {
  opacity: 0.75;
}

td[data-story-filter].story-filter-active {
  box-shadow: inset 0 0 0 2px white;
}

td[data-story-filter].story-filter-inactive {
  opacity: 0.35;
}

/* ============================================================
   COMPACT PROGRESS BAR (for table STAV column)
   ============================================================ */

.pb-track-compact {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: #e2e8f0;
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
  cursor: help;
}

/* ============================================================
   PROGRESS BAR FILLS (shared by compact and full versions)
   ============================================================ */

.pb-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.pb-fill--logged    { background: black; }
.pb-fill--remaining { background: lightgrey; }
.pb-fill--overrun   { background: #EFA000; }
