/* =========================================================
   SPRÁVA ODPOVĚDÍ — seznamový layout (BEM)
   ========================================================= */

.odpovedi {
	--c-text: #0f172a;
	--c-muted: #64748b;
	--c-subtle: #94a3b8;
	--c-border: #e2e8f0;
	--c-border-strong: #cbd5e1;
	--c-bg: #fff;
	--c-bg-soft: #f8fafc;
	--c-bg-hover: #f1f5f9;
	--c-primary: #2563eb;
	--c-primary-hover: #1d4ed8;
	--c-success: #059669;
	--c-warning: #f59e0b;
	--c-danger: #dc2626;
	--c-gold: #f59e0b;
	--c-rec: #d97706;

	font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--c-text);
	max-width: 1180px;
	margin: 0 auto;
	padding: 24px 16px 40px;
	font-size: 14px;
}

.odpovedi *,
.odpovedi *::before,
.odpovedi *::after {
	box-sizing: border-box;
}

/* =========================================================
   HLAVIČKA
   ========================================================= */
.odpovedi__header {
	margin-bottom: 16px;
}

.odpovedi__header-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.odpovedi__title {
	font-size: 22px;
	font-weight: 600;
	margin: 0 0 4px 0;
	color: var(--c-text);
}

.odpovedi__summary {
	font-size: 13px;
	color: var(--c-muted);
	margin: 0;
}

.odpovedi__summary strong {
	color: var(--c-text);
	font-weight: 600;
}

.odpovedi__summary--new { color: var(--c-primary); }
.odpovedi__summary--interview { color: var(--c-success); }
.odpovedi__summary--rec { color: var(--c-rec); }

.odpovedi__summary-sep {
	margin: 0 6px;
	color: var(--c-subtle);
}

/* ---- Ovládání vpravo (hledání + filtry) ---- */
.odpovedi__controls {
	display: flex;
	gap: 8px;
	align-items: center;
}

.odpovedi__search {
	position: relative;
	display: flex;
	align-items: center;
}

.odpovedi__search svg {
	position: absolute;
	left: 11px;
	color: var(--c-subtle);
	pointer-events: none;
}

.odpovedi__search input {
	font-family: inherit;
	font-size: 13px;
	padding: 8px 12px 8px 34px;
	width: 280px;
	height: 36px;
	border: 1px solid var(--c-border);
	border-radius: 8px;
	background: #fff;
	color: var(--c-text);
	transition: border-color 0.12s, box-shadow 0.12s, width 0.2s;
}

.odpovedi__search input:focus {
	outline: 0;
	border-color: var(--c-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---- Obecné tlačítko ---- */
.odpovedi__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 14px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 8px;
	border: 1px solid transparent;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.odpovedi__btn--ghost {
	color: var(--c-text);
	border-color: var(--c-border);
	background: #fff;
}

.odpovedi__btn--ghost:hover {
	background: var(--c-bg-hover);
	border-color: var(--c-border-strong);
}

.odpovedi__btn--primary {
	color: #fff;
	background: var(--c-primary);
	border-color: var(--c-primary);
}

.odpovedi__btn--primary:hover {
	background: var(--c-primary-hover);
	border-color: var(--c-primary-hover);
}

/* ---- Chip filtry ---- */
.odpovedi__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.odpovedi__chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 500;
	background: transparent;
	color: var(--c-muted);
	border: 1px solid var(--c-border);
	border-radius: 999px;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.odpovedi__chip:hover {
	background: var(--c-bg-hover);
	color: var(--c-text);
}

.odpovedi__chip span {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 1px 6px;
	background: var(--c-bg-hover);
	border-radius: 999px;
	color: var(--c-muted);
}

.odpovedi__chip--active {
	background: var(--c-text);
	color: #fff;
	border-color: var(--c-text);
}

.odpovedi__chip--active:hover {
	background: var(--c-text);
	color: #fff;
}

.odpovedi__chip--active span {
	background: rgba(255,255,255,0.18);
	color: #fff;
}

/* ---- Dropdown Řazení ---- */
.odpovedi__sort {
	margin-left: auto;
	position: relative;
}

.odpovedi__chip--sort {
	color: var(--c-muted);
}

.odpovedi__chip--sort strong {
	color: var(--c-text);
	font-weight: 600;
	margin-left: 2px;
}

.odpovedi__chip--sort svg:last-child {
	transition: transform 0.15s;
	margin-left: 2px;
}

.odpovedi__sort--open .odpovedi__chip--sort {
	background: var(--c-bg-hover);
	border-color: var(--c-border-strong);
	color: var(--c-text);
}

.odpovedi__sort--open .odpovedi__chip--sort svg:last-child {
	transform: rotate(180deg);
}

.odpovedi__sort-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 220px;
	background: #fff;
	border: 1px solid var(--c-border);
	border-radius: 10px;
	box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
	padding: 4px;
	z-index: 50;
	display: none;
}

.odpovedi__sort--open .odpovedi__sort-menu {
	display: block;
}

.odpovedi__sort-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	background: transparent;
	border: 0;
	border-radius: 6px;
	font-family: inherit;
	font-size: 13px;
	color: var(--c-text);
	cursor: pointer;
	text-align: left;
	transition: background 0.1s;
}

.odpovedi__sort-item:hover {
	background: var(--c-bg-hover);
}

.odpovedi__sort-item svg:first-child {
	color: var(--c-subtle);
	flex-shrink: 0;
}

.odpovedi__sort-check {
	margin-left: auto;
	color: var(--c-primary);
	opacity: 0;
}

.odpovedi__sort-item--active .odpovedi__sort-check {
	opacity: 1;
}

.odpovedi__sort-item--active {
	color: var(--c-primary);
	font-weight: 500;
}

.odpovedi__sort-item--active svg:first-child {
	color: var(--c-primary);
}

/* ---- Rozbalovací panel pokročilých filtrů ---- */
.odpovedi__advanced {
	margin-top: 12px;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--c-border);
	border-radius: 10px;
}

.odpovedi__advanced-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 12px;
}

.odpovedi__field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.odpovedi__field-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--c-muted);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.odpovedi__input {
	font-family: inherit;
	font-size: 13px;
	padding: 8px 10px;
	border: 1px solid var(--c-border);
	border-radius: 7px;
	background: #fff;
	color: var(--c-text);
	width: 100%;
	height: 36px;
	transition: border-color 0.12s, box-shadow 0.12s;
}

.odpovedi__input:focus {
	outline: 0;
	border-color: var(--c-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.odpovedi__advanced-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--c-border);
}

.odpovedi__btn--ghost-active {
	background: var(--c-bg-hover);
	border-color: var(--c-border-strong);
}

/* =========================================================
   SEZNAM
   ========================================================= */
.odpovedi__list {
	background: #fff;
	border: 1px solid var(--c-border);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 16px;
}

/* =========================================================
   ŘÁDEK
   ========================================================= */
.radek {
	border-bottom: 1px solid var(--c-border);
	transition: background 0.1s;
}

.radek:last-child {
	border-bottom: 0;
}

.radek:hover:not(.radek--head) {
	background: var(--c-bg-soft);
}

.radek__main {
	display: grid;
	grid-template-columns:
		32px                /* check */
		minmax(260px, 2.4fr) /* osoba */
		minmax(170px, 1.4fr) /* inzerát */
		115px               /* hodnocení */
		140px               /* shoda */
		90px                /* datum */
		110px;              /* akce */
	gap: 12px;
	align-items: center;
	padding: 11px 16px;
	cursor: pointer;
}

/* ---- Hlavička sloupců ---- */
.radek--head {
	display: grid;
	grid-template-columns:
		32px
		minmax(260px, 2.4fr)
		minmax(170px, 1.4fr)
		115px
		140px
		90px
		110px;
	gap: 12px;
	align-items: center;
	padding: 9px 16px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--c-subtle);
	background: var(--c-bg-soft);
	cursor: default;
}

.radek--head:hover {
	background: var(--c-bg-soft);
}

/* ---- Stavové varianty ---- */
.radek--new {
	background: linear-gradient(90deg, rgba(37, 99, 235, 0.03) 0%, transparent 40%);
}

/* Pozván na pohovor — celý uchazeč zeleně */
.radek--interview {
	background: #ecfdf5;
	box-shadow: inset 3px 0 0 var(--c-success);
}

.radek--interview:hover:not(.radek--head) {
	background: #d1fae5;
}

/* Zamítnutý — celý uchazeč šedě */
.radek--rejected {
	background: #f1f5f9;
	box-shadow: inset 3px 0 0 var(--c-subtle);
}

.radek--rejected:hover:not(.radek--head) {
	background: #e2e8f0;
}

.radek--rejected .radek__name > span:first-child {
	text-decoration: line-through;
	text-decoration-color: var(--c-subtle);
}

/* Skrytý uchazeč — defaultně schovaný (najde se přes filtr "Skryté") */
.radek--skryty {
	display: none;
}

/* Řádek vyfiltrovaný běžným chip-filtrem */
.radek--filtered-out {
	display: none !important;
}

/* V režimu filtru "Skryté" se skrytí uchazeči naopak zobrazí */
.odpovedi__list--skryte .radek--skryty {
	display: grid;
}

/* ---- Sloupce ---- */
.radek__col {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* Check */
.radek__col--check {
	justify-content: center;
}

/* Osoba */
.radek__col--person {
	min-width: 0;
}

/* Barevná tečka i avatar před jménem odstraněny */
.radek__dot { display: none; }

.radek__avatar { display: none; }

.radek__identity {
	min-width: 0;
	flex: 1;
}

.radek__name {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--c-text);
	line-height: 1.3;
	margin-bottom: 2px;
	flex-wrap: wrap;
}

.radek__name > span:first-child {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.radek__contact {
	font-size: 12px;
	color: var(--c-muted);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---- TrustScore tier ---- */
.radek__tier {
	display: inline-flex;
	align-items: center;
	font-size: 10px;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

/* Všechny úrovně (Starter / Profík / Expert / Borec / Mega Borec) jednotně modře */
.radek__tier--starter,
.radek__tier--profik,
.radek__tier--expert,
.radek__tier--borec,
.radek__tier--mega {
	background: #eff6ff;
	color: var(--c-primary);
}

/* ---- Stavové pill ---- */
.radek__pill {
	display: inline-flex;
	align-items: center;
	font-size: 10px;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

.radek__pill--interview { background: #d1fae5; color: #047857; }
.radek__pill--own       { background: #ffedd5; color: #c2410c; }
.radek__pill--rejected  { background: #fee2e2; color: #991b1b; }

/* ---- Inzerát ---- */
.radek__col--inzerat {
	min-width: 0;
}

.radek__projekt {
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 5px;
	font-size: 10px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.3px;
}

.radek__projekt--fb { background: #ea580c; }
.radek__projekt--fp { background: #2563eb; }
.radek__projekt--inwork { background: #e11d48; }

.radek__inzerat {
	min-width: 0;
	flex: 1;
}

.radek__inzerat-name {
	font-size: 13px;
	color: var(--c-text);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.radek__inzerat-meta {
	font-size: 11px;
	color: var(--c-muted);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---- Hodnocení ---- */
.radek__col--rating {
	gap: 6px;
}

.radek__stars {
	display: inline-flex;
	gap: 0;
	letter-spacing: -1px;
}

.radek__star {
	font-size: 13px;
	line-height: 1;
}

.radek__star--full { color: var(--c-gold); }
.radek__star--empty { color: #e2e8f0; }
.radek__star--half {
	background: linear-gradient(90deg, var(--c-gold) 50%, #e2e8f0 50%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.radek__rating-value {
	font-size: 12px;
	font-weight: 600;
	color: var(--c-text);
}

.radek__rating-value--empty {
	color: var(--c-subtle);
	font-weight: 500;
	font-size: 11px;
}

/* ---- Shoda ---- */
.radek__col--match {
	gap: 8px;
}

.radek__match {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.radek__match-bar {
	flex: 1;
	height: 5px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
	min-width: 60px;
}

.radek__match-fill {
	height: 100%;
	background: var(--c-success);
	border-radius: 999px;
}

.radek__match-fill--mid { background: var(--c-warning); }
.radek__match-fill--low { background: var(--c-danger); }

.radek__match-value {
	font-size: 12px;
	font-weight: 600;
	color: var(--c-text);
	min-width: 38px;
	text-align: right;
}

/* ---- Datum ---- */
.radek__col--date {
	white-space: nowrap;
}

.radek__date {
	font-size: 13px;
	font-weight: 500;
	color: var(--c-text);
	line-height: 1.3;
	white-space: nowrap;
}

.radek__date-year {
	font-weight: 400;
	color: var(--c-subtle);
}

/* ---- Akce ---- */
.radek__col--actions {
	justify-self: end;
	gap: 2px;
}

.radek__action,
.radek__expand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: var(--c-muted);
	cursor: pointer;
	transition: background 0.12s, color 0.12s;
	padding: 0;
}

.radek__action:hover,
.radek__expand:hover {
	background: var(--c-bg-hover);
	color: var(--c-text);
}

.radek__expand svg {
	transition: transform 0.2s;
}

.radek[data-expanded="true"] .radek__expand svg {
	transform: rotate(180deg);
}

/* ---- Checkbox ---- */
.radek__select {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	position: relative;
	padding: 4px;
	margin: -4px;
}

.radek__select input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.radek__select-box {
	width: 16px;
	height: 16px;
	border: 1.5px solid var(--c-border-strong);
	border-radius: 4px;
	background: #fff;
	position: relative;
	transition: background 0.1s, border-color 0.1s;
}

.radek__select input:checked + .radek__select-box {
	background: var(--c-primary);
	border-color: var(--c-primary);
}

.radek__select input:checked + .radek__select-box::after {
	content: '';
	position: absolute;
	top: 1px;
	left: 4px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* =========================================================
   ROZBALENÝ DETAIL
   ========================================================= */
.radek__detail {
	display: none;
	background: var(--c-bg-soft);
	border-top: 1px solid var(--c-border);
	padding: 18px 20px 18px 72px;
}

.radek[data-expanded="true"] .radek__detail {
	display: block;
}

.radek[data-expanded="true"] {
	background: var(--c-bg-soft);
}

.radek__detail-grid {
	display: grid;
	grid-template-columns: auto auto 1fr;
	gap: 24px;
	margin-bottom: 16px;
}

.radek__detail-block--wide {
	grid-column: span 1;
}

.radek__detail-label {
	font-size: 10px;
	font-weight: 600;
	color: var(--c-subtle);
	text-transform: uppercase;
	letter-spacing: 0.4px;
	margin: 0 0 6px 0;
}

.radek__detail-value {
	font-size: 14px;
	font-weight: 600;
	color: var(--c-text);
	margin: 0;
}

.radek__detail-value span {
	font-weight: 500;
	color: var(--c-muted);
	font-size: 12px;
}

.radek__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.radek__badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 500;
	padding: 3px 8px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	color: var(--c-primary);
}

.radek__detail-message {
	font-size: 13px;
	line-height: 1.55;
	color: var(--c-text);
	margin: 0;
	font-style: italic;
	padding-left: 10px;
	border-left: 2px solid #fcd34d;
}

.radek__detail-actions {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
	flex-wrap: wrap;
}

/* =========================================================
   PATIČKA
   ========================================================= */
.odpovedi__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 16px;
}

.odpovedi__pagination {
	display: flex;
	gap: 4px;
}

.odpovedi__page {
	min-width: 32px;
	height: 32px;
	padding: 0 10px;
	font-size: 12px;
	font-weight: 500;
	background: #fff;
	border: 1px solid var(--c-border);
	border-radius: 6px;
	color: var(--c-text);
	cursor: pointer;
	font-family: inherit;
	transition: background 0.1s, border-color 0.1s;
}

.odpovedi__page:hover:not([disabled]):not(.odpovedi__page--active) {
	background: var(--c-bg-hover);
	border-color: var(--c-border-strong);
}

.odpovedi__page--active {
	background: var(--c-text);
	color: #fff;
	border-color: var(--c-text);
}

.odpovedi__page[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

.odpovedi__gdpr {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	color: var(--c-subtle);
	margin: 0;
}

.odpovedi__gdpr a {
	color: var(--c-primary);
	text-decoration: none;
	font-weight: 500;
}

.odpovedi__gdpr a:hover {
	text-decoration: underline;
}

/* =========================================================
   RESPONZIVITA
   ========================================================= */
@media (max-width: 1100px) {
	.radek__main,
	.radek--head {
		grid-template-columns:
			28px
			minmax(220px, 2.4fr)
			minmax(140px, 1.2fr)
			105px
			120px
			85px
			100px;
		gap: 10px;
	}

	.odpovedi__search input { width: 220px; }
}

@media (max-width: 900px) {
	.odpovedi__advanced-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.odpovedi__sort-menu {
		right: auto;
		left: 0;
	}

	.radek--head { display: none; }

	.radek__main {
		grid-template-columns: 1fr auto;
		gap: 10px;
		padding: 14px 14px;
		row-gap: 10px;
	}

	.radek__col--check { display: none; }

	.radek__col--person {
		grid-column: 1 / 2;
		grid-row: 1;
	}

	.radek__col--actions {
		grid-column: 2 / 3;
		grid-row: 1;
		align-self: start;
	}

	.radek__col--inzerat {
		grid-column: 1 / -1;
		grid-row: 2;
		padding-left: 46px;
	}

	.radek__col--rating {
		grid-column: 1;
		grid-row: 3;
		padding-left: 46px;
	}

	.radek__col--match {
		grid-column: 2;
		grid-row: 3;
		justify-self: end;
		min-width: 120px;
	}

	.radek__col--date {
		grid-column: 1 / -1;
		grid-row: 4;
		padding-left: 46px;
	}

	.radek__detail {
		padding: 14px;
	}

	.radek__detail-grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}
}

@media (max-width: 640px) {
	.odpovedi {
		padding: 16px 10px 32px;
	}

	.odpovedi__title {
		font-size: 19px;
	}

	.odpovedi__header-row {
		flex-direction: column;
	}

	.odpovedi__controls {
		width: 100%;
	}

	.odpovedi__search {
		flex: 1;
	}

	.odpovedi__search input {
		width: 100%;
	}

	.odpovedi__chip--sort {
		margin-left: 0;
	}

	.radek__name {
		font-size: 13px;
	}

	.odpovedi__advanced-grid {
		grid-template-columns: 1fr;
	}

	.odpovedi__sort {
		margin-left: 0;
		width: 100%;
	}

	.odpovedi__chip--sort {
		width: 100%;
		justify-content: space-between;
	}

	.odpovedi__sort-menu {
		width: 100%;
	}
}

/* ====================== Modal: e-mail uchazeči ====================== */
.mailmodal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.mailmodal[hidden] { display: none; }

.mailmodal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(2px);
}

.mailmodal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 900px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.4);
	overflow: hidden;
}

.mailmodal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 1px solid var(--c-border);
}

.mailmodal__title {
	margin: 0 0 2px;
	font-size: 18px;
	font-weight: 700;
	color: var(--c-text);
}

.mailmodal__to {
	margin: 0;
	font-size: 13px;
	color: var(--c-subtle);
}

.mailmodal__to strong { color: var(--c-text); font-weight: 600; }

.mailmodal__close {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--c-border);
	border-radius: 8px;
	color: var(--c-text);
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.mailmodal__close:hover { background: #f1f5f9; border-color: var(--c-border-strong); }

.mailmodal__body {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 0;
	overflow: hidden;
	flex: 1;
	min-height: 0;
}

.mailmodal__form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 20px 22px;
	overflow-y: auto;
}

.mailmodal__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mailmodal__label {
	font-size: 12px;
	font-weight: 600;
	color: var(--c-text);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mailmodal__label em {
	font-style: normal;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: var(--c-subtle);
}

.mailmodal__input,
.mailmodal__textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	font-family: inherit;
	font-size: 14px;
	color: var(--c-text);
	background: #fff;
	border: 1px solid var(--c-border-strong);
	border-radius: 8px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.mailmodal__input:focus,
.mailmodal__textarea:focus {
	outline: none;
	border-color: var(--c-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.mailmodal__textarea {
	resize: vertical;
	line-height: 1.5;
}

.mailmodal__textarea--sig {
	background: #f8fafc;
	font-size: 13px;
}

.mailmodal__attach {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mailmodal__attach-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 500;
	color: var(--c-primary);
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s;
}

.mailmodal__attach-btn:hover { background: #dbeafe; }

.mailmodal__attach-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mailmodal__attach-item {
	font-size: 13px;
	color: var(--c-text);
	padding: 6px 10px;
	background: #f1f5f9;
	border-radius: 6px;
}

/* Historie komunikace */
.mailmodal__history {
	border-left: 1px solid var(--c-border);
	padding: 20px 22px;
	overflow-y: auto;
	background: #f8fafc;
}

.mailmodal__history-title {
	margin: 0 0 16px;
	font-size: 13px;
	font-weight: 700;
	color: var(--c-text);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mailmodal__timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.mailmodal__event {
	position: relative;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--c-border);
	border-radius: 10px;
	border-left: 3px solid var(--c-border-strong);
}

.mailmodal__event--in   { border-left-color: var(--c-subtle); }
.mailmodal__event--out  { border-left-color: var(--c-primary); }
.mailmodal__event--note { border-left-color: #c084fc; background: #faf5ff; }

.mailmodal__event-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.mailmodal__event-head time {
	font-size: 11px;
	color: var(--c-subtle);
}

.mailmodal__event-tag {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px 8px;
	border-radius: 999px;
}

.mailmodal__event-tag--in   { background: #f1f5f9; color: #475569; }
.mailmodal__event-tag--out  { background: #eff6ff; color: var(--c-primary); }
.mailmodal__event-tag--note { background: #f3e8ff; color: #7c3aed; }

.mailmodal__event-subject {
	margin: 0 0 3px;
	font-size: 13px;
	font-weight: 600;
	color: var(--c-text);
}

.mailmodal__event-text {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.5;
	color: #475569;
}

.mailmodal__foot {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 22px;
	border-top: 1px solid var(--c-border);
	background: #fff;
}

@media (max-width: 760px) {
	.mailmodal__body {
		grid-template-columns: 1fr;
		overflow-y: auto;
	}
	.mailmodal__history {
		border-left: none;
		border-top: 1px solid var(--c-border);
	}
}
