/**
 * Panel klienta INTMEDIA — style front-end.
 * Paleta marki jako zmienne CSS (te same tokeny przejmie aplikacja Android — Material 3).
 */
:root {
	--crm-primary: #1b6ef3;
	--crm-primary-dark: #0b4fb8;
	--crm-accent: #00bfa6;
	--crm-bg: #f5f7fa;
	--crm-surface: #ffffff;
	--crm-text: #1a2332;
	--crm-muted: #6b7686;
	--crm-border: #e4e8ef;
	--crm-danger: #d93b3b;
	--crm-success: #1ba566;
	--crm-radius: 14px;
	--crm-radius-sm: 9px;
	--crm-shadow: 0 8px 30px rgba(16, 33, 60, .08);
	--crm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Layout ── */
.crm-wrap {
	max-width: 920px;
	margin: 0 auto;
	padding: 24px 16px;
	font-family: var(--crm-font);
	color: var(--crm-text);
	box-sizing: border-box;
}
.crm-wrap *,
.crm-wrap *::before,
.crm-wrap *::after { box-sizing: border-box; }

.crm-card {
	background: var(--crm-surface);
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius);
	box-shadow: var(--crm-shadow);
	padding: 28px;
}

.crm-auth { max-width: 460px; margin: 0 auto; }

/* ── Zakładki ── */
.crm-auth__tabs {
	display: flex;
	gap: 6px;
	background: var(--crm-bg);
	border-radius: var(--crm-radius-sm);
	padding: 5px;
	margin-bottom: 24px;
}
.crm-tab {
	flex: 1;
	border: 0;
	background: transparent;
	padding: 11px 14px;
	border-radius: 7px;
	font: inherit;
	font-weight: 600;
	color: var(--crm-muted);
	cursor: pointer;
	transition: background .15s, color .15s;
}
.crm-tab.is-active {
	background: var(--crm-surface);
	color: var(--crm-primary);
	box-shadow: 0 2px 8px rgba(16, 33, 60, .08);
}

/* ── Panele formularzy ── */
.crm-panel { display: none; }
.crm-panel.is-active { display: block; }

.crm-form__title { margin: 0 0 18px; font-size: 1.4rem; }

.crm-field { display: block; margin-bottom: 16px; }
.crm-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: .9rem;
	font-weight: 600;
	color: var(--crm-text);
}
.crm-field input,
.crm-field select,
.crm-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius-sm);
	font: inherit;
	color: var(--crm-text);
	background: var(--crm-surface);
	transition: border-color .15s, box-shadow .15s;
}
.crm-field input:focus,
.crm-field select:focus,
.crm-field textarea:focus {
	outline: none;
	border-color: var(--crm-primary);
	box-shadow: 0 0 0 3px rgba(27, 110, 243, .15);
}
.crm-field textarea { resize: vertical; min-height: 110px; }

.crm-field-row { display: flex; gap: 14px; }
.crm-field-row .crm-field { flex: 1; }

.crm-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin-bottom: 18px;
	font-size: .88rem;
	color: var(--crm-muted);
	cursor: pointer;
}
.crm-checkbox input { margin-top: 2px; }

/* ── Dane do faktury: przełącznik firma / osoba ── */
.crm-billing { margin-bottom: 18px; }
.crm-billing__type {
	display: flex;
	gap: 18px;
	margin: 6px 0 12px;
}
.crm-radio {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: .9rem;
	color: var(--crm-text);
	cursor: pointer;
}
.crm-billing-company[hidden] { display: none; }

/* ── Przyciski ── */
.crm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border: 1px solid transparent;
	border-radius: var(--crm-radius-sm);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, border-color .15s, opacity .15s;
}
.crm-btn--primary {
	width: 100%;
	background: var(--crm-primary);
	color: #fff;
}
.crm-btn--primary:hover { background: var(--crm-primary-dark); }
.crm-btn--ghost {
	background: transparent;
	border-color: var(--crm-border);
	color: var(--crm-text);
}
.crm-btn--ghost:hover { border-color: var(--crm-primary); color: var(--crm-primary); }
.crm-btn--sm { padding: 8px 14px; font-size: .88rem; }
.crm-btn.is-loading { opacity: .6; pointer-events: none; }
.crm-btn:disabled { opacity: .6; cursor: default; }

/* ── Komunikaty ── */
.crm-messages { margin-bottom: 6px; }
.crm-messages:empty { margin-bottom: 0; }
.crm-messages p {
	margin: 0 0 8px;
	padding: 11px 14px;
	border-radius: var(--crm-radius-sm);
	font-size: .9rem;
}
.crm-messages--error p { background: #fdeaea; color: var(--crm-danger); }
.crm-messages--success p { background: #e7f7ef; color: var(--crm-success); }
.crm-notice { margin: 0; color: var(--crm-muted); }
.crm-notice a, .crm-messages a { color: var(--crm-primary); }

/* ── Pulpit ── */
.crm-dashboard__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
}
.crm-dashboard__greeting { margin: 0; font-size: 1.7rem; }
.crm-section { margin-bottom: 22px; }
.crm-section__title { margin: 0 0 18px; font-size: 1.2rem; }
.crm-empty { margin: 0; color: var(--crm-muted); }

/* ── Tabele ── */
.crm-table-wrap { overflow-x: auto; }
.crm-table { width: 100%; border-collapse: collapse; }
.crm-table th,
.crm-table td {
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid var(--crm-border);
	font-size: .92rem;
}
.crm-table th {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--crm-muted);
}
.crm-table tbody tr:last-child td { border-bottom: 0; }

/* ── Historia odnowień usługi ── */
.crm-history > summary { cursor: pointer; color: var(--crm-primary); font-weight: 500; }
.crm-history__list { margin: 8px 0 0; padding: 0; list-style: none; }
.crm-history__list li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: .85rem;
}
.crm-history__date { font-variant-numeric: tabular-nums; color: var(--crm-muted); }
.crm-history__exp { color: var(--crm-muted); font-variant-numeric: tabular-nums; }

/* ── Plakietki statusów ── */
.crm-badge {
	display: inline-block;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: .78rem;
	font-weight: 600;
}
.crm-badge--active,
.crm-badge--done { background: #e7f7ef; color: var(--crm-success); }
.crm-badge--new { background: #e8f0fe; color: var(--crm-primary); }
.crm-badge--in_progress { background: #fff4e0; color: #b8730a; }
.crm-badge--on_hold { background: #eef0f4; color: var(--crm-muted); }
.crm-badge--suspended,
.crm-badge--expired,
.crm-badge--cancelled { background: #fdeaea; color: var(--crm-danger); }

/* ── Projekty: postęp ── */
.crm-projects { display: grid; gap: 16px; }
.crm-project { padding: 14px 16px; border: 1px solid var(--crm-border); border-radius: var(--crm-radius-sm); }
.crm-project__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.crm-project__name { font-weight: 600; }
.crm-progress { position: relative; height: 9px; background: var(--crm-bg); border-radius: 999px; overflow: hidden; }
.crm-progress__bar { height: 100%; background: linear-gradient( 90deg, var(--crm-primary), var(--crm-accent) ); border-radius: 999px; transition: width .4s ease; }
.crm-progress__label { display: inline-block; margin-top: 6px; font-size: .8rem; color: var(--crm-muted); }

/* ── Konfigurator ── */
.crm-fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.crm-fieldset legend { padding: 0; margin-bottom: 10px; }
.crm-options { display: grid; gap: 10px; }
.crm-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius-sm);
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.crm-option:hover { border-color: var(--crm-primary); }
.crm-option:has( input:checked ) {
	border-color: var(--crm-primary);
	background: #f3f7ff;
	box-shadow: 0 0 0 2px rgba(27, 110, 243, .12) inset;
}
.crm-option input { margin: 0; flex: 0 0 auto; width: 18px; height: 18px; }
.crm-option__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.crm-option__name { font-weight: 600; }
.crm-option__desc { font-size: .85rem; color: var(--crm-muted); }
.crm-option__price { text-align: right; white-space: nowrap; }
.crm-option__price strong { display: block; color: var(--crm-text); }
.crm-option__price small { color: var(--crm-muted); font-size: .78rem; }

/* ── Panel z zakładkami ── */
/* Panel klienta — pełna szerokość WEWNĄTRZ kontenera motywu (#main.site-main),
   bez wyłamywania (żadnego 100vw). Panel wypełnia rodzica i ma własne tło. */
.crm-app {
	max-width: none;
	width: 100%;
	box-sizing: border-box;
	padding-left: clamp(12px, 2vw, 28px);
	padding-right: clamp(12px, 2vw, 28px);
}

/* Strona panelu: kontener treści motywu na pełną szerokość — zdejmujemy max-width i boczny padding.
   NIE ruszamy width/margin (żeby nic nie „uciekło w lewo"). Nie dotykamy klas .crm-* (własny layout). */
body.crm-dashboard-page #main.site-main,
body.crm-dashboard-page .site-main,
body.crm-dashboard-page .site-main .entry-content,
body.crm-dashboard-page .site-main article,
body.crm-dashboard-page .site-main .wp-block-post-content {
	max-width: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Blokowy motyw: poluzuj layout „constrained". */
body.crm-dashboard-page {
	--wp--style--global--content-size: 100%;
	--wp--style--global--wide-size: 100%;
}

/* Własne tło panelu (lawenda) — białe karty mają kontrast niezależnie od tła motywu. */
body.crm-dashboard-page .crm-app {
	background: var(--crm-bg);
	padding-top: 28px;
	padding-bottom: 48px;
	min-height: 70vh;
}

/* Tytuł/nagłówek strony z motywu („Panel klienta") zbędny — panel ma własny branding. */
body.crm-dashboard-page .entry-header,
body.crm-dashboard-page .entry-title,
body.crm-dashboard-page .page-title,
body.crm-dashboard-page .wp-block-post-title {
	display: none !important;
}

.crm-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}
.crm-topbar__user { display: flex; align-items: center; gap: 12px; }
.crm-topbar__name { font-weight: 600; }
.crm-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px; height: 42px;
	border-radius: 50%;
	background: var(--crm-primary);
	color: #fff;
	font-weight: 700;
}

.crm-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--crm-border);
	padding-bottom: 8px;
}
.crm-tab {
	position: relative;
	border: 0;
	background: transparent;
	padding: 9px 14px;
	border-radius: var(--crm-radius-sm);
	font: inherit;
	font-weight: 600;
	color: var(--crm-muted);
	cursor: pointer;
	transition: background .15s, color .15s;
}
.crm-tab:hover { background: var(--crm-bg); color: var(--crm-text); }
.crm-tab.is-active { background: var(--crm-primary); color: #fff; }
.crm-tab__badge {
	display: inline-block;
	min-width: 18px;
	margin-left: 6px;
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--crm-danger);
	color: #fff;
	font-size: .72rem;
	line-height: 16px;
	text-align: center;
}
.crm-tab.is-active .crm-tab__badge { background: #fff; color: var(--crm-primary); }
.crm-pane[hidden] { display: none; }

/* ── Panel — layout z menu bocznym (białe menu, niebieskie akcenty) ── */
.crm-shell {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 20px;
	align-items: start;
}
.crm-sidebar {
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: var(--crm-surface);
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius);
	box-shadow: var(--crm-shadow);
	padding: 16px 12px;
	position: sticky;
	top: 20px;
}
.crm-sidebar__brand {
	font-weight: 800;
	font-size: 1.15rem;
	letter-spacing: .05em;
	color: var(--crm-primary);
	padding: 6px 10px 4px;
}
.crm-sidebar__nav { display: flex; flex-direction: column; gap: 14px; }
.crm-sidebar__group { display: flex; flex-direction: column; gap: 2px; }
.crm-sidebar__group-label {
	font-size: .68rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	font-weight: 700;
	color: var(--crm-muted);
	padding: 4px 10px;
}

/* Pozycje menu w sidebarze — pełna szerokość, ikona + etykieta + badge. */
.crm-sidebar .crm-tab {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	text-align: left;
	padding: 9px 10px;
	border: 0;
	background: transparent;
	border-radius: var(--crm-radius-sm);
	font: inherit;
	font-weight: 600;
	color: var(--crm-text);
	cursor: pointer;
	transition: background .15s, color .15s;
}
.crm-sidebar .crm-tab:hover { background: var(--crm-bg); }
.crm-sidebar .crm-tab.is-active { background: var(--crm-primary); color: #fff; }
.crm-tab__icon { display: inline-flex; flex: 0 0 auto; color: var(--crm-primary); }
.crm-tab__icon svg { width: 20px; height: 20px; display: block; }
.crm-sidebar .crm-tab.is-active .crm-tab__icon { color: #fff; }
.crm-tab__label { flex: 1; }

.crm-sidebar__footer {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 8px 2px;
	border-top: 1px solid var(--crm-border);
}
.crm-sidebar__user {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	font-size: .9rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.crm-sidebar__logout { font-size: .82rem; color: var(--crm-muted); text-decoration: none; white-space: nowrap; }
.crm-sidebar__logout:hover { color: var(--crm-primary); }

.crm-content { min-width: 0; }
.crm-content__head { display: none; }
.crm-content__brand { font-weight: 800; color: var(--crm-primary); letter-spacing: .05em; }
.crm-menu-toggle {
	border: 1px solid var(--crm-border);
	background: var(--crm-surface);
	border-radius: var(--crm-radius-sm);
	padding: 8px 12px;
	font: inherit;
	font-weight: 600;
	color: var(--crm-text);
	cursor: pointer;
}

@media (max-width: 820px) {
	.crm-shell { grid-template-columns: 1fr; gap: 14px; }
	.crm-sidebar { position: static; display: none; }
	#crm-panel.is-menu-open .crm-sidebar { display: flex; }
	.crm-content__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 14px;
	}
}

.crm-subtitle { margin: 22px 0 12px; font-size: 1rem; }
.crm-muted { color: var(--crm-muted); font-weight: 400; }

/* ── Kafelki ── */
.crm-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.crm-cards--2 { grid-template-columns: repeat(2, 1fr); }
.crm-card__title { margin: 0 0 10px; font-size: 1rem; }
.crm-stat { text-align: left; cursor: pointer; border: 1px solid var(--crm-border); transition: border-color .15s, transform .1s; }
.crm-stat:hover { border-color: var(--crm-primary); transform: translateY(-1px); }
.crm-stat__value { display: block; font-size: 1.9rem; font-weight: 800; color: var(--crm-primary); line-height: 1; }
.crm-stat__label { display: block; margin-top: 6px; font-size: .85rem; color: var(--crm-muted); }
@media (max-width: 760px) {
	.crm-cards, .crm-cards--2 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Podpowiedzi „Co dalej?" ── */
.crm-hints {
	background: var(--crm-surface);
	border: 1px solid var(--crm-border);
	border-left: 4px solid var(--crm-primary);
	border-radius: var(--crm-radius);
	box-shadow: var(--crm-shadow);
	padding: 16px 18px;
	margin-bottom: 18px;
}
.crm-hints__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 1rem;
	color: var(--crm-text);
}
.crm-hints__icon { width: 20px; height: 20px; color: var(--crm-primary); flex: 0 0 auto; }
.crm-hint {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-top: 1px solid var(--crm-border);
}
.crm-hint:first-of-type { border-top: 0; }
.crm-hint__dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--crm-muted); }
.crm-hint__text { flex: 1; line-height: 1.45; }
.crm-hint .crm-btn { flex: 0 0 auto; white-space: nowrap; }
.crm-hint--info .crm-hint__dot    { background: var(--crm-primary); }
.crm-hint--warn .crm-hint__dot    { background: #d98324; }
.crm-hint--success .crm-hint__dot { background: var(--crm-success); }
@media (max-width: 560px) {
	.crm-hint { flex-wrap: wrap; }
	.crm-hint__text { flex: 1 1 100%; }
	.crm-hint .crm-btn { margin-left: 21px; }
}

/* ── Pliki ── */
.crm-files { display: grid; gap: 12px; }
.crm-file { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.crm-file__info { display: flex; align-items: center; gap: 12px; }
.crm-file__icon { font-size: 1.6rem; }
.crm-file__title { display: block; font-weight: 600; }
.crm-file__meta { display: block; font-size: .8rem; color: var(--crm-muted); }

/* ── Powiadomienia ── */
.crm-notices { display: grid; gap: 12px; }
.crm-notice__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.crm-notice__title { margin: 0; font-size: 1.05rem; }
.crm-notice__date { font-size: .8rem; color: var(--crm-muted); white-space: nowrap; }
.crm-notice__body { margin-top: 8px; color: var(--crm-text); }
.crm-notice__body p { margin: 0 0 8px; }

/* ── Czat ── */
.crm-chat { display: flex; flex-direction: column; border: 1px solid var(--crm-border); border-radius: var(--crm-radius); overflow: hidden; }
.crm-chat__messages { display: flex; flex-direction: column; gap: 10px; padding: 18px; height: 420px; overflow-y: auto; background: var(--crm-bg); }
.crm-msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: .92rem; }
.crm-msg__author { display: block; font-size: .72rem; font-weight: 700; color: var(--crm-primary); margin-bottom: 3px; }
.crm-msg__body { display: block; white-space: pre-wrap; }
.crm-msg__time { display: block; margin-top: 4px; font-size: .68rem; opacity: .65; text-align: right; }
.crm-msg__photo { max-width: 220px; border-radius: 10px; margin-bottom: 4px; display: block; }
.crm-msg__photo-link { cursor: zoom-in; display: inline-block; }

/* ── Lightbox ── */
.crm-lightbox { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10, 20, 40, .82); }
.crm-lightbox[hidden] { display: none; }
.crm-lightbox__img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0, 0, 0, .5); }
.crm-lightbox__close { position: absolute; top: 16px; right: 20px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.crm-lightbox__close:hover { background: rgba(255, 255, 255, .3); }

/* ── Pływający widget czatu ── */
.crm-cw { position: fixed; right: 20px; bottom: 20px; z-index: 99990; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-family: var(--crm-font); }
.crm-cw[hidden] { display: none; }
/* Czat zespołu (admin) — podniesiony o 50px od dołu. */
.crm-cw[data-mode="general"] { bottom: 70px; }
.crm-cw__toggle { position: relative; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--crm-primary); color: #fff; box-shadow: 0 8px 24px rgba(16, 33, 60, .28); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s, background .15s; }
.crm-cw__toggle:hover { background: var(--crm-primary-dark); transform: translateY(-2px); }
.crm-cw__badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--crm-danger); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.crm-cw__badge[hidden] { display: none; }
.crm-cw__panel { width: 350px; max-width: calc(100vw - 32px); background: var(--crm-surface); border: 1px solid var(--crm-border); border-radius: var(--crm-radius); box-shadow: var(--crm-shadow); overflow: hidden; display: flex; flex-direction: column; }
.crm-cw__panel[hidden] { display: none; }
.crm-cw__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--crm-primary); color: #fff; }
.crm-cw__title { font-weight: 700; }
.crm-cw__close { border: 0; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; opacity: .9; }
.crm-cw__close:hover { opacity: 1; }
.crm-cw__messages { height: 340px; }
@media (max-width: 480px) {
	.crm-cw { right: 12px; bottom: 12px; }
	.crm-cw__panel { width: calc(100vw - 24px); }
	.crm-cw__messages { height: 50vh; }
}
.crm-msg--mine { align-self: flex-end; background: var(--crm-primary); color: #fff; border-bottom-right-radius: 4px; }
.crm-msg--them { align-self: flex-start; background: var(--crm-surface); border: 1px solid var(--crm-border); border-bottom-left-radius: 4px; }
.crm-chat__composer { border-top: 1px solid var(--crm-border); padding: 10px; background: var(--crm-surface); }
.crm-chat__row { display: flex; align-items: flex-end; gap: 8px; }
.crm-chat__row textarea { flex: 1 1 auto; width: 100%; min-width: 0; resize: none; min-height: 48px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--crm-border); border-radius: var(--crm-radius-sm); font: inherit; line-height: 1.4; color: var(--crm-text); background: var(--crm-surface); }
/* „Wyślij" w czacie nie może być na pełną szerokość (globalna reguła .crm-btn--primary). */
.crm-chat__row .crm-btn { width: auto; flex: 0 0 auto; }
.crm-chat__row textarea:focus { outline: none; border-color: var(--crm-primary); box-shadow: 0 0 0 3px rgba(27, 110, 243, .15); }
.crm-chat__attach {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius-sm);
	background: var(--crm-bg);
	color: var(--crm-primary);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}
.crm-chat__attach:hover { background: #eef4ff; border-color: var(--crm-primary); }
.crm-chat__attach svg { width: 20px; height: 20px; display: block; }
.crm-chat__preview { position: relative; display: inline-block; margin-bottom: 8px; }
.crm-chat__preview img { max-height: 90px; border-radius: 8px; border: 1px solid var(--crm-border); }
.crm-chat__preview-remove { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--crm-danger); color: #fff; cursor: pointer; line-height: 1; }

/* ── Podsumowanie sumy ── */
.crm-summary {
	margin: 4px 0 18px;
	padding: 14px 16px;
	background: var(--crm-bg);
	border-radius: var(--crm-radius-sm);
}
.crm-summary__row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--crm-muted); }
.crm-summary__row--total {
	margin-top: 6px;
	padding-top: 10px;
	border-top: 1px solid var(--crm-border);
	color: var(--crm-text);
	font-size: 1.15rem;
	font-weight: 700;
}
.crm-summary__row--total span:last-child { color: var(--crm-primary); }

/* ── Responsywność: tabele jako karty ── */
@media (max-width: 600px) {
	.crm-card { padding: 20px; }
	.crm-field-row { flex-direction: column; gap: 0; }
	.crm-table thead { display: none; }
	.crm-table, .crm-table tbody, .crm-table tr, .crm-table td { display: block; width: 100%; }
	.crm-table tr {
		margin-bottom: 12px;
		border: 1px solid var(--crm-border);
		border-radius: var(--crm-radius-sm);
		padding: 6px 12px;
	}
	.crm-table td { border-bottom: 0; padding: 8px 0; display: flex; justify-content: space-between; gap: 12px; }
	.crm-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--crm-muted);
		font-size: .8rem;
	}
}

/* ── Brief WWW ── */
.crm-brief-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0 0 18px;
	padding: 12px 16px;
	background: var(--crm-bg);
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius-sm);
}
.crm-brief-cta > span { color: var(--crm-muted); }
.crm-brief-cta .crm-btn { margin-left: auto; }
.crm-section__intro {
	color: var(--crm-muted);
	margin: -4px 0 18px;
	max-width: 60ch;
}
.crm-field__hint {
	display: block;
	color: var(--crm-muted);
	font-size: .8rem;
	margin-top: 6px;
}
.crm-brief-uploads { margin-top: 22px; }
.crm-brief-upload { margin-bottom: 20px; }
.crm-brief-upload > .crm-field__label { display: block; margin-bottom: 8px; }
.crm-brief-files {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
}
.crm-brief-file {
	position: relative;
	width: 110px;
	border: 1px solid var(--crm-border);
	border-radius: var(--crm-radius-sm);
	background: var(--crm-surface);
	padding: 8px;
}
.crm-brief-file__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: var(--crm-text);
}
.crm-brief-file__thumb {
	width: 100%;
	height: 70px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}
.crm-brief-file__icon { font-size: 2.6rem; line-height: 70px; }
.crm-brief-file__name {
	font-size: .75rem;
	text-align: center;
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.crm-brief-file__remove {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 22px;
	height: 22px;
	border: 0;
	border-radius: 50%;
	background: var(--crm-danger);
	color: #fff;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--crm-shadow);
}

/* ── Karty cenowe (shortcode [pakiety_hostingu] / [pakiety_www]) ──
   Styl jak oferta na intmedia.pl: ikona-diament (kolor wg pozycji), niebieski baner
   z ceną (duża liczba + grosze w indeksie), lista cech z zielonymi haczykami i przerywanymi
   liniami (nieujęte cechy przekreślone), ukośna wstążka „Polecane", obsługa promocji
   (regularna cena przekreślona + narożnik „−%"). Białe karty czytelne też na ciemnym tle
   motywu — tytuł dziedziczy kolor tekstu strony. */
.crm-pricing { --crm-navy: #2b3550; --crm-gold: #f4b73f; --crm-struck: #c2c8d3; margin: 32px 0; }
.crm-pricing__title {
	margin: 0 0 26px;
	font-size: 1.7rem;
	font-weight: 800;
	text-align: center;
	color: inherit;
}
.crm-pricing__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 22px;
	align-items: stretch;
	max-width: 1040px;
	margin: 0 auto;
}
.crm-plan {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 0 0 30px;
	background: var(--crm-surface);
	border-radius: 8px;
	box-shadow: var(--crm-shadow);
	overflow: hidden;
	text-align: center;
	color: var(--crm-text);
}
.crm-plan--featured { box-shadow: 0 16px 46px rgba(27, 110, 243, .26); }
@media (min-width: 821px) { .crm-plan--featured { transform: translateY(-10px); } }

/* Diament */
.crm-plan__gem-wrap { padding: 30px 0 4px; }
.crm-plan__gem { width: 46px; height: 40px; }
.crm-plan__gem-body { fill: var(--crm-navy); }
.crm-plan--blue .crm-plan__gem-body { fill: var(--crm-primary); }
.crm-plan--gold .crm-plan__gem-body { fill: var(--crm-gold); }
.crm-plan__gem-facet { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1.1; }

.crm-plan__name { margin: 8px 0 2px; font-size: 1.65rem; font-weight: 800; color: var(--crm-text); }
.crm-plan__sub { margin: 0; font-size: .82rem; color: var(--crm-muted); }

/* Baner z ceną (pełna szerokość karty) */
.crm-plan__price {
	margin-top: 18px;
	background: var(--crm-primary);
	color: #fff;
	padding: 22px 12px 20px;
	line-height: 1.05;
}
.crm-plan__old {
	display: block;
	margin-bottom: 4px;
	font-size: .9rem;
	text-decoration: line-through;
	opacity: .8;
}
.crm-plan__now { display: inline-flex; align-items: flex-start; justify-content: center; gap: 2px; }
.crm-plan__int { font-size: 2.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.crm-plan__gr { font-size: 1.05rem; font-weight: 800; margin-top: 5px; }
.crm-plan__cur { font-size: .82rem; font-weight: 600; margin-top: 6px; opacity: .92; }
.crm-plan__net { display: block; margin-top: 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; opacity: .8; }

/* Lista cech */
.crm-plan__features { list-style: none; margin: 0; padding: 6px 22px 0; }
.crm-plan__features li {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 14px 4px;
	font-size: .9rem;
	color: var(--crm-text);
	border-bottom: 1px dashed var(--crm-border);
}
.crm-plan__features li:last-child { border-bottom: 0; }
.crm-plan__tick { flex: 0 0 auto; width: 16px; height: 16px; }
.crm-plan__tick path { fill: none; stroke: var(--crm-success); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.crm-plan__features li.is-no { color: var(--crm-struck); text-decoration: line-through; }
.crm-plan__features li.is-no .crm-plan__tick path { stroke: var(--crm-struck); }

.crm-plan__cta {
	margin: 22px 22px 0;
	display: block;
	text-align: center;
	padding: 13px 18px;
	border-radius: var(--crm-radius-sm);
	background: var(--crm-primary);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: background .15s ease, filter .15s ease;
}
.crm-plan__cta:hover { background: var(--crm-primary-dark); color: #fff; }

/* Wstążka „Polecane" (narożnik prawy-górny) */
.crm-plan__ribbon { position: absolute; top: 0; right: 0; width: 116px; height: 116px; overflow: hidden; pointer-events: none; }
.crm-plan__ribbon span {
	position: absolute;
	top: 20px;
	right: -34px;
	transform: rotate(45deg);
	background: var(--crm-navy);
	color: #fff;
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 5px 40px;
	box-shadow: 0 4px 10px rgba(21, 39, 74, .28);
}

/* Promocja: narożnik „−%" (lewy-górny) */
.crm-plan__promo-tag {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	background: var(--crm-danger);
	color: #fff;
	font-size: .8rem;
	font-weight: 800;
	letter-spacing: .02em;
	padding: 5px 11px;
	border-radius: 999px;
	box-shadow: 0 4px 12px rgba(217, 59, 59, .32);
}

@media (max-width: 600px) {
	.crm-pricing__title { font-size: 1.4rem; }
	.crm-plan__int { font-size: 2.4rem; }
}

/* ── Efekty kart cenowych (hosting/serwery/WWW): hover-lift, unoszący diament, „połysk", puls „Polecane” ── */
.crm-plan { transition: transform .28s ease, box-shadow .28s ease; }
.crm-plan:hover { transform: translateY(-10px); box-shadow: 0 26px 60px rgba(27, 110, 243, .28); }
.crm-plan--featured:hover { transform: translateY(-14px); }
.crm-plan__gem { transition: transform .4s ease; }
.crm-plan:hover .crm-plan__gem { transform: translateY(-4px) scale(1.08); }

/* Połysk przelatujący przez kartę na hover. */
.crm-plan::after {
	content: "";
	position: absolute;
	top: 0;
	left: -70%;
	width: 45%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
	transform: skewX(-18deg);
	opacity: 0;
	pointer-events: none;
	z-index: 3;
}
.crm-plan:hover::after { animation: crm-plan-shine .9s ease; }
@keyframes crm-plan-shine {
	0%   { left: -70%; opacity: 0; }
	18%  { opacity: 1; }
	100% { left: 120%; opacity: 0; }
}

/* „Polecane” — łagodny puls poświaty. */
.crm-plan--featured { animation: crm-plan-glow 3s ease-in-out infinite; }
@keyframes crm-plan-glow {
	0%, 100% { box-shadow: 0 16px 46px rgba(27, 110, 243, .26); }
	50%      { box-shadow: 0 22px 58px rgba(27, 110, 243, .44); }
}

@media (prefers-reduced-motion: reduce) {
	.crm-plan, .crm-plan__gem { transition: none; }
	.crm-plan:hover, .crm-plan--featured:hover { transform: none; }
	.crm-plan--featured { animation: none; }
	.crm-plan:hover::after { animation: none; }
}

/* Podświetlenie pakietu wybranego z kart cenowych („Wybieram" → konfigurator). */
.crm-option.is-flash { animation: crm-option-flash 1.6s ease; }
@keyframes crm-option-flash {
	0%, 100% { box-shadow: 0 0 0 0 rgba(27, 110, 243, 0); }
	18%      { box-shadow: 0 0 0 3px rgba(27, 110, 243, .35); border-color: var(--crm-primary); }
}
@media (prefers-reduced-motion: reduce) {
	.crm-option.is-flash { animation: none; box-shadow: 0 0 0 2px rgba(27, 110, 243, .3); }
}

/* Pod-zakładki w „Zamów" (Strona WWW / Hosting / Inna usługa). */
.crm-subtabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0 0 22px;
	border-bottom: 1px solid var(--crm-border);
}
.crm-subtab {
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	padding: 11px 18px;
	font: inherit;
	font-weight: 600;
	color: var(--crm-muted);
	cursor: pointer;
}
.crm-subtab:hover { color: var(--crm-text); }
.crm-subtab.is-active { color: var(--crm-primary); border-bottom-color: var(--crm-primary); }
@media (max-width: 600px) {
	.crm-subtab { padding: 10px 12px; font-size: .95rem; }
}
