/* ===================================================================
   PROFILE.CSS — Личный кабинет (ЛК)
   Дизайн: тёмная шапка, карточки с glassmorphism, красные акценты
   =================================================================== */

/* ===== Переменные ===== */
:root {
    --lk-primary: #ea580c;
    --lk-primary-dark: #c2410c;
    --lk-primary-light: #fff7ed;
    --lk-state-fixed: #2563eb;
    --lk-state-waiting: #64748b;
    --lk-state-action: #ea580c;
    --lk-state-complete: #16a34a;
    --lk-state-problem: #dc2626;
    --lk-state-ai: #7c3aed;
    --lk-bg: #f5f6fa;
    --lk-card-bg: #ffffff;
    --lk-text: #1a1a2e;
    --lk-text-secondary: #6b7280;
    --lk-border: #e5e7eb;
    --lk-radius: 14px;
    --lk-radius-sm: 8px;
    --lk-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --lk-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
    --lk-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --lk-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lk-sync-status {
    margin: 0 0 12px;
}

.lk-sync-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border: 1px solid var(--lk-border);
    border-radius: var(--lk-radius-sm);
    background: #fff;
    color: var(--lk-text-secondary);
    font-size: 0.875rem;
}

.lk-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex: 0 0 auto;
}

.lk-sync-dot.is-online {
    background: #16a34a;
}

.lk-sync-dot.is-offline {
    background: #dc2626;
}

.lk-sync-text {
    flex: 1 1 auto;
    min-width: 0;
}

.lk-sync-conflicts {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.lk-sync-conflict {
    border: 1px solid #fecaca;
    background: #fff7f7;
    border-radius: var(--lk-radius-sm);
    padding: 12px;
}

.lk-sync-conflict-title {
    font-weight: 700;
    color: #b91c1c;
    margin-bottom: 8px;
}

.lk-sync-conflict-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.lk-sync-conflict-grid small {
    color: var(--lk-text-secondary);
}

.lk-sync-conflict-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lk-cabinet-dump-hint,
.lk-offline-pack-hint {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--lk-text-secondary);
}

.lk-leva-slot:empty {
    display: none;
    margin: 0;
}

.lk-leva-slot .leva-inline-container {
    margin-bottom: 0;
}

.leva-profile-pulse-target {
    border-color: var(--lk-primary) !important;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.48) !important;
    animation: levaProfilePulse 1.05s ease-out infinite;
}

@keyframes levaProfilePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.48);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(220, 38, 38, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* ===== Обёртка ===== */
.lk-wrap {
    font-family: var(--lk-font);
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    color: var(--lk-text);
}

/*
 * Правый gutter ~1см под палец: скролл страницы/диалога/таблиц без захвата Лёвой.
 * Важно: правило ПОСЛЕ shorthand padding выше — иначе padding-right затирается.
 */
@media (max-width: 1024px) {
    .lk-wrap {
        padding-left: 12px;
        padding-right: 44px;
    }

    .lk-leva-slot .leva-inline-container {
        max-height: min(62vh, 560px);
    }

    .lk-header {
        padding-right: 24px;
    }
}

/* ===== Блок для гостей ===== */
.lk-guest-block {
    text-align: center;
    padding: 60px 24px;
    background: var(--lk-card-bg);
    border-radius: var(--lk-radius);
    box-shadow: var(--lk-shadow);
}

.lk-guest-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: lkPulse 2s infinite;
}

@keyframes lkPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.lk-guest-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--lk-text);
}

.lk-guest-desc {
    color: var(--lk-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto 28px;
}

.lk-guest-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Шапка профиля ===== */
.lk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: var(--lk-radius);
    box-shadow: 0 8px 32px rgba(26, 26, 46, 0.3);
    margin-bottom: 24px;
    color: #fff;
}

.lk-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lk-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lk-primary) 0%, #ef4444 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    overflow: hidden;
    position: relative;
}

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

.lk-avatar.has-image .lk-avatar-letter {
    display: none;
}

.lk-avatar-lg {
    width: 176px;
    height: 176px;
}

.lk-avatar-letter {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.lk-avatar-lg .lk-avatar-letter {
    font-size: 4rem;
}

.lk-avatar-settings {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.lk-avatar-settings-copy {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 10px;
}

.lk-avatar-status {
    margin: 4px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #6b7280;
}

.lk-avatar-status.is-error {
    color: #b91c1c;
}

.lk-avatar-status.is-ok {
    color: #047857;
}

.lk-modal-avatar {
    max-width: 440px;
}

.lk-avatar-crop-hint {
    margin: 0 0 12px;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
}

.lk-avatar-crop-stage {
    position: relative;
    width: 320px;
    max-width: 100%;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: #111827;
    touch-action: none;
    cursor: grab;
    user-select: none;
}

.lk-avatar-crop-stage.is-dragging {
    cursor: grabbing;
}

.lk-avatar-crop-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.lk-avatar-crop-mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 16px;
    box-shadow: inset 0 0 0 9999px rgba(17, 24, 39, 0.45);
    background:
        radial-gradient(circle closest-side, transparent 69%, rgba(17, 24, 39, 0.55) 70%);
}

.lk-avatar-crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    font-size: 0.88rem;
    color: #374151;
}

.lk-avatar-crop-zoom-row input[type="range"] {
    flex: 1;
}

.lk-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 640px) {
    .lk-avatar-settings {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .lk-avatar-actions {
        justify-content: center;
    }
}

.lk-header-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.lk-header-role {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lk-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lk-attention,
.lk-chat {
    position: relative;
    z-index: 40;
}

.lk-attention-button {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: transform var(--lk-transition), background var(--lk-transition), border-color var(--lk-transition);
}

.lk-attention-button:hover,
.lk-attention-button:focus-visible,
.lk-attention.is-open .lk-attention-button,
.lk-chat.is-open .lk-attention-button {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.lk-attention-button svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lk-attention-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    min-width: 23px;
    height: 23px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1;
}

.lk-chat-badge {
    background: #2563eb;
}

.lk-attention-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(390px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #dce3ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    color: #172033;
}

.lk-attention-panel[hidden] {
    display: none;
}

.lk-attention-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px;
    border-bottom: 1px solid #e8edf3;
    background: #f8fafc;
}

.lk-attention-head strong,
.lk-attention-head span {
    display: block;
}

.lk-attention-head strong {
    color: #172033;
    font-size: 0.98rem;
}

.lk-attention-head div > span {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.76rem;
}

.lk-attention-total {
    display: inline-flex !important;
    min-width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 900;
}

.lk-attention-list {
    max-height: min(460px, 62vh);
    overflow-y: auto;
}

.lk-attention-item {
    display: grid;
    width: 100%;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 11px;
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.lk-attention-item:hover,
.lk-attention-item:focus-visible {
    background: #f8fafc;
}

.lk-attention-item strong,
.lk-attention-item small {
    display: block;
}

.lk-attention-item strong {
    color: #172033;
    font-size: 0.84rem;
    line-height: 1.35;
}

.lk-attention-item small {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.4;
}

.lk-attention-dot {
    width: 9px;
    height: 9px;
    margin-top: 4px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 0 4px #dbeafe;
}

.lk-attention-item.is-warning .lk-attention-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 4px #fef3c7;
}

.lk-attention-item.is-danger .lk-attention-dot {
    background: #dc2626;
    box-shadow: 0 0 0 4px #fee2e2;
}

.lk-attention-item.is-message .lk-attention-dot {
    width: auto;
    height: auto;
    margin-top: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
    line-height: 1.2;
}

.lk-attention-empty {
    padding: 28px 20px;
    text-align: center;
}

.lk-attention-empty strong,
.lk-attention-empty span {
    display: block;
}

.lk-attention-empty strong {
    color: #166534;
    font-size: 0.94rem;
}

.lk-attention-empty span {
    margin-top: 5px;
    color: #64748b;
    font-size: 0.78rem;
}

.lk-rating-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lk-rating-stars {
    font-size: 0.9rem;
}

.lk-rating-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fbbf24;
}

.lk-funds-badge {
    display: grid;
    gap: 2px;
    min-width: 132px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.lk-funds-label {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.15;
}

.lk-funds-value {
    color: #fff;
    font-size: 0.84rem;
    line-height: 1.15;
}

.lk-funds-badge.is-unavailable {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(100, 116, 139, 0.24);
    color: #cbd5e1;
}

.lk-funds-badge.is-unavailable .lk-funds-value {
    color: #cbd5e1;
    font-weight: 600;
}

/* ===== Вкладки ===== */
.lk-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--lk-border);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lk-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--lk-text-secondary);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all var(--lk-transition);
    white-space: nowrap;
    font-family: var(--lk-font);
    margin-bottom: -2px;
}

.lk-tab:hover {
    color: var(--lk-text);
    background: rgba(0, 0, 0, 0.02);
}

.lk-tab.active {
    color: var(--lk-primary);
    border-bottom-color: var(--lk-primary);
}

.lk-tab-icon {
    font-size: 1rem;
}

.lk-tab-count {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--lk-primary);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
}

/* ===== Панели контента ===== */
.lk-panel {
    display: none;
    animation: lkFadeIn 0.3s ease;
}

.lk-panel.active {
    display: block;
}

@keyframes lkFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Рабочий центр объектов ===== */
.lk-workspace-overview {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid #dbeafe;
    border-radius: var(--lk-radius);
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: var(--lk-shadow);
}

.lk-worker-welcome {
    display: none;
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: var(--lk-radius);
    background: #fff;
    box-shadow: var(--lk-shadow);
}

.lk-worker-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--lk-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lk-worker-welcome h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.lk-worker-welcome p {
    margin: 0;
    color: var(--lk-text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.lk-worker-count {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    margin-top: 14px;
    color: var(--lk-text-secondary);
    font-size: 0.8rem;
}

.lk-worker-count strong {
    color: var(--lk-text);
    font-size: 1.45rem;
    line-height: 1;
}

#lk-app.is-worker .lk-worker-welcome {
    display: block;
}

#lk-app.is-worker .lk-workspace-overview,
#lk-app.is-worker .lk-analytics,
#lk-app.is-worker .lk-telegram-banner,
#lk-app.is-worker .lk-projects-toolbar {
    display: none;
}

#lk-app.is-worker .lk-projects-list {
    margin-top: 0;
}

#lk-app.is-worker .lk-project-card-main {
    padding: 17px 18px;
}

#lk-app.is-worker .lk-project-meta,
#lk-app.is-worker .lk-project-flags,
#lk-app.is-worker .lk-project-card-badges,
#lk-app.is-worker .lk-project-updated,
#lk-app.is-worker .lk-state-badge {
    display: none;
}

#lk-app.is-worker .lk-project-next {
    color: var(--lk-primary);
    font-weight: 600;
}

#lk-app.is-worker .lk-project-card-actions {
    display: none;
}

.lk-workspace-copy {
    max-width: 720px;
}

.lk-workspace-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--lk-primary);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lk-workspace-copy h2 {
    margin: 0 0 8px;
    color: var(--lk-text);
    font-size: 1.35rem;
    line-height: 1.2;
}

.lk-workspace-copy p {
    margin: 0;
    color: var(--lk-text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
}

.lk-workspace-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
    align-items: center;
    justify-content: space-between;
}

.lk-share-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.lk-invite-wrap {
    position: relative;
}

.lk-invite-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    padding: 6px;
    z-index: 30;
}

.lk-invite-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #1f2937;
    font: inherit;
}

.lk-invite-menu button:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.lk-share-sheet {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.lk-share-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.lk-share-sheet__panel {
    position: relative;
    width: min(440px, 100%);
    margin: 0;
    padding: 18px 16px 20px;
    border-radius: 18px 18px 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
}

@media (min-width: 640px) {
    .lk-share-sheet {
        align-items: center;
    }
    .lk-share-sheet__panel {
        border-radius: 16px;
        margin: 16px;
    }
}

.lk-share-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.lk-share-sheet__head h3 {
    margin: 0;
    font-size: 1.1rem;
}

.lk-share-sheet__x {
    border: 0;
    background: #f3f4f6;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.lk-share-sheet__url {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.82rem;
    word-break: break-all;
}

.lk-share-sheet__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lk-share-sheet__btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.lk-share-sheet__btn:hover {
    border-color: #fecaca;
    background: #fff7f7;
}

.lk-share-sheet__btn[hidden] {
    display: none;
}

.lk-share-sheet__logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.lk-share-sheet__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f3f4f6;
    font-size: 0.75rem;
    font-weight: 800;
}

.lk-bonus-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.lk-bonus-summary > div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
}

.lk-bonus-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.lk-bonus-hint {
    margin: 0 0 12px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
}

.lk-bonus-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lk-bonus-link-row .lk-input {
    flex: 1;
}

.lk-bonus-history {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.lk-bonus-history li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #374151;
}

@media (max-width: 720px) {
    .lk-analytics {
        padding: 16px;
    }

    .lk-analytics-head {
        flex-direction: column;
        gap: 8px;
    }

    .lk-analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lk-state-filter-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .lk-workspace-actions {
        justify-content: flex-start;
    }

    .lk-share-group {
        margin-left: 0;
        width: 100%;
    }

    .lk-bonus-summary {
        grid-template-columns: 1fr;
    }

    .lk-bonus-link-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.lk-workspace-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.lk-workspace-metrics > div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--lk-border);
    border-radius: var(--lk-radius-sm);
    background: #fff;
}

.lk-workspace-metrics span {
    color: var(--lk-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

.lk-workspace-metrics strong {
    color: var(--lk-text);
    font-size: 1.2rem;
    line-height: 1.2;
}

.lk-analytics {
    margin: 0 0 22px;
    padding: 20px 22px;
    border: 1px solid var(--lk-border);
    border-radius: var(--lk-radius);
    background: var(--lk-card-bg);
    box-shadow: var(--lk-shadow);
}

.lk-analytics-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.lk-analytics-head h3 {
    margin: 0 0 5px;
    color: var(--lk-text);
    font-size: 1.05rem;
}

.lk-analytics-head p {
    margin: 0;
    color: var(--lk-text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
}

.lk-analytics-source {
    flex: 0 0 auto;
    color: var(--lk-text-secondary);
    font-size: 0.75rem;
}

.lk-analytics-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.lk-analytics-item {
    display: grid;
    gap: 4px;
    min-height: 92px;
    padding: 11px;
    border: 1px solid var(--lk-border);
    border-radius: var(--lk-radius-sm);
    background: #fff;
}

.lk-analytics-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-weight: 900;
}

.lk-analytics-item strong {
    color: var(--lk-text);
    font-size: 1.35rem;
    line-height: 1;
}

.lk-analytics-item > span:last-child {
    color: var(--lk-text-secondary);
    font-size: 0.72rem;
    line-height: 1.25;
}

.lk-analytics-item.is-action .lk-analytics-icon,
.lk-state-filter-btn[data-state-filter="action_required"].is-active { background: #ffedd5; color: var(--lk-state-action); }
.lk-analytics-item.is-waiting .lk-analytics-icon,
.lk-state-filter-btn[data-state-filter="waiting"].is-active { background: #f1f5f9; color: var(--lk-state-waiting); }
.lk-analytics-item.is-fixed .lk-analytics-icon,
.lk-state-filter-btn[data-state-filter="locked"].is-active { background: #dbeafe; color: var(--lk-state-fixed); }
.lk-analytics-item.is-complete .lk-analytics-icon,
.lk-state-filter-btn[data-state-filter="completed"].is-active { background: #dcfce7; color: var(--lk-state-complete); }
.lk-analytics-item.is-problem .lk-analytics-icon,
.lk-state-filter-btn[data-state-filter="problem"].is-active { background: #fee2e2; color: var(--lk-state-problem); }
.lk-analytics-item.is-ai .lk-analytics-icon,
.lk-state-filter-btn[data-state-filter="ai_draft"].is-active { background: #ede9fe; color: var(--lk-state-ai); }

.lk-analytics-progress {
    margin-top: 16px;
}

.lk-analytics-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--lk-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
}

.lk-analytics-progress-head strong { color: var(--lk-state-complete); }

.lk-analytics-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.lk-analytics-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--lk-state-complete);
    transition: width 0.35s ease;
}

.lk-telegram-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin: 0 0 22px;
    padding: 20px 56px 20px 22px;
    border: 1px solid #fecaca;
    border-radius: var(--lk-radius);
    background: linear-gradient(135deg, #fff7f7 0%, #fff 72%);
    box-shadow: var(--lk-shadow);
}

.lk-telegram-banner[hidden] {
    display: none;
}

.lk-telegram-banner h3 {
    margin: 3px 0 5px;
    color: var(--lk-text);
    font-size: 1.05rem;
}

.lk-telegram-banner p {
    margin: 0;
    color: var(--lk-text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.lk-telegram-kicker {
    color: var(--lk-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lk-telegram-banner-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.lk-telegram-banner-close:hover,
.lk-telegram-banner-close:focus-visible {
    background: #fee2e2;
    color: #991b1b;
}

.lk-telegram-account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fffafa;
}

.lk-telegram-account.is-connected {
    border-color: #86efac;
    background: #f0fdf4;
}

.lk-telegram-account.is-unavailable {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.lk-telegram-account-copy {
    min-width: 0;
}

.lk-telegram-account-title {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--lk-text);
}

.lk-telegram-account-copy p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.45;
}

.lk-telegram-status-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 0 0 4px #fee2e2;
}

.lk-telegram-status-dot.is-connected {
    background: #16a34a;
    box-shadow: 0 0 0 4px #dcfce7;
}

.lk-telegram-status-dot.is-unavailable {
    background: #94a3b8;
    box-shadow: 0 0 0 4px #e2e8f0;
}

/* ===== Сетка карточек ===== */
.lk-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.lk-cards-single {
    grid-template-columns: 1fr;
}

/* ===== Карточка ===== */
.lk-card {
    background: var(--lk-card-bg);
    border-radius: var(--lk-radius);
    box-shadow: var(--lk-shadow);
    border: 1px solid var(--lk-border);
    overflow: hidden;
    transition: box-shadow var(--lk-transition), transform var(--lk-transition);
}

.lk-card:hover {
    box-shadow: var(--lk-shadow-hover);
    transform: translateY(-2px);
}

.lk-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lk-border);
    background: linear-gradient(180deg, #fafbfc 0%, #f5f6f8 100%);
}

.lk-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--lk-text);
}

.lk-card-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--lk-transition);
}

.lk-card-edit-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.lk-card-body {
    padding: 20px;
}

/* ===== Поля профиля ===== */
.lk-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.lk-field-row:last-child {
    border-bottom: none;
}

.lk-field-label {
    font-size: 0.85rem;
    color: var(--lk-text-secondary);
    font-weight: 500;
}

.lk-field-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--lk-text);
}

/* ===== Статистика ===== */
.lk-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    text-align: center;
}

.lk-stat-item {
    padding: 12px 8px;
    border-radius: var(--lk-radius-sm);
    background: var(--lk-bg);
    transition: transform var(--lk-transition);
}

.lk-stat-item:hover {
    transform: scale(1.05);
}

.lk-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--lk-primary);
    line-height: 1.2;
}

.lk-stat-label {
    font-size: 0.72rem;
    color: var(--lk-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
    font-weight: 600;
}

.lk-role-edit-grid {
    display: grid;
    gap: 10px;
}

.lk-role-option {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.lk-role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lk-role-option-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.lk-role-option-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.35;
}

.lk-role-option:has(input:checked),
.lk-role-option.is-checked {
    border-color: rgba(220, 38, 38, 0.4);
    background: var(--lk-primary-light, #fef2f2);
}

.lk-role-option:has(input:checked) .lk-role-option-title,
.lk-role-option.is-checked .lk-role-option-title {
    color: var(--lk-primary, #dc2626);
}

/* ===== Специализации ===== */
.lk-specs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lk-specs-hint {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--lk-muted, #64748b);
    line-height: 1.4;
}

.lk-specs-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--lk-muted, #64748b);
}

.lk-specs-edit-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lk-spec-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, background .15s, color .15s;
}

.lk-spec-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lk-spec-option:has(input:checked),
.lk-spec-option.is-checked {
    background: var(--lk-primary-light, #fef2f2);
    color: var(--lk-primary, #dc2626);
    border-color: rgba(220, 38, 38, 0.35);
}

.lk-spec-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--lk-primary-light);
    color: var(--lk-primary);
    border: 1px solid rgba(220, 38, 38, 0.15);
}

/* ===== Классы качества ===== */
.lk-quality-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lk-quality-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lk-quality-badge.locked {
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
}

.lk-quality-badge.unlocked {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

/* ===== Кнопки ===== */
.lk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--lk-radius-sm);
    cursor: pointer;
    transition: all var(--lk-transition);
    text-decoration: none;
    font-family: var(--lk-font);
    line-height: 1.4;
}

.lk-btn-primary {
    background: linear-gradient(135deg, var(--lk-primary) 0%, var(--lk-primary-dark) 100%);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.lk-btn-primary:hover,
.lk-btn-primary:focus,
.lk-btn-primary:focus-visible,
.lk-btn-primary:active,
.lk-btn-primary:visited {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    outline: none;
}

.lk-btn-primary:focus-visible {
    box-shadow:
        0 6px 20px rgba(220, 38, 38, 0.4),
        0 0 0 3px rgba(220, 38, 38, 0.35);
}

.lk-btn-outline {
    background: transparent;
    color: var(--lk-primary);
    border: 2px solid var(--lk-primary);
}

.lk-btn-outline:hover {
    background: var(--lk-primary-light);
}

.lk-btn-ghost {
    background: transparent;
    color: var(--lk-text-secondary);
}

.lk-btn-ghost:hover {
    background: #f3f4f6;
    color: var(--lk-text);
}

.lk-btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
}

/* ===== Формы ===== */
.lk-form-group {
    margin-bottom: 16px;
}

.lk-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--lk-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lk-input,
.lk-select,
.lk-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: var(--lk-font);
    border: 2px solid var(--lk-border);
    border-radius: var(--lk-radius-sm);
    background: #fff;
    color: var(--lk-text);
    transition: border-color var(--lk-transition), box-shadow var(--lk-transition);
    box-sizing: border-box;
}

.lk-input:focus,
.lk-select:focus,
.lk-textarea:focus {
    outline: none;
    border-color: var(--lk-primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.lk-input:focus::placeholder,
.lk-textarea:focus::placeholder {
    color: transparent;
    opacity: 0;
}

.lk-form-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--lk-text-secondary);
}

.lk-textarea {
    resize: vertical;
    min-height: 80px;
}

.lk-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.lk-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lk-order-step {
    margin-bottom: 18px;
}

.lk-order-step:last-child {
    margin-bottom: 0;
}

.lk-order-step-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.lk-order-step-head > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lk-primary);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    flex-shrink: 0;
}

.lk-order-step-head strong,
.lk-order-step-head small {
    display: block;
}

.lk-order-step-head strong {
    color: var(--lk-text);
    font-size: 0.95rem;
}

.lk-order-step-head small {
    margin-top: 3px;
    color: var(--lk-text-secondary);
    font-size: 0.8rem;
    line-height: 1.35;
}

.lk-order-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.lk-order-type {
    display: grid;
    gap: 4px;
    min-height: 92px;
    padding: 12px;
    border: 1px solid var(--lk-border);
    border-radius: var(--lk-radius-sm);
    background: #fff;
    color: var(--lk-text);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--lk-transition), box-shadow var(--lk-transition), transform var(--lk-transition);
}

.lk-order-type:hover,
.lk-order-type:focus-visible {
    border-color: var(--lk-primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
    outline: none;
}

.lk-order-type.active {
    border-color: var(--lk-primary);
    background: #fef2f2;
    box-shadow: 0 8px 18px rgba(220, 38, 38, 0.12);
}

.lk-order-type strong {
    font-size: 0.88rem;
    line-height: 1.25;
}

.lk-order-type span {
    color: var(--lk-text-secondary);
    font-size: 0.76rem;
    line-height: 1.3;
}

.lk-order-calculator {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: var(--lk-radius-sm);
    background: #eff6ff;
}

.lk-order-calculator div {
    min-width: 0;
}

.lk-order-calculator strong,
.lk-order-calculator span {
    display: block;
}

.lk-order-calculator strong {
    color: #1e3a8a;
    font-size: 0.88rem;
}

.lk-order-calculator span {
    margin-top: 3px;
    color: #475569;
    font-size: 0.78rem;
}

/* ===== Тоггл ===== */
.lk-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    position: relative;
}

.lk-toggle-row:last-child {
    border-bottom: none;
}

.lk-toggle-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--lk-text);
}

.lk-toggle {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.lk-toggle-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    transition: background var(--lk-transition);
    flex-shrink: 0;
}

.lk-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--lk-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lk-toggle:checked + .lk-toggle-slider {
    background: var(--lk-primary);
}

.lk-toggle:checked + .lk-toggle-slider::after {
    transform: translateX(20px);
}

/* ===== Список проектов ===== */
.lk-projects-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.lk-projects-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lk-state-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    order: -1;
}

.lk-state-filter-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--lk-border);
    border-radius: 999px;
    background: #fff;
    color: var(--lk-text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.1;
    transition: background var(--lk-transition), color var(--lk-transition), border-color var(--lk-transition);
}

.lk-state-filter-btn:hover,
.lk-state-filter-btn:focus-visible {
    border-color: #94a3b8;
    color: var(--lk-text);
}

.lk-state-filter-btn.is-active {
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.lk-state-filter-btn[data-state-filter="all"].is-active {
    background: #e2e8f0;
    color: #334155;
}

.lk-state-filter-btn:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.lk-role-switch {
    display: inline-flex;
    align-items: stretch;
    padding: 3px;
    border: 1px solid var(--lk-border);
    border-radius: 999px;
    background: #f8fafc;
    gap: 2px;
}

.lk-role-switch-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background var(--lk-transition), color var(--lk-transition);
    white-space: nowrap;
}

.lk-role-switch-btn:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.04);
}

.lk-role-switch-btn.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.lk-role-switch-btn:focus-visible {
    outline: 2px solid rgba(220, 38, 38, 0.35);
    outline-offset: 2px;
}

.lk-projects-list {
    display: grid;
    gap: 16px;
}

/* Карточка проекта */
.lk-project-card {
    background: var(--lk-card-bg);
    border-radius: var(--lk-radius);
    box-shadow: var(--lk-shadow);
    border: 1px solid var(--lk-border);
    overflow: hidden;
    transition: all var(--lk-transition);
}

.lk-project-card:hover {
    box-shadow: var(--lk-shadow-hover);
    transform: translateY(-2px);
    border-color: var(--lk-primary);
}

.lk-project-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    color: inherit;
    text-decoration: none;
}

.lk-project-card-main:focus-visible {
    outline: 3px solid rgba(220, 38, 38, 0.25);
    outline-offset: -3px;
}

.lk-project-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.lk-project-info {
    flex: 1;
    min-width: 0;
}

.lk-project-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--lk-text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lk-project-next {
    margin-bottom: 7px;
    color: var(--lk-primary);
    font-size: 0.86rem;
    font-weight: 800;
}

.lk-project-meta {
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--lk-text-secondary);
    flex-wrap: wrap;
}

.lk-project-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.lk-project-flag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 800;
    line-height: 1.2;
}

.lk-project-flag.is-muted {
    background: #f1f5f9;
    color: #475569;
}

.lk-project-flag.is-warning {
    background: #fff7ed;
    color: var(--lk-state-action);
}

.lk-project-flag.is-issue {
    background: #fff7ed;
    color: #9a3412;
}

.lk-project-flag.is-stop {
    background: #fef2f2;
    color: #991b1b;
}

.lk-project-flag.is-payment {
    background: #fff7ed;
    color: var(--lk-state-action);
}

.lk-project-right {
    flex-shrink: 0;
    text-align: right;
    min-width: 132px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.lk-project-card-badges {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 8px;
}

.lk-project-message-badge,
.lk-project-attention-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 42px;
    padding: 4px 8px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff1f2;
    color: #b91c1c;
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
}

.lk-project-message-badge {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
}

.lk-project-message-badge.is-empty {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}

.lk-project-attention-badge {
    border-color: #fed7aa;
    background: #fff7ed;
    color: var(--lk-state-action);
}

.lk-project-updated {
    margin-top: 4px;
    color: #9ca3af;
    font-size: 0.72rem;
}

.lk-project-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 22px 18px 86px;
}

.lk-project-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--lk-primary);
    border-radius: 11px;
    background: #fff;
    color: var(--lk-primary);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.lk-project-card-action.is-primary {
    background: var(--lk-primary);
    color: #fff;
    box-shadow: 0 7px 18px rgba(220, 38, 38, 0.2);
}

.lk-project-card-action:hover,
.lk-project-card-action:focus-visible {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.lk-project-card-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.lk-project-side-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.lk-project-side {
    display: flex;
    min-height: 92px;
    padding: 15px;
    border: 2px solid var(--lk-border);
    border-radius: 14px;
    background: #fff;
    color: var(--lk-text);
    text-align: left;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.lk-project-side:hover,
.lk-project-side:focus-visible {
    border-color: var(--lk-primary);
}

.lk-project-side.active {
    border-color: var(--lk-primary);
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.lk-project-side strong {
    font-size: 0.95rem;
}

.lk-project-side span {
    color: var(--lk-text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

/* Статус-бейджи */
.lk-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Этап объекта оставляем нейтральным: семантический цвет теперь у lk-state-badge. */
.lk-status-draft,
.lk-status-estimate,
.lk-status-approved,
.lk-status-in_progress,
.lk-status-done,
.lk-status-cancelled { background: #f1f5f9; color: #475569; }

.lk-state-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 7px;
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 800;
    line-height: 1.1;
}

.lk-state-ai_draft { color: var(--lk-state-ai); background: #f5f3ff; }
.lk-state-waiting { color: var(--lk-state-waiting); background: #f8fafc; }
.lk-state-action_required { color: var(--lk-state-action); background: #fff7ed; }
.lk-state-confirmed,
.lk-state-locked { color: var(--lk-state-fixed); background: #eff6ff; }
.lk-state-completed { color: var(--lk-state-complete); background: #f0fdf4; }
.lk-state-problem { color: var(--lk-state-problem); background: #fef2f2; }

/* ===== Пустое состояние ===== */
.lk-empty {
    text-align: center;
    padding: 48px 24px;
}

.lk-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.lk-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--lk-text);
    margin: 0 0 8px;
}

.lk-empty-desc {
    color: var(--lk-text-secondary);
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ===== Модалка ===== */
.lk-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: lkFadeIn 0.2s ease;
}

.lk-modal {
    background: var(--lk-card-bg);
    border-radius: var(--lk-radius);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    animation: lkSlideUp 0.3s ease;
}

@keyframes lkSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.lk-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--lk-border);
}

.lk-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.lk-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--lk-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--lk-transition);
    line-height: 1;
}

.lk-modal-close:hover {
    background: #f3f4f6;
}

.lk-modal-body {
    padding: 24px;
}

.lk-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--lk-border);
    background: #fafbfc;
    border-radius: 0 0 var(--lk-radius) var(--lk-radius);
}

/* ===== Toast ===== */
.lk-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--lk-font);
}

.lk-toast.visible {
    transform: translateX(-50%) translateY(0);
}

.lk-toast-icon {
    font-size: 1.1rem;
}

/* ===== Загрузка (shimmer) ===== */
.lk-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lkShimmer 1.5s infinite;
    border-radius: 6px;
    height: 16px;
    display: inline-block;
}

@keyframes lkShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    .lk-wrap {
        padding: 16px 44px 40px 12px;
    }

    .lk-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 24px 20px 20px;
        gap: 12px;
    }

    .lk-header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .lk-attention-panel {
        position: fixed;
        top: max(76px, env(safe-area-inset-top));
        right: 12px;
        left: 12px;
        width: auto;
    }

    .lk-header-name {
        font-size: 1.15rem;
    }

    .lk-cards-grid {
        grid-template-columns: 1fr;
    }

    .lk-workspace-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lk-workspace-overview {
        padding: 18px;
    }

    .lk-telegram-banner,
    .lk-telegram-account {
        align-items: stretch;
        flex-direction: column;
    }

    .lk-telegram-banner .lk-btn,
    .lk-telegram-account .lk-btn {
        width: 100%;
    }

    .lk-tab {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .lk-tab-icon {
        display: none;
    }

    .lk-project-card {
        width: 100%;
    }

    .lk-project-card-main {
        align-items: flex-start;
        padding: 16px;
        flex-wrap: wrap;
    }

    .lk-project-right {
        text-align: left;
        width: 100%;
        align-items: flex-start;
    }

    .lk-project-card-badges {
        justify-content: flex-start;
    }

    .lk-project-flags {
        width: 100%;
    }

    .lk-project-card-actions {
        padding: 0 16px 16px;
    }

    .lk-project-card-action {
        width: 100%;
    }

    .lk-projects-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .lk-projects-filters {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .lk-role-switch {
        width: 100%;
    }

    .lk-role-switch-btn {
        flex: 1 1 0;
        text-align: center;
        padding: 9px 8px;
        font-size: 0.72rem;
    }

    .lk-projects-filter .lk-select {
        width: 100%;
    }

    .lk-form-row-2 {
        grid-template-columns: 1fr;
    }

    .lk-order-type-grid {
        grid-template-columns: 1fr;
    }

    .lk-project-side-grid {
        grid-template-columns: 1fr;
    }

    .lk-order-calculator {
        align-items: stretch;
        flex-direction: column;
    }

    .lk-order-calculator .lk-btn {
        width: 100%;
    }

    .lk-modal {
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .lk-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .lk-guest-title {
        font-size: 1.4rem;
    }

    .lk-guest-actions {
        flex-direction: column;
    }

    .lk-guest-actions .lk-btn {
        width: 100%;
    }

    .lk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
