/* BEM CSS — Souhrnný přehled firem (Nový admin)
   Přeneseno z projektu admin. Pouze styly OBSAHU podstránky —
   chrome (navbar, sidebar, patička) řeší Limitless z CDN. */

/* ========== FIT DO LIMITLESS (drobná normalizace obsahu) ========== */
/* Limitless/Bootstrap dává nadpisům i odkazům vlastní výchozí styly —
   srovnáme je jen u prvků této stránky, ať vzhled sedí 1:1 jako dřív. */
.prehled__title,
.osa__title,
.pipeline__title,
.spici__title,
.tabulka__title {
	margin-top: 0;
}
.osa__title,
.spici__title,
.tabulka__title {
	margin-bottom: 0;
}
.tabulka__link,
.spici__action,
.tabulka__filter-info {
	text-decoration: none;
}

/* ========== HLAVIČKA + FILTR ========== */
.prehled__header {
	display: flex;
	justify-content: flex-start;
	align-items: center;
	gap: 16px 24px;
	flex-wrap: wrap;
	margin-bottom: 28px;
}

.prehled__title {
	font-size: 26px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 4px;
}

.prehled__subtitle {
	font-size: 14px;
	color: #64748b;
}

.filtr {
	display: flex;
	gap: 6px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 4px;
}

.filtr__button {
	padding: 8px 14px;
	background: transparent;
	border: none;
	border-radius: 7px;
	color: #475569;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
	font-family: inherit;
}

.filtr__button:hover {
	background: #f1f5f9;
}

.filtr__button--active,
.filtr__button--active-period {
	background: #1e3a8a;
	color: #fff;
}

.filtr__button--active:hover,
.filtr__button--active-period:hover {
	background: #1e3a8a;
}

.filtr__button--custom {
	border-left: 1px solid #e2e8f0;
	margin-left: 4px;
	padding-left: 14px;
}

/* ── Filtr na obchodníka (roletka) ── */
.filtr-obchodnik {
	display: flex;
	align-items: center;
	gap: 8px;
	/* hned vedle časového filtru (vlevo) */
}

.filtr-obchodnik__label {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	margin: 0;
	white-space: nowrap;
}

/* Nativní <select> (fallback, než se navěsí Select2) */
.filtr-obchodnik__select {
	height: 38px;
	min-width: 200px;
	padding: 0 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	color: #0f172a;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

/* Sjednocení vzhledu Select2 s ostatními filtry této stránky */
.filtr-obchodnik .select2-container--default .select2-selection--single {
	height: 38px !important;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	/* svislé vycentrování textu uvnitř roletky */
	display: flex;
	align-items: center;
}
.filtr-obchodnik .select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 1.2 !important;
	padding-left: 12px;
	padding-right: 28px;
	color: #0f172a;
	font-size: 13px;
	display: flex;
	align-items: center;
}
.filtr-obchodnik .select2-container--default .select2-selection--single .select2-selection__arrow {
	/* šipka svisle na střed roletky */
	height: auto;
	top: 50%;
	bottom: auto;
	transform: translateY(-50%);
	right: 4px;
}

/* ========== KPI KARTY ========== */
.kpi {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 14px;
	margin-bottom: 32px;
}

.kpi__card {
	display: block;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-top: 3px solid #94a3b8;
	border-radius: 12px;
	padding: 20px;
	cursor: pointer;
	text-align: left;
	transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
	font-family: inherit;
	position: relative;
	/* karta je odkaz (<a>) — potlačit výchozí styl odkazu */
	text-decoration: none;
	color: inherit;
}

.kpi__card:hover,
.kpi__card:focus {
	text-decoration: none;
	color: inherit;
}

.kpi__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.kpi__card--blue   { border-top-color: #2563eb; }
.kpi__card--purple { border-top-color: #7c3aed; }
.kpi__card--green  { border-top-color: #059669; }
.kpi__card--cyan   { border-top-color: #0891b2; }
.kpi__card--amber  { border-top-color: #d97706; }
.kpi__card--indigo { border-top-color: #1e3a8a; }
.kpi__card--teal   { border-top-color: #0d9488; }
.kpi__card--red    { border-top-color: #dc2626; }

.kpi__label {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 10px;
}

.kpi__value {
	font-size: 32px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1;
	margin-bottom: 8px;
}

.kpi__unit {
	font-size: 14px;
	font-weight: 500;
	color: #94a3b8;
	margin-left: 2px;
}

.kpi__sub {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 12px;
}

.kpi__hint {
	font-size: 11px;
	color: #cbd5e1;
	font-weight: 500;
}

.kpi__card:hover .kpi__hint {
	color: #1e3a8a;
}

/* ── Nápovědový otazníček ── */
.kpi__help {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #f1f5f9;
	color: #94a3b8;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	cursor: help;
	transition: background-color 0.15s, color 0.15s;
}

.kpi__help:hover {
	background: #1e3a8a;
	color: #fff;
}

/* ── Rozpad čísel (GoPay / admin) na kartě faktur ── */
.kpi__split {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 10px;
}

.kpi__split-part {
	font-size: 16px;
}

.kpi__split-part--a { color: #2563eb; }
.kpi__split-part--b { color: #475569; }

.kpi__split-sep {
	font-size: 14px;
	font-weight: 400;
	color: #cbd5e1;
}

/* ========== ČASOVÁ OSA ========== */
.osa {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 32px;
}

.osa__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.osa__title {
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
}

.osa__legend {
	display: flex;
	gap: 16px;
	font-size: 13px;
	color: #475569;
}

.osa__legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	/* reset výchozího vzhledu tlačítka */
	background: transparent;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 3px 10px 3px 8px;
	font: inherit;
	font-size: 13px;
	color: #475569;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.15s, border-color 0.15s, opacity 0.15s, color 0.15s;
}

.osa__legend-item:hover {
	background: #f1f5f9;
	border-color: #e2e8f0;
}

/* Aktivní (vybraná) položka legendy */
.osa__legend-item--active {
	background: #f1f5f9;
	border-color: #cbd5e1;
	font-weight: 600;
	color: #0f172a;
}

/* Neaktivní položky při zvolené metrice — zešednou */
.osa__legend-item--inactive {
	opacity: 0.45;
}

.osa__legend-item--inactive .osa__dot {
	filter: grayscale(1);
}

.osa__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}

/* Teplá paleta (žlutá, oranžová, okrová, béžová, hnědá) */
.osa__dot--orange { background: #ea580c; }
.osa__dot--yellow { background: #eab308; }
.osa__dot--ochre  { background: #a16207; }
.osa__dot--beige  { background: #d6b88a; }
.osa__dot--brown  { background: #b45309; }

/* Plocha grafu = osa Y (vlevo) + sloupce (vpravo) */
.osa__plot {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

/* Číselné měřítko (osa Y) */
.osa__yaxis {
	position: relative;
	width: 22px;
	/* zarovnání výšky s grafem — graf má dole padding 24px na popisky dnů */
	height: 180px;
	margin-bottom: 24px;
	flex: 0 0 auto;
}

.osa__ytick {
	position: absolute;
	right: 0;
	transform: translateY(50%);
	font-size: 10px;
	color: #94a3b8;
	line-height: 1;
	white-space: nowrap;
}

.osa__chart {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(30, 1fr);
	gap: 4px;
	height: 180px;
	align-items: end;
	padding-bottom: 24px;
	position: relative;
	border-bottom: 1px solid #e2e8f0;
}

/* Vodorovné linky mřížky na úrovni značek osy Y */
.osa__gridline {
	position: absolute;
	left: 0;
	right: 0;
	height: 1px;
	background: #f1f5f9;
	pointer-events: none;
	z-index: 0;
}

.osa__day {
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	cursor: pointer;
	position: relative;
	z-index: 1;
	transition: opacity 0.15s;
}

.osa__day:hover {
	opacity: 0.75;
}

.osa__bars {
	display: flex;
	gap: 2px;
	height: 100%;
	align-items: flex-end;
}

.osa__bar {
	flex: 1;
	border-radius: 2px 2px 0 0;
	min-height: 2px;
	transition: opacity 0.15s;
}

.osa__bar--orange { background: #ea580c; }
.osa__bar--yellow { background: #eab308; }
.osa__bar--ochre  { background: #a16207; }
.osa__bar--beige  { background: #d6b88a; }
.osa__bar--brown  { background: #b45309; }

/* Ztlumený sloupec (nevybraná metrika při aktivní legendě) */
.osa__bar--dimmed {
	background: #e2e8f0;
	opacity: 0.6;
}

.osa__label {
	position: absolute;
	bottom: -22px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 10px;
	color: #94a3b8;
}

.osa__hint {
	margin-top: 8px;
	text-align: center;
	font-size: 12px;
	color: #94a3b8;
	font-style: italic;
}

/* ========== PIPELINE ========== */
.pipeline {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 32px;
}

.pipeline__title {
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 20px;
}

/* Kompaktní osa — kroky nezabírají celou šířku stránky (vlevo, pevná velikost) */
.pipeline__steps--compact {
	justify-content: flex-start;
}

.pipeline__steps--compact .pipeline__step {
	flex: 0 1 240px;
}

.pipeline__steps--compact .pipeline__step--wide {
	flex: 0 1 280px;
}

.pipeline__steps {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.pipeline__step {
	flex: 1;
	background: #f8fafc;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	padding: 18px 14px;
	cursor: pointer;
	text-align: center;
	transition: transform 0.15s, border-color 0.15s, background-color 0.15s;
	font-family: inherit;
	position: relative;
}

.pipeline__step:hover {
	transform: translateY(-2px);
}

.pipeline__step-number {
	position: absolute;
	top: 8px;
	right: 8px;
	font-size: 10px;
	font-weight: 700;
	color: #cbd5e1;
}

.pipeline__step-name {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 12px;
}

.pipeline__step-count {
	font-size: 32px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1;
	margin-bottom: 8px;
}

.pipeline__step-desc {
	font-size: 11px;
	color: #94a3b8;
}

.pipeline__step--cyan   { border-color: #cffafe; background: #ecfeff; }
.pipeline__step--amber  { border-color: #fde68a; background: #fffbeb; }
.pipeline__step--purple { border-color: #ddd6fe; background: #f5f3ff; }
.pipeline__step--green  { border-color: #bbf7d0; background: #f0fdf4; }
.pipeline__step--red    { border-color: #fecaca; background: #fef2f2; }

.pipeline__step--cyan:hover   { border-color: #06b6d4; }
.pipeline__step--amber:hover  { border-color: #d97706; }
.pipeline__step--purple:hover { border-color: #7c3aed; }
.pipeline__step--green:hover  { border-color: #059669; }
.pipeline__step--red:hover    { border-color: #dc2626; }

/* Teplá paleta — akviziční osa */
.pipeline__step--orange { border-color: #fed7aa; background: #fff7ed; }
.pipeline__step--yellow { border-color: #fef08a; background: #fefce8; }
.pipeline__step--ochre  { border-color: #e7c98a; background: #fdf6e3; }
.pipeline__step--beige  { border-color: #e6d5b8; background: #faf6ef; }
.pipeline__step--brown  { border-color: #e7c9a9; background: #fbf3ec; }

.pipeline__step--orange:hover { border-color: #ea580c; }
.pipeline__step--yellow:hover { border-color: #eab308; }
.pipeline__step--ochre:hover  { border-color: #a16207; }
.pipeline__step--beige:hover  { border-color: #d6b88a; }
.pipeline__step--brown:hover  { border-color: #b45309; }

/* Mezera nad druhým nadpisem (akviziční osa) */
.pipeline__title--spaced {
	margin-top: 32px;
}

/* Širší krok (obsahuje rozpad ano/ne/bez odp./neřešeno) */
.pipeline__step--wide {
	flex: 1.6;
}

/* Rozpad uvnitř kroku „Fáze nabídky" */
.pipeline__breakdown {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-top: 2px;
	text-align: left;
}

.pipeline__breakdown-row {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
}

.pipeline__breakdown-mark {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.7);
	color: #92400e;
	font-size: 10px;
	font-weight: 700;
}

.pipeline__breakdown-label {
	flex: 1;
	color: #475569;
}

.pipeline__breakdown-count {
	font-weight: 700;
	color: #0f172a;
	font-size: 14px;
}

.pipeline__arrow {
	display: flex;
	align-items: center;
	color: #cbd5e1;
	font-size: 18px;
	font-weight: 300;
}

/* ========== SPÍCÍ FIRMY ========== */
.spici {
	background: #fff;
	border: 1px solid #fecaca;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 32px;
}

.spici__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	flex-wrap: wrap;
	gap: 12px;
}

.spici__title-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}

.spici__icon {
	font-size: 18px;
	color: #dc2626;
}

.spici__title {
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
}

.spici__badge {
	background: #fee2e2;
	color: #dc2626;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}

.spici__action {
	background: transparent;
	border: none;
	color: #1e3a8a;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
}

.spici__action:hover {
	text-decoration: underline;
}

.spici__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 10px;
}

.spici__item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: #fef2f2;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.15s;
	/* je to odkaz (<a>) — potlačit výchozí styl */
	text-decoration: none;
	color: inherit;
}

.spici__item:hover {
	background: #fee2e2;
	text-decoration: none;
	color: inherit;
}

.spici__item-name {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 2px;
}

.spici__item-meta {
	font-size: 11px;
	color: #64748b;
}

.spici__item-days {
	background: #dc2626;
	color: #fff;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

/* ========== TABULKA FIREM ========== */
.tabulka {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
}

.tabulka__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}

.tabulka__title {
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
}

.tabulka__filter-info {
	font-size: 13px;
	color: #64748b;
}

.tabulka__filter-info strong {
	color: #1e3a8a;
}

.tabulka__wrap {
	overflow-x: auto;
}

.tabulka__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.tabulka__table thead th {
	text-align: left;
	padding: 10px 12px;
	background: #f8fafc;
	color: #475569;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid #e2e8f0;
}

.tabulka__table tbody td {
	padding: 12px;
	border-bottom: 1px solid #f1f5f9;
	color: #0f172a;
}

.tabulka__table tbody tr:hover {
	background: #f8fafc;
}

.tabulka__row--spici {
	background: #fffbeb;
}

.tabulka__row--spici:hover {
	background: #fef3c7;
}

.tabulka__firma {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}

.tabulka__spici-icon {
	font-size: 14px;
}

/* Název firmy jako odkaz na detail */
.tabulka__firma-link {
	color: #0f172a;
	text-decoration: none;
}

.tabulka__firma-link:hover {
	color: #1e3a8a;
	text-decoration: underline;
}

.tabulka__bod-nula {
	font-family: 'Courier New', monospace;
	color: #64748b;
	font-size: 12px;
}

.tabulka__link {
	color: #1e3a8a;
	font-weight: 500;
	font-size: 12px;
}

.tabulka__link:hover {
	text-decoration: underline;
}

/* Skrytý řádek (čeká na rozbalení tlačítkem) */
.tabulka__row--hidden {
	display: none;
}

/* Pruh s tlačítkem „Zobrazit dalších N" */
.tabulka__more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #f1f5f9;
}

.tabulka__more-button {
	padding: 9px 20px;
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	color: #1e3a8a;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
}

.tabulka__more-button:hover {
	background: #f1f5f9;
	border-color: #1e3a8a;
}

.tabulka__more-info {
	font-size: 12px;
	color: #94a3b8;
}

/* Když je vše zobrazeno — schovat tlačítko, info zůstává */
.tabulka__more--done .tabulka__more-button {
	display: none;
}

/* ========== FÁZE BADGE (přejmenováno z .badge kvůli kolizi s Limitless) ========== */
.faze-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}

.faze-badge--green  { background: #d1fae5; color: #047857; }
.faze-badge--cyan   { background: #cffafe; color: #0e7490; }
.faze-badge--amber  { background: #fef3c7; color: #92400e; }
.faze-badge--purple { background: #ede9fe; color: #6d28d9; }
.faze-badge--red    { background: #fee2e2; color: #b91c1c; }

/* ========== RESPONZIVITA ========== */
@media (max-width: 1100px) {
	.kpi {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 900px) {
	.pipeline__steps {
		flex-direction: column;
	}
	.pipeline__arrow {
		transform: rotate(90deg);
		justify-content: center;
	}
	.osa__chart {
		grid-template-columns: repeat(15, 1fr);
		gap: 3px;
	}
	.osa__day:nth-child(even) {
		display: none;
	}
}

@media (max-width: 600px) {
	.kpi {
		grid-template-columns: repeat(2, 1fr);
	}
	.kpi__value {
		font-size: 24px;
	}
	.prehled__header {
		flex-direction: column;
		align-items: stretch;
	}
	.filtr {
		overflow-x: auto;
	}
	/* na mobilu filtr obchodníka pod časový filtr, na plnou šířku */
	.filtr-obchodnik {
		margin-left: 0;
	}
	.filtr-obchodnik__select {
		width: 100%;
	}
}
