/* Komponenty: karty, KPI, tabele, plakietki, listy, puste stany. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.card-head p { color: var(--muted); font-size: .85rem; }
.grid { display: grid; gap: 16px; }
.grid > *, .stack > *, .content > * { min-width: 0; } /* tabele i wykresy nie mogą rozpychać strony */
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi { display: flex; gap: 14px; padding: 16px 18px; align-items: flex-start; }
.kpi .tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile.blue { background: var(--primary-soft); color: var(--primary); }
.tile.orange { background: var(--accent-soft); color: var(--accent-dark); }
.tile.green { background: var(--ok-soft); color: var(--ok); }
.tile.red { background: var(--bad-soft); color: var(--bad); }
.kpi .label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.9rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--faint); }
a.kpi-link { color: inherit; text-decoration: none; display: block; }
.kpi-link .card { height: 100%; }
a.kpi-link:hover .card { border-color: var(--primary); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: #f7f9fd; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sub { display: block; color: var(--faint); font-size: .78rem; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge.gray { background: #eef1f6; color: #4b5870; }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.orange { background: var(--accent-soft); color: var(--accent-dark); }
.badge.red { background: var(--bad-soft); color: var(--bad); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { width: auto; min-width: 180px; flex: 1; max-width: 340px; }
.toolbar input[type=checkbox] { width: 18px; min-width: 0; flex: none; }
.toolbar .check { flex: none; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .86rem; cursor: pointer; color: #425068; font-family: var(--font); }
.tab.active { background: var(--text); color: #fff; border-color: var(--text); }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty .big-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--primary-soft); color: #1e3a8a; font-size: .92rem; }
.notice.warn { background: var(--warn-soft); color: #7c4a06; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: #f7f9fd; text-decoration: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b, .list-row .grow span { display: block; overflow: hidden; text-overflow: ellipsis; }
.list-row .grow span { font-size: .82rem; color: var(--muted); }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 99px; background: #e9edf5; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
