/* ==========================================================================
   CABINET DESIGN SYSTEM — «Мой Фонд» (Hybrid Brutalist Dashboard)
   Архитектурный стиль с жесткими контурами (швейцарский стиль + дашборд)
   ========================================================================== */

/* Layout */
.cab-layout {
	display: flex;
	flex-wrap: wrap;
	padding-top: 2.5rem; /* Уменьшен верхний отступ */
	padding-bottom: 5rem;
}

.cab-sidebar {
	width: 20rem;
	flex-shrink: 0;
	margin-right: 4rem;
}

.cab-content {
	flex-grow: 1;
	width: calc(100% - 24rem);
}

.cab-content .fbl-form h2 {
	display: none;
}

.cab-content .fbl-form {
	padding: 0;
	background: none;
	box-shadow: none;
}

/* Page Header */
.cab-page-header {
	margin-bottom: 2rem;
}
.cabinet-root .cab-page-header:after {
	display: none !important;
}
.cab-page-header__kicker {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	color: var(--black);
	opacity: 0.6;
	margin-bottom: 0.5rem;
	letter-spacing: 0.05em;
}
.cab-page-header__title {
	font-size: 4rem; /* Чуть уменьшено */
	line-height: 1;
	text-transform: uppercase;
	margin: 0;
}

/* Sidebar */
.cab-sidebar__section {
	margin-bottom: 3rem;
}

.cab-sidebar__label {
	font-size: 0.63rem;
	text-transform: uppercase;
	margin-bottom: 1rem;
	opacity: 0.5;
	letter-spacing: 0.05em;
}

.cab-sidebar__item {
	display: block;
	font-size: 1.25rem;
	text-decoration: none;
	color: var(--black);
	padding: 0.75rem 0;
	transition: color 0.2s, padding-left 0.2s;
	position: relative;
}

.cab-sidebar__item:hover {
	color: var(--red);
}

.cab-sidebar__item.is-active {
	color: var(--red);
	font-weight: 500;
	padding-left: 1.5rem;
}

.cab-sidebar__item.is-active::before {
	content: '→';
	position: absolute;
	left: 0;
	top: 0.75rem;
	color: var(--red);
}

.cab-sidebar__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--red);
	color: var(--white);
	border-radius: 50%;
	width: 1.5rem;
	height: 1.5rem;
	font-size: 0.75rem;
	margin-left: 0.5rem;
	vertical-align: middle;
	font-weight: 400;
}

/* Alert Block */
.cab-alert {
	background-color: #f9f9f9;
	border: 1px solid #eaeaea;
	border-radius: 1.88rem;
	padding: 1.5rem 2rem;
	font-size: 1.13rem;
	line-height: 1.3;
	margin-bottom: 1.5rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}
.cab-alert strong {
	color: var(--red);
}

/* Form Inputs */
.cab-input {
	border: 1px solid #eaeaea;
	border-radius: 3.13rem;
	background: #ffffff;
	padding: 0 1.25rem;
	height: 3.13rem;
	width: 100%;
	box-sizing: border-box;
	font-size: 1rem;
	font-family: inherit;
	margin: 0;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	outline: none;
}
.cab-input:focus {
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(218, 53, 44, 0.1);
}

/* Generic Form Classes used in Auth */
.cab-form-group {
	margin-bottom: 1.25rem;
}
.cab-form-input {
	border: 1px solid #eaeaea;
	border-radius: 3.13rem;
	background: #ffffff;
	padding: 0 1.25rem;
	height: 3.13rem;
	width: 100%;
	box-sizing: border-box;
	font-size: 1rem;
	font-family: inherit;
	margin: 0;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	outline: none;
	color: var(--black);
}
.cab-form-input::placeholder {
	color: rgba(20, 20, 18, 0.5);
}
.cab-form-input:focus {
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(218, 53, 44, 0.1);
}
.cab-form-error {
	color: var(--red);
	font-size: 0.88rem;
}
.cab-form-hint {
	font-size: 0.88rem;
	opacity: 0.7;
}

/* Generic Buttons */
.cab-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border: 1px solid var(--red);
	padding: 0 2.25rem;
	height: 3.13rem;
	font-size: 0.88rem;
	font-weight: 600;
	font-family: inherit;
	background: var(--red);
	color: #fff;
	cursor: pointer;
	transition: background 0.3s, color 0.3s, border-color 0.3s;
	border-radius: 3.13rem;
	text-decoration: none;
	text-transform: uppercase;
}
.cab-btn:hover {
	background: #c22921;
	border-color: #c22921;
}
.cab-btn--primary {
	background: var(--red);
	border-color: var(--red);
	color: var(--white);
}
.cab-btn--primary:hover {
	background: #c22921;
	border-color: #c22921;
	color: var(--white);
}
.cab-btn--outline {
	background: transparent;
	border: 1px solid var(--black);
	color: var(--black);
}
.cab-btn--outline:hover {
	background: var(--black);
	color: var(--white);
}
.cab-btn--lg {
	padding: 0 2.5rem;
	height: 3.75rem;
	font-size: 1rem;
}

/* Utility Margins */
.cab-mb-md { margin-bottom: 1rem; }
.cab-mb-lg { margin-bottom: 1.5rem; }
.cab-mt-lg { margin-top: 1.5rem; }

/* Dashboard Grid */
.cab-grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.cab-card {
	background-color: #ffffff;
	border: 1px solid #eaeaea;
	border-radius: 1.88rem;
	padding: 1.5rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
}

.cab-card:hover {
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Bento Grid: Impact Card (Span 8) */
.cab-card--impact {
	grid-column: span 8;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 280px;
}
.cab-impact-top {
	margin-bottom: 2rem;
}
.cab-impact-bottom {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}
.cab-stat-pill {
	display: inline-flex;
	align-items: center;
	background: #f9f9f9;
	border: 1px solid #eaeaea;
	border-radius: 3.13rem;
	padding: 0.63rem 1.25rem;
	gap: 0.5rem;
}
.cab-stat-pill__val {
	font-weight: 600;
	font-size: 1.13rem;
	color: var(--red);
	line-height: 1;
}
.cab-stat-pill__lbl {
	font-size: 0.88rem;
	color: var(--black);
	opacity: 0.8;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1;
}

/* Bento Grid: Award Card (Span 4) */
.cab-card--award-bento {
	grid-column: span 4;
	background: var(--red);
	color: var(--white);
	border-color: var(--red);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.cab-card--full {
	grid-column: span 12;
}

.cab-card__label {
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 1rem;
	opacity: 0.8;
}

.cab-card__value {
	font-size: 4rem;
	line-height: 0.9;
	color: var(--red);
	font-family: inherit;
	word-break: break-word;
}

.cab-card--impact .cab-card__value {
	font-size: clamp(4rem, 6.5vw, 5.5rem);
}

/* Award Bento specific */
.cab-card--award-bento .cab-card__label {
	margin-bottom: 1rem;
	opacity: 0.9;
}
.cab-award-bento__icon {
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: 1rem;
	display: block;
	border-radius: 50%;
}
.cab-award-bento__name {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	line-height: 1.2;
}
.cab-award-bento__meta {
	font-size: 0.88rem;
	opacity: 0.9;
	line-height: 1.4;
	margin-bottom: 1.5rem;
}
.cab-award-bento__progress-text {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.5rem;
	opacity: 0.9;
}
.cab-award-bento__progress-text span {
	font-weight: 600;
	color: var(--white);
}

/* Progress Bar */
.cab-progress {
	width: 100%;
	height: 1rem;
	border-radius: 0.63rem;
	background: rgba(255,255,255,0.3);
	overflow: hidden;
}
.cab-progress__fill {
	height: 100%;
	background: var(--white);
	border-radius: 0.63rem;
	transition: width 0.3s ease;
}

/* Transaction List in Full Card */
.cab-tx-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	border-bottom: 1px solid #eaeaea;
	padding-bottom: 1.5rem;
	margin-bottom: 1.5rem;
}
.cab-tx-header h2 {
	margin: 0;
	line-height: 1.15;
	font-size: 1.25rem;
}
.cab-tx-header a {
	text-decoration: underline;
	color: var(--black);
	font-size: 1rem;
	white-space: nowrap;
	flex-shrink: 0;
	margin-left: 1rem;
}
.cab-tx-item {
	display: flex;
	justify-content: space-between;
	padding: 1.5rem 0;
	border-bottom: 1px solid rgba(20, 20, 18, 0.1);
}
.cab-tx-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}
.cab-tx-item__left {
	display: flex;
	flex-direction: column;
}
.cab-tx-item__title {
	font-size: 1.25rem;
	margin-bottom: 0.25rem;
}
.cab-tx-item__meta {
	font-size: 0.88rem;
	opacity: 0.6;
}
.cab-tx-item__amount {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--black);
}

/* Achievements Gallery (No Borders) */
.cab-achiev-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 2rem;
	padding: 2rem 0;
}
.cab-achiev-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
	cursor: default;
}
.cab-achiev-item:not(.is-locked):hover {
	transform: translateY(-5px) scale(1.05);
}
.cab-achiev-icon {
	width: 6rem;
	height: 6rem;
	display: block;
	margin-bottom: 1rem;
}
.cab-achiev-name {
	font-size: 1.13rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.2;
}
.cab-achiev-desc {
	font-size: 0.75rem;
	opacity: 0.4;
	margin-bottom: 0;
	line-height: 1.3;
}

/* Locked Ghost State */
.cab-achiev-item.is-locked {
	opacity: 0.5;
}
.cab-achiev-item.is-locked .cab-achiev-name {
	opacity: 0.5;
}

/* Mobile */
@media (max-width: 991px) {
	.cab-layout {
		flex-direction: column;
		padding-top: 2rem;
	}
	
	/* Horizontal Scroll Menu for Mobile */
	.cab-sidebar {
		width: 100%;
		margin-right: 0;
		margin-bottom: 2rem;
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.cab-sidebar::-webkit-scrollbar {
		display: none;
	}
	.cab-sidebar__inner {
		display: inline-flex;
		gap: 0.5rem;
		padding-bottom: 0.5rem;
	}
	.cab-sidebar__section {
		display: inline-flex;
		gap: 0.5rem;
		margin-bottom: 0;
		align-items: center;
	}
	.cab-sidebar__label {
		display: none; /* Скрываем заголовки секций на мобильном */
	}
	.cab-sidebar__item {
		display: inline-flex;
		align-items: center;
		padding: 0.63rem 1.25rem;
		background: #ffffff;
		border: 1px solid #eaeaea;
		border-radius: 3.13rem;
		font-size: 0.88rem;
		box-shadow: 0 2px 8px rgba(0,0,0,0.02);
	}
	.cab-sidebar__item.is-active {
		background: var(--red);
		border-color: var(--red);
		color: var(--white);
	}
	.cab-sidebar__item.is-active::before {
		content: none; /* Убираем стрелочку */
	}
	.cab-sidebar__item:hover {
		color: inherit;
	}
	.cab-sidebar__item.is-active:hover {
		color: var(--white);
	}
	
	/* Инверсия цвета бейджа для активного пункта */
	.cab-sidebar__item.is-active .cab-sidebar__badge {
		background: var(--white);
		color: var(--red);
	}

	.cab-content {
		width: 100%;
	}
	.cab-page-header__title {
		font-size: 3rem;
	}
	.cab-card--impact,
	.cab-card--award-bento,
	.cab-card--achiev {
		grid-column: span 12;
	}

	.cab-card--impact {
		min-height: auto;
	}
	
	.cab-grid > * {
		grid-column: span 12 !important;
	}
	.cab-tx-item {
		flex-direction: column;
	}
	.cab-tx-item__amount {
		margin-top: 0.75rem;
	}
	.cab-hall-progress {
		flex-direction: column;
		align-items: flex-start;
		gap: 0; /* Убрали огромную дыру */
	}
	.cab-hall-progress__left {
		padding-right: 0;
		/* flex-grow: 1 хватает, убрали 100% чтобы не ломать паддинги карточки */
	}
	.cab-hall-progress__percent {
		align-self: flex-end;
		margin-top: 1rem;
		font-size: 4.5rem; /* Сделали чуть аккуратнее на мобилке */
	}
	.cab-form-grid {
		grid-template-columns: 1fr !important;
	}
}

.cab-form-grid {
	display: grid; 
	grid-template-columns: 1fr 1fr; 
	gap: 1rem; 
	margin-bottom: 1.5rem;
}
/* Hall of Fame Progress */
.cab-hall-progress {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	width: 100%;
}
.cab-hall-progress__left {
	flex-grow: 1;
	padding-right: 2rem;
}
.cab-hall-progress .cab-card__label {
	margin-bottom: 2rem;
	opacity: 0.8;
}
.cab-hall-progress__title {
	font-size: clamp(2.5rem, 4vw, 3rem);
	margin-bottom: 1.5rem;
	line-height: 1.1;
	color: var(--black);
}
.cab-hall-progress__percent {
	font-size: clamp(4rem, 8vw, 7rem);
	line-height: 0.75;
	letter-spacing: -0.05em;
	color: var(--black);
	padding-bottom: 0.25rem;
}
/* Red Progress Bar for Hall of Fame */
.cab-progress--red {
	background: rgba(20,20,18,0.1);
}
.cab-progress--red .cab-progress__fill {
	background: var(--red);
}

/* ==========================================================================
   AUTH COMPONENT (Brutalist)
   ========================================================================== */
.cab-auth {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50vh;
	padding: 2.5rem 1rem;
}
.cab-auth__card {
	width: 100%;
	max-width: 640px;
	background: #ffffff;
	border: 1px solid #eaeaea;
	border-radius: 1.88rem;
	padding: 3rem 2.5rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
	box-sizing: border-box;
}
.cab-auth__logo {
	margin-bottom: 2rem;
}
.cab-auth__title {
	font-size: 2rem;
	margin-bottom: 0.75rem;
	text-transform: uppercase;
	line-height: 1;
}
.cab-auth__subtitle {
	font-size: 0.88rem;
	opacity: 0.7;
	margin-bottom: 2.5rem;
	line-height: 1.4;
}
.cab-code-input {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
}
.cab-code-input__digit {
	flex: 1;
	max-width: 3.5rem;
	aspect-ratio: 4 / 5;
	height: auto;
	border: 1px solid #eaeaea;
	border-radius: 0.75rem;
	background: #ffffff;
	font-size: 1.5rem;
	text-align: center;
	font-family: var(--cab-font-mono), monospace;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	outline: none;
	color: var(--black);
	padding: 0;
	box-sizing: border-box;
}
.cab-code-input__digit:focus {
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(218, 53, 44, 0.1);
}

/* OAuth divider */
.cab-auth__divider {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 1.5rem 0 1.25rem;
	color: #888;
	font-size: 0.8125rem;
}
.cab-auth__divider::before,
.cab-auth__divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #d0d0d0;
}

/* OAuth buttons */
.cab-auth__oauth {
	display: flex;
	gap: 0.625rem;
}
.cab-auth__oauth-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 3.13rem;
	border: 1px solid #eaeaea;
	border-radius: 3.13rem;
	text-decoration: none;
	color: var(--black);
	font-weight: 500;
	transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	width: 48%;
	box-sizing: border-box;
	background: #ffffff;
}
.cab-auth__oauth-btn:hover {
	background: #f9f9f9;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}
.cab-auth__oauth-btn--vk:hover  { background: #0077FF; border-color: #0077FF; color: #fff; }
.cab-auth__oauth-btn--ya:hover  { background: #FC3F1D; border-color: #FC3F1D; color: #fff; }

/* ==========================================================================
   UTILITY & COMPONENT CLASSES (Refactored from inline styles)
   ========================================================================== */

/* Typography */
.cab-section-title {
	font-size: 1.25rem;
	font-weight: 500;
	text-transform: uppercase;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid #eaeaea;
	padding-bottom: 0.75rem;
	letter-spacing: 0.05em;
	margin-top: 0;
}
.cab-section-title--compact {
	border-bottom: none;
	padding-bottom: 0;
	margin-bottom: 0;
}

.cab-text-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.6;
}

/* Badges */
.cab-badge-outline {
	border: 1px solid var(--black);
	padding: 0.1rem 0.3rem;
	font-size: 0.63rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.cab-badge-ghost {
	opacity: 0.5;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Empty States */
.cab-empty-state {
	padding: 3rem 0;
	text-align: center;
	opacity: 0.5;
}
.cab-empty-state__icon {
	font-size: 2rem;
	margin-bottom: 1rem;
	filter: grayscale(100%);
}

/* Alerts */
.cab-alert--success {
	border-color: var(--cab-success);
	color: var(--cab-success);
}
.cab-alert--error {
	border-color: var(--cab-red);
	color: var(--cab-red);
}
.cab-alert__content {
	display: flex;
	align-items: center;
	gap: var(--cab-spacing-sm);
}

/* Forms (overrides) */
.cab-form-label {
	display: block;
	margin-bottom: 0.5rem;
}
.cab-input--disabled {
	color: #666;
	background: #f9f9f9;
	border-style: solid;
	cursor: not-allowed;
	opacity: 0.7;
	display: flex;
	align-items: center;
}

/* History Rows */
.cab-history-month-row {
	display: flex;
	justify-content: space-between;
	padding: 1rem 0;
	border-bottom: 1px dashed rgba(20,20,18,0.2);
}

/* Social Cards */
.cab-soc-card {
	border: 1px solid var(--black);
	padding: 1.25rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.cab-soc-icon {
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid var(--black);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 1.13rem;
}

/* Layout Utilities */
.cab-card--flush {
	padding: 0;
}
.cab-flex-start {
	justify-content: flex-start;
}
.cab-grid-full {
	grid-column: span 12;
}
.cab-grid-half {
	grid-column: span 6;
}

.kpi-delta    { font-size: 12px; margin-left: 6px; font-weight: 600; vertical-align: middle; }
.delta-pos    { color: #22c55e; }
.delta-neg    { color: #ef4444; }

/* Воронка конверсии (RFM-аналитика) */
.funnel-row   { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.funnel-step  { text-align: center; background: #f5f5f5; border-radius: 8px; padding: 16px 24px; min-width: 120px; }
.funnel-n     { font-size: 28px; font-weight: 700; color: #1a1a1a; }
.funnel-label { font-size: 13px; color: #666; margin-top: 4px; }
.funnel-pct   { font-size: 13px; color: #c00; font-weight: 600; margin-top: 4px; }
.funnel-arrow { font-size: 22px; color: #ccc; }
.funnel-note  { font-size: 12px; color: #999; margin-top: 4px; }

/* ============================================
   Модалка (общий компонент)
   ============================================ */
.cab-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.cab-modal-overlay.is-open {
    display: flex;
}

.cab-modal {
    background: #ffffff;
    border-radius: 1.88rem;
    padding: 1.5rem;
    max-width: 540px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cab-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cab-modal__title {
    font-family: 'TT Fors', -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: #141412;
    margin: 0;
}

.cab-modal__close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b6b6b;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.cab-modal__close:hover {
    background: #eaeaea;
    color: #141412;
}

.cab-modal__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    max-height: 60vh;
}

.cab-modal__body img {
    max-width: 100%;
    display: block;
}

.cab-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.cab-btn--ghost {
    background: transparent;
    color: #141412;
    border: 1px solid #eaeaea;
}

.cab-btn--ghost:hover {
    background: #eaeaea;
    color: #141412;
}

/* ============================================
   Greeting-avatar (dashboard)
   ============================================ */
.cab-greeting-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #eaeaea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    vertical-align: middle;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.cab-greeting-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cab-greeting-avatar--empty {
    background: #eaeaea;
    color: #141412;
    font-family: 'TT Fors', -apple-system, sans-serif;
    font-size: 1.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .cab-greeting-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
}

.cab-avatar {
    position: relative;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
}

.cab-avatar__photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    position: relative;
    outline: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cab-avatar__photo:hover,
.cab-avatar__photo:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.cab-avatar__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cab-avatar__photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaeaea;
    color: #141412;
    font-family: 'TT Fors', -apple-system, sans-serif;
    font-size: 2.25rem;
    font-weight: 500;
    text-transform: uppercase;
}

.cab-avatar__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 18, 0.55);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
    border-radius: 50%;
}

.cab-avatar__overlay span {
	font-size: .75rem;
}

.cab-avatar__photo:hover .cab-avatar__overlay,
.cab-avatar__photo:focus-visible .cab-avatar__overlay,
.cab-avatar__photo.is-loading .cab-avatar__overlay {
    opacity: 1;
}

.cab-avatar__spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cab-spin 0.9s linear infinite;
}

.cab-avatar__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 640px) {
    .cab-avatar,
    .cab-avatar__photo {
        width: 72px;
        height: 72px;
    }
    .cab-avatar__photo--empty {
        font-size: 2rem;
    }
}

/* ============================================
   Профиль-hero: cover + avatar + identity
   ============================================ */
.cab-profile-hero {
    position: relative;
    margin-bottom: 2rem;
}

.cab-profile-hero__cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 5;
    min-height: 140px;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid #eaeaea;
    background: #faf7f2;
}

.cab-profile-hero__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cab-profile-hero__cover--empty {
    background:
        radial-gradient(circle, rgba(20, 20, 18, 0.10) 1.2px, transparent 1.2px) 0 0 / 16px 16px,
        linear-gradient(135deg, #faf7f2 0%, #f3eee5 100%);
}

.cab-profile-hero__cover-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.cab-profile-hero__cover-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.4rem;
    padding: 0 1rem;
    border-radius: 3.13rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #eaeaea;
    color: #141412;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.15s ease, transform 0.15s ease;
}

.cab-profile-hero__cover-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.cab-profile-hero__cover-btn-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.cab-profile-hero__cover-remove {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #eaeaea;
    color: #141412;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cab-profile-hero__cover-remove:hover {
    background: #DA352C;
    color: #ffffff;
    border-color: #DA352C;
}

.cab-profile-hero__cover-remove[hidden] {
    display: none !important;
}

.cab-profile-hero__cover-spinner {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(20, 20, 18, 0.15);
    border-top-color: #141412;
    border-radius: 50%;
    animation: cab-spin 0.9s linear infinite;
    z-index: 3;
}

.cab-profile-hero__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.cab-profile-hero__body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    margin-top: -48px;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.cab-profile-hero__info {
    min-width: 0;
    padding-top: 56px;
}

.cab-profile-hero__name {
    font-family: 'TT Fors', -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: #141412;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cab-profile-hero__email {
    font-size: 0.85rem;
    color: #6b6b6b;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cab-profile-hero__actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 56px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cab-profile-hero__hint {
    margin-top: 0.75rem;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: #6b6b6b;
    letter-spacing: 0.02em;
}

/* Section divider */
.cab-section-divider {
    height: 1px;
    background: #eaeaea;
    margin: 1.75rem 0 1.5rem;
}

/* Mobile adjustments for hero */
@media (max-width: 720px) {
    .cab-profile-hero__body {
        grid-template-columns: auto 1fr;
        row-gap: 1rem;
    }
    .cab-profile-hero__actions {
        grid-column: 1 / -1;
        padding-top: 0;
        justify-content: flex-start;
    }
    .cab-profile-hero__info {
        padding-top: 56px;
    }
    .cab-profile-hero__cover-btn-text {
        display: none; /* keep icon-only on mobile to save space */
    }
    .cab-profile-hero__cover-btn {
        padding: 0 0.85rem;
    }
}

@media (max-width: 480px) {
    .cab-profile-hero__cover {
        aspect-ratio: 16 / 6;
    }
}

/* ============================================
   Toast — мягкий белый тост с тенью
   ============================================ */
.cab-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(0.5rem);
    background: #ffffff;
    color: #141412;
    border: 1px solid #eaeaea;
    padding: 0.85rem 1.25rem;
    border-radius: 3.13rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cab-toast.is-visible {
    display: inline-flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cab-toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    font-size: 0.78rem;
    line-height: 1;
    flex-shrink: 0;
}

.cab-toast--success .cab-toast__icon {
    background: rgba(46, 160, 67, 0.14);
    color: #1f8a3a;
}

.cab-toast--error .cab-toast__icon {
    background: rgba(218, 53, 44, 0.14);
    color: #DA352C;
}

.cab-toast__text {
    color: #141412;
}

/* ============================================
   Inline-подсказка под полем ввода
   ============================================ */
.cab-form-hint {
    margin-top: 0.4rem;
    padding: 0 0.85rem;
    font-size: 0.78rem;
    line-height: 1.3;
    color: #6b6b6b;
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
}

.cab-form-hint--error {
    color: #DA352C;
}

.cab-form-hint[hidden] {
    display: none;
}
