/* ============ БАЗОВЫЕ ПЕРЕМЕННЫЕ ============ */
:root {
    --bg-base: #eef2ff;
    --bg-grad-1: #e0e7ff;
    --bg-grad-2: #fce7f3;
    --bg-grad-3: #dbeafe;

    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-bg-strong: rgba(255, 255, 255, 0.78);
    --glass-bg-inner: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
    --glass-shadow-lg: 0 20px 60px rgba(99, 102, 241, 0.18);

    --text-primary: #1e1b4b;
    --text-secondary: #4c4775;
    --text-muted: #7a7494;
    --text-on-color: #ffffff;

    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --accent-light: #a5b4fc;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --purple: #8b5cf6;
    --pink: #ec4899;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --transition: 0.25s cubic-bezier(.4, 0, .2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(ellipse at top left, var(--bg-grad-1) 0%, transparent 50%),
        radial-gradient(ellipse at top right, var(--bg-grad-2) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, var(--bg-grad-3) 0%, transparent 60%),
        var(--bg-base);
    background-attachment: fixed;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
    color: inherit;
    font-size: 14px;
}

/* ============ ФОНОВАЯ ДЕКОРАЦИЯ ============ */
.bg-decoration {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: float 18s ease-in-out infinite;
}

.blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #a5b4fc, transparent);
    top: -150px; left: -150px;
}
.blob-2 {
    width: 450px; height: 450px;
    background: radial-gradient(circle, #f9a8d4, transparent);
    top: 30%; right: -100px;
    animation-delay: -4s;
}
.blob-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #93c5fd, transparent);
    bottom: -100px; left: 30%;
    animation-delay: -8s;
}
.blob-4 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #c4b5fd, transparent);
    top: 40%; left: 40%;
    animation-delay: -12s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ============ GLASS-СТИЛИ ============ */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

.glass-strong {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow-lg);
    border-radius: var(--radius-lg);
}

.glass-inner {
    background: var(--glass-bg-inner);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
}

/* ============ ОБЩИЙ ЛЭЙАУТ ============ */
.app-shell {
    display: flex;
    height: 100vh;
    padding: 14px;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 250px;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* ============ БРЕНД ============ */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 24px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 18px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    display: grid;
    place-items: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============ НАВИГАЦИЯ ============ */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    text-align: left;
    position: relative;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.12));
    color: var(--accent-dark);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
}

.user-switcher {
    padding: 10px 12px;
}

.us-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.us-select {
    width: 100%;
    background: transparent;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

/* ============ ВЕРХНЯЯ ПАНЕЛЬ ============ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    gap: 20px;
    flex-shrink: 0;
}

.topbar-left h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    padding: 9px 14px;
    width: 280px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box i {
    color: var(--text-muted);
    font-size: 13px;
}

.search-box input {
    flex: 1;
    background: transparent;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--accent-dark);
    transform: translateY(-1px);
}

.icon-btn .dot {
    position: absolute;
    top: 7px; right: 8px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--bg-base);
}

.current-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
}

.cu-info {
    line-height: 1.2;
}

.cu-name {
    font-weight: 600;
    font-size: 13px;
}

.cu-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============ АВАТАР ============ */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.xs { width: 16px; height: 16px; font-size: 7px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; }

.avatar-stack {
    display: flex;
}

.avatar-stack .avatar {
    border: 2px solid rgba(255, 255, 255, 0.85);
    margin-left: -8px;
}

.avatar-stack .avatar:first-child { margin-left: 0; }

/* ============ ОБЛАСТЬ КОНТЕНТА ============ */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.content-area::-webkit-scrollbar {
    width: 8px;
}
.content-area::-webkit-scrollbar-track {
    background: transparent;
}
.content-area::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 4px;
}
.content-area::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.45);
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* ============ КНОПКИ ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.btn-ghost {
    background: var(--glass-bg-inner);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.75);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover { transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============ ДАШБОРД ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

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

.card-large {
    padding: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--accent);
    font-size: 14px;
}

.event-list, .attention-list, .activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-item, .attention-item, .activity-item {
    padding: 12px;
    background: var(--glass-bg-inner);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition);
}

.event-item:hover, .attention-item:hover, .activity-item:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(2px);
}

.event-date {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.event-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 12px;
    line-height: 1.4;
}

.activity-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ КАЛЕНДАРЬ ============ */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 14px;
    height: calc(100vh - 130px);
}

.calendar-main {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-current-month {
    font-size: 17px;
    font-weight: 700;
    min-width: 160px;
    text-align: center;
    text-transform: capitalize;
}

.calendar-legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.lg {
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
}

.lg::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.lg-planned::before { background: #94a3b8; }
.lg-pending::before { background: #f59e0b; }
.lg-approved::before { background: #10b981; }
.lg-published::before { background: #6366f1; }
.lg-event::before { background: #ec4899; }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
    padding: 0 2px;
}

.calendar-weekdays > div {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.cal-day {
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    min-height: 80px;
}

.cal-day.other-month {
    opacity: 0.4;
}

.cal-day.today {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.cal-day.drop-target {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
    border-style: dashed;
}

.cal-day-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 2px 4px;
}

.cal-day.today .cal-day-number {
    color: var(--accent);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding: 0;
}

.cal-day-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    flex: 1;
}

.cal-day-items::-webkit-scrollbar { width: 0; }
.cal-day-items::-webkit-scrollbar-thumb { background: transparent; }

.cal-item {
    padding: 5px 7px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid transparent;
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
}

.cal-item:hover {
    transform: translateX(2px);
    filter: brightness(1.05);
}

.cal-item.dragging {
    opacity: 0.4;
}

/* Верхняя строка: время + категория */
.cal-item-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.cal-item-time {
    font-weight: 700;
    font-size: 10px;
    flex-shrink: 0;
    opacity: 0.85;
}

.cal-item-time-inline {
    font-weight: 700;
    font-size: 10px;
    opacity: 0.75;
}

.cal-item-cat {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.7;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* Статус задачи в мета-строке */
.cal-item-status {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}
.cal-status--backlog  { background: rgba(148,163,184,0.25); color: #475569; }
.cal-status--progress { background: rgba(245,158,11,0.2);   color: #b45309; }
.cal-status--review   { background: rgba(99,102,241,0.2);   color: #4338ca; }
.cal-status--done     { background: rgba(16,185,129,0.2);   color: #047857; }

/* Заголовок */
.cal-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 11px;
    min-width: 0;
}

/* Нижняя строка: отделение + готовность / прогресс + аватары */
.cal-item-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
    min-width: 0;
    overflow: hidden;
}

.cal-item-dept {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.65;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* Бейджи готовности */
.cal-readiness {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}
.cal-readiness--wait   { background: rgba(148,163,184,0.2); color: #64748b; }
.cal-readiness--review { background: rgba(245,158,11,0.2);  color: #b45309; }
.cal-readiness--ready  { background: rgba(16,185,129,0.2);  color: #047857; }
.cal-readiness--rework { background: rgba(239,68,68,0.15);  color: #b91c1c; }

/* Прогресс задачи */
.cal-item-progress-wrap {
    flex: 1;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
    min-width: 30px;
}
.cal-item-progress-bar {
    height: 100%;
    background: currentColor;
    border-radius: 2px;
    opacity: 0.7;
    transition: width 0.3s;
}
.cal-item-progress-label {
    font-size: 9px;
    font-weight: 600;
    opacity: 0.7;
    white-space: nowrap;
}

/* Аватары исполнителей */
.cal-item-assignees {
    display: flex;
    margin-left: auto;
}
.cal-item-assignees .avatar.xs {
    margin-left: -3px;
    border: 1px solid white;
}
.cal-item-assignees .avatar.xs:first-child { margin-left: 0; }

.cal-item.planned {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.4);
}
.cal-item.pending_review {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.4);
}
.cal-item.approved {
    background: rgba(16, 185, 129, 0.18);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.4);
}
.cal-item.published {
    background: rgba(99, 102, 241, 0.18);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.4);
}
.cal-item.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.35);
    text-decoration: line-through;
}
.cal-item.event {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(244, 114, 182, 0.18));
    color: #be185d;
    border-color: rgba(236, 72, 153, 0.4);
}
.cal-item--task.event .cal-item-title {
    font-weight: 600;
}

/* ============ ПАНЕЛЬ ИДЕЙ ============ */
.ideas-panel {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ideas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ideas-header h3 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ideas-header h3 i {
    color: var(--warning);
}

.ideas-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.idea-card {
    padding: 12px;
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    cursor: grab;
    transition: var(--transition);
    user-select: none;
    -webkit-user-select: none;
}

.idea-card:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.idea-card:active {
    cursor: grabbing;
}

/* Во время drag — отключаем pointer-events на содержимое чтобы не мешало */
.idea-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transition: none;
}

.idea-card.dragging .idea-card-inner {
    pointer-events: none;
}

.idea-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.3;
}

.idea-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
}

.tag.category {
    background: rgba(236, 72, 153, 0.12);
    color: #be185d;
}

/* ============ KANBAN / ЗАДАЧИ ============ */
.tasks-toolbar {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 14px;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 4px;
    background: var(--glass-bg-inner);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.tab {
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: white;
    color: var(--accent-dark);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.filter-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.select-mini {
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    height: calc(100vh - 200px);
}

.kanban-col {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.kc-title {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.kc-count {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-dark);
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.kanban-col-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
    min-height: 50px;
}

.kanban-col-body.drop-target {
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius);
}

.task-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    padding: 14px;
    cursor: grab;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
    position: relative;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.15);
}

.task-card.dragging { opacity: 0.5; }

.task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.task-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.35;
    flex: 1;
}

.task-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.task-priority.urgent { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.task-priority.high { background: #f59e0b; }
.task-priority.normal { background: #6366f1; }
.task-priority.low { background: #94a3b8; }

.task-description {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.task-meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.task-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-dark);
    font-weight: 600;
}

.task-tag.event { background: rgba(236, 72, 153, 0.12); color: #be185d; }
.task-tag.due { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.task-tag.overdue { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }

.task-checklist-progress {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============ ЧАТ ============ */
.chat-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px;
    height: calc(100vh - 130px);
}

.chat-channels {
    padding: 18px;
}

.chat-channels-header h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
    text-align: left;
}

.channel-item i { font-size: 11px; opacity: 0.6; }

.channel-item:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.channel-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(236,72,153,0.1));
    color: var(--accent-dark);
    font-weight: 600;
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-header {
    padding: 16px 22px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.chat-members {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.message-body {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}

.message-author {
    font-weight: 600;
    font-size: 13px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    word-wrap: break-word;
}

.message-text .mention {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-dark);
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

.chat-input-wrap {
    padding: 14px 22px 18px;
    position: relative;
}

.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 10px 10px 16px;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    padding: 6px 0;
    background: transparent;
}

.mention-popup {
    position: absolute;
    bottom: 100%;
    left: 22px;
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
    padding: 6px;
    min-width: 240px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.mention-item:hover, .mention-item.active {
    background: rgba(99, 102, 241, 0.1);
}

.mention-name {
    font-weight: 600;
    font-size: 13px;
}

.mention-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============ КОМАНДА ============ */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.team-card {
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--glass-shadow-lg);
}

.team-card .avatar {
    margin: 0 auto 12px;
}

.team-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.team-stats {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.ts-item .ts-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-dark);
}

.ts-item .ts-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============ МОДАЛКИ ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.45);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
}

.post-modal { max-width: 900px; }
.task-modal { max-width: 760px; }
.idea-modal { max-width: 480px; }

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============ ПОЛЯ ФОРМ ============ */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.field input[type="text"],
.field input[type="date"],
.field input[type="time"],
.field textarea,
.field select {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    transition: var(--transition);
    font-size: 14px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

.field textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

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

.assignee-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    min-height: 50px;
}

.assignee-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 50px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.assignee-chip.selected {
    background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(236,72,153,0.12));
    border-color: var(--accent);
    color: var(--accent-dark);
    font-weight: 600;
}

.assignee-chip:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* ============ ДЕТАЛИ ПОСТА ============ */
.post-modal-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.post-main {
    padding: 22px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.post-side {
    padding: 22px 20px;
    background: rgba(99, 102, 241, 0.04);
    border-left: 1px solid rgba(99, 102, 241, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
}

.status-planned { background: rgba(148,163,184,0.2); color: #475569; }
.status-pending_review { background: rgba(245,158,11,0.18); color: #b45309; }
.status-approved { background: rgba(16,185,129,0.18); color: #047857; }
.status-published { background: rgba(99,102,241,0.18); color: #4338ca; }
.status-rejected { background: rgba(239,68,68,0.18); color: #b91c1c; }
.status-idea { background: rgba(168,85,247,0.18); color: #7c3aed; }
.status-draft { background: rgba(148,163,184,0.2); color: #475569; }
.status-pending { background: rgba(245,158,11,0.18); color: #b45309; }
.status-empty { background: rgba(148,163,184,0.15); color: #64748b; }

.post-section {
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    padding: 16px;
}

.post-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.post-section-title {
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.post-section-title i { color: var(--accent); }

.post-text-editor {
    width: 100%;
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
    min-height: 140px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.post-text-display {
    background: white;
    border-radius: 10px;
    padding: 12px 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    min-height: 60px;
    font-size: 14px;
}

.media-upload-zone {
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
}

.media-upload-zone:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.04);
    color: var(--accent-dark);
}

.media-upload-zone i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.media-thumb {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 28px;
    cursor: pointer;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.media-thumb img, .media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment {
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    border-left: 3px solid var(--accent);
}

.comment.target-text { border-left-color: var(--info); }
.comment.target-media { border-left-color: var(--pink); }

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
    font-size: 12px;
}

.comment-target-tag {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.comment-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.approval-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.approval-actions .btn {
    flex: 1;
    justify-content: center;
}

.post-side-block {
    background: white;
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid rgba(99, 102, 241, 0.08);
}

.psb-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.psb-value {
    font-size: 14px;
    font-weight: 500;
}

.psb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.platform-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-dark);
    font-weight: 600;
}

/* ============ ДЕТАЛИ ЗАДАЧИ ============ */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: var(--transition);
}

.checklist-item:hover { background: rgba(99, 102, 241, 0.04); }

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checklist-item.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
    border-left: 4px solid var(--accent);
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast i {
    font-size: 18px;
}
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============ Адаптация ============ */
@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .calendar-layout { grid-template-columns: 1fr 280px; }
    .kanban-board { grid-template-columns: repeat(2, 1fr); height: auto; }
}

@media (max-width: 900px) {
    .sidebar { width: 70px; padding: 18px 8px; }
    .brand-text, .nav-item span, .sidebar-footer { display: none; }
    .nav-item { justify-content: center; }
    .calendar-layout, .chat-layout { grid-template-columns: 1fr; }
    .post-modal-grid { grid-template-columns: 1fr; }
}
.modal-overlay:not([hidden]) {
    display: grid;
    animation: fadeIn 0.2s ease;
}
.modal-overlay[hidden] {
    display: none !important;
}

/* ============ ПРОФИЛЬ СОТРУДНИКА ============ */
.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 18px;
    align-items: start;
}

.profile-card {
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.profile-avatar-wrap {
    position: relative;
    margin-bottom: 8px;
}

.profile-avatar-wrap img,
.profile-avatar-wrap .avatar {
    display: block;
}

.profile-avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.4);
    transition: var(--transition);
    border: 2px solid white;
}

.profile-avatar-upload:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99,102,241,0.5);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.profile-role {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-login {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--glass-bg-inner);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.5);
    margin-top: 4px;
}

.profile-login i { color: var(--accent); font-size: 12px; }

.profile-color-section {
    width: 100%;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(99,102,241,0.1);
}

.profile-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.profile-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.profile-form-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-form-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
}

.profile-form-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-form-header h3 i { color: var(--accent); }

.profile-form-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-form-body .field input {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    padding: 10px 14px;
    transition: var(--transition);
    font-size: 14px;
    width: 100%;
    font-family: inherit;
    color: var(--text-primary);
}

.profile-form-body .field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: white;
}

@media (max-width: 900px) {
    .profile-layout { grid-template-columns: 1fr; }
}

/* Кликабельный чип пользователя */
.current-user-chip:hover {
    background: rgba(255,255,255,0.65);
    box-shadow: 0 4px 14px rgba(99,102,241,0.15);
}
.user-switcher:hover {
    background: rgba(255,255,255,0.55) !important;
}

/* ============ DRAG & DROP КАЛЕНДАРЬ ============ */
.cal-item[draggable="true"] {
    cursor: grab;
}
.cal-item[draggable="true"]:active {
    cursor: grabbing;
}
.cal-item.dragging {
    opacity: 0.35;
    transform: scale(0.95);
}
.idea-card.dragging {
    opacity: 0.35;
    transform: scale(0.97);
}
.cal-day.drop-target {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: var(--accent) !important;
    border-style: dashed !important;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

/* Во время drag идеи — номер дня и список не перехватывают события,
   чтобы dragover доходил до .cal-day.
   При drag поста — не блокируем ничего, посты сами являются источником. */
body.is-dragging-idea .cal-day-number,
body.is-dragging-idea .cal-day-items {
    pointer-events: none;
}

/* ============ ПРОШЕДШИЕ ДНИ В КАЛЕНДАРЕ ============ */
.cal-day.past {
    background: rgba(0, 0, 0, 0.03);
    opacity: 0.6;
}

.cal-day.past .cal-day-number {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: rgba(122, 116, 148, 0.4);
}

.cal-day.past .cal-item {
    filter: grayscale(40%);
    opacity: 0.75;
}

/* ============ РАЗДЕЛИТЕЛЬ ПОСТОВ И СОБЫТИЙ В КАЛЕНДАРЕ ============ */
.cal-divider {
    height: 1px;
    background: rgba(236, 72, 153, 0.25);
    margin: 3px 2px;
    flex-shrink: 0;
}

/* ============ МОДАЛКА ПОСТА (НОВАЯ) ============ */
.post-modal {
    max-width: 1100px;
    width: 96vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

/* Шапка */
.pm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 14px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
    gap: 12px;
    flex-shrink: 0;
}
.pm-header-left  { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pm-header-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }

.pm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pm-status-actions { display:flex; gap:6px; flex-wrap:wrap; }

/* Согласование */
.pm-approval-wrap { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pm-approval-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.pm-approval-item.approved { background:rgba(16,185,129,0.15); color:#047857; }
.pm-approval-item.pending  { background:rgba(245,158,11,0.12);  color:#b45309; }

.pm-approve-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid rgba(99,102,241,0.25);
    background: rgba(99,102,241,0.06);
    color: var(--accent-dark);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.pm-approve-btn:hover { background:rgba(99,102,241,0.14); }
.pm-approve-btn.active { background:rgba(16,185,129,0.15); border-color:rgba(16,185,129,0.4); color:#047857; }

/* Тело — двухколоночный layout */
.pm-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Левая колонка */
.pm-left {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    padding: 0;
    border-right: 1px solid rgba(99,102,241,0.1);
}

.pm-left::-webkit-scrollbar { width: 6px; }
.pm-left::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 3px; }

/* Заголовок */
.pm-title-input {
    width: 100%;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    padding: 18px 24px 14px;
    border-bottom: 1px solid rgba(99,102,241,0.08);
    transition: var(--transition);
}
.pm-title-input::placeholder { color: var(--text-muted); font-weight: 400; }
.pm-title-input:focus { background: rgba(99,102,241,0.02); }

/* Секции */
.pm-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(99,102,241,0.08);
}

.pm-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: rgba(99,102,241,0.03);
    border-bottom: 1px solid rgba(99,102,241,0.06);
}
.pm-section-title i { color: var(--accent); font-size: 12px; }

/* Текстовый редактор */
.pm-editor {
    width: 100%;
    padding: 16px 24px;
    font-size: 14px;
    line-height: 1.75;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    min-height: 200px;
}
.pm-editor::placeholder { color: var(--text-muted); }

/* Медиа */
.pm-media-gallery {
    padding: 16px 24px;
    min-height: 80px;
}
.pm-upload-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border: 2px dashed rgba(99,102,241,0.2);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}
.pm-upload-hint i { font-size: 20px; color: var(--accent-light); }
.pm-upload-hint:hover { border-color: var(--accent); color: var(--accent-dark); }

.pm-masonry {
    columns: 3;
    column-gap: 8px;
}
.pm-masonry-item {
    break-inside: avoid;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.pm-masonry-item img {
    width: 100%;
    display: block;
    border-radius: 8px;
    transition: var(--transition);
}
.pm-masonry-item:hover img { filter: brightness(0.82); }
.pm-media-del {
    position: absolute;
    top: 5px; right: 5px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(239,68,68,0.88);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: var(--transition);
}
.pm-masonry-item:hover .pm-media-del { opacity: 1; }

/* Комментарии */
.pm-comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 24px;
    max-height: 280px;
    overflow-y: auto;
}
.pm-comment {
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius);
    padding: 10px 12px;
    border-left: 3px solid rgba(99,102,241,0.3);
}
.pm-comment-text  { border-left-color: #0ea5e9; }
.pm-comment-media { border-left-color: #ec4899; }
.pm-comment-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}
.pm-comment-meta { display:flex; align-items:center; gap:5px; flex:1; flex-wrap:wrap; }
.pm-comment-author { font-weight:600; font-size:12px; }
.pm-comment-role { font-size:10px; color:#b45309; background:rgba(245,158,11,0.12); padding:1px 6px; border-radius:6px; font-weight:600; }
.pm-comment-target { font-size:10px; color:var(--text-muted); }
.pm-comment-time { font-size:10px; color:var(--text-muted); margin-left:auto; white-space:nowrap; }
.pm-comment-del {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 11px; padding: 2px 4px;
    border-radius: 4px; transition: var(--transition);
}
.pm-comment-del:hover { color: var(--danger); }
.pm-comment-text-body { font-size:13px; line-height:1.5; color:var(--text-primary); }

.pm-comment-form {
    padding: 10px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.pm-comment-target-sel {
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    align-self: flex-start;
}
.pm-comment-input-wrap { display:flex; gap:8px; align-items:flex-end; }
.pm-comment-input {
    flex: 1;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    transition: var(--transition);
}
.pm-comment-input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(99,102,241,0.1); background:white; }

/* Правая колонка — параметры */
.pm-right {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    background: rgba(99,102,241,0.02);
}

.pm-right::-webkit-scrollbar { width: 4px; }
.pm-right::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.15); border-radius: 2px; }

.pm-param-block {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(99,102,241,0.08);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.pm-param-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pm-optional {
    font-size: 10px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    opacity: 0.7;
}

.pm-param-input {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 9px;
    padding: 8px 11px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
}
.pm-param-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: white;
}
.pm-param-input[rows] { resize: vertical; min-height: 60px; }

/* Платформы */
.pm-platforms { display:flex; flex-wrap:wrap; gap:6px; }
.platform-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.6);
    color: var(--text-secondary);
    user-select: none;
}
.platform-toggle i { font-size: 14px; color: var(--pcolor, #6366f1); }
.platform-toggle:hover { background: rgba(255,255,255,0.9); border-color: var(--pcolor, #6366f1); }
.platform-toggle.active {
    background: color-mix(in srgb, var(--pcolor, #6366f1) 12%, white);
    border-color: var(--pcolor, #6366f1);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--pcolor, #6366f1) 20%, transparent);
}

/* Автор */
.pm-author { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; }

/* Подвал */
.pm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 24px;
    border-top: 1px solid rgba(99,102,241,0.1);
    flex-shrink: 0;
}

/* Пустое состояние */
.pm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}
.pm-empty i { font-size: 24px; opacity: 0.3; }

/* Адаптив */
@media (max-width: 900px) {
    .pm-body { grid-template-columns: 1fr; }
    .pm-right { border-top: 1px solid rgba(99,102,241,0.1); border-right: none; }
    .post-modal { max-width: 100%; width: 100%; }
}

/* ============ НАСТРОЙКИ РУКОВОДИТЕЛЯ ============ */
.settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

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

.settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius);
    transition: var(--transition);
}
.settings-item:hover { background: rgba(255,255,255,0.65); }
.settings-item-color {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.settings-item-name { flex: 1; font-size: 14px; font-weight: 500; }
.settings-item-actions { display:flex; gap:4px; }
.settings-empty { font-size:13px; color:var(--text-muted); padding:16px; text-align:center; }

@media (max-width: 900px) {
    .settings-layout { grid-template-columns: 1fr; }
}


/* ============ МОДАЛКА ПОСТА — НОВЫЙ ДИЗАЙН ============ */
.pm-modal {
    max-width: 1100px;
    width: 96vw;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #f0f2f8;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(30,27,75,0.22);
    border: none;
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(.4,0,.2,1);
}
.pm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: white;
    border-bottom: 1px solid #e8eaf0;
    gap: 14px;
    flex-shrink: 0;
}
.pm-header-left { display:flex; align-items:center; gap:12px; min-width:0; flex:1; }
.pm-heading { font-size:18px; font-weight:700; color:#1e1b4b; letter-spacing:-0.3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pm-close-btn { width:32px; height:32px; border-radius:8px; background:#f0f2f8; border:none; cursor:pointer; display:grid; place-items:center; color:#7a7494; font-size:14px; transition:0.2s; flex-shrink:0; }
.pm-close-btn:hover { background:#e4e6f0; color:#1e1b4b; }
.pm-status-badge { display:inline-flex; align-items:center; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:700; letter-spacing:0.3px; text-transform:uppercase; white-space:nowrap; flex-shrink:0; }
.pm-badge-planned   { background:#e8eaf0; color:#4c4775; }
.pm-badge-pending   { background:#fff3cd; color:#b45309; }
.pm-badge-approved  { background:#d1fae5; color:#047857; }
.pm-badge-published { background:#dbeafe; color:#1d4ed8; }
.pm-badge-rejected  { background:#fee2e2; color:#b91c1c; }
.pm-body { display:grid; grid-template-columns:1fr 300px; flex:1; min-height:0; overflow:hidden; align-items:stretch; }
.pm-left { display:flex; flex-direction:column; gap:12px; overflow-y:auto; padding:16px; min-height:0; }
.pm-left::-webkit-scrollbar { width:5px; }
.pm-left::-webkit-scrollbar-thumb { background:#d0d3e8; border-radius:3px; }
.pm-card { background:white; border-radius:14px; overflow:visible; box-shadow:0 1px 4px rgba(30,27,75,0.06); flex-shrink:0; }
.pm-card-header { display:flex; align-items:center; gap:8px; padding:12px 16px 10px; border-bottom:1px solid #f0f2f8; border-radius:14px 14px 0 0; overflow:hidden; }
.pm-card-title { display:flex; align-items:center; gap:7px; font-size:14px; font-weight:600; color:#1e1b4b; }
.pm-card-title i { color:#6366f1; font-size:13px; }
.pm-card-actions { display:flex; gap:6px; margin-left:auto; }
.pm-inline-badge { display:inline-flex; align-items:center; padding:3px 8px; border-radius:5px; font-size:10px; font-weight:700; letter-spacing:0.3px; }
.pm-badge-ok      { background:#d1fae5; color:#047857; }
.pm-badge-pending { background:#fff3cd; color:#b45309; }
.pm-approve-action { display:inline-flex; align-items:center; gap:5px; padding:6px 14px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; border:none; font-family:inherit; transition:0.2s; }
.pm-approve-action.ok     { background:#d1fae5; color:#047857; }
.pm-approve-action.ok:hover { background:#a7f3d0; }
.pm-approve-action.reject { background:#fee2e2; color:#b91c1c; }
.pm-approve-action.reject:hover { background:#fecaca; }
.pm-card-author { padding: 6px 16px 0; }
.pm-media-author { padding: 6px 16px 0; }
.pm-author-chip { display:inline-flex; align-items:center; gap:7px; font-size:13px; color:#7a7494; }
.pm-title-input { width:100%; font-size:15px; font-weight:600; background:transparent; border:none; outline:none; color:#1e1b4b; font-family:inherit; padding:8px 16px 6px; border-bottom:1px solid #f0f2f8; }
.pm-title-input::placeholder { color:#b0adc8; font-weight:400; }
.pm-textarea { width:100%; padding:12px 16px; font-size:14px; line-height:1.7; font-family:inherit; color:#1e1b4b; background:transparent; border:none; outline:none; resize:vertical; min-height:140px; max-height:340px; overflow-y:auto; }
.pm-textarea::placeholder { color:#b0adc8; }
.pm-card-footer { padding:8px 16px 12px; display:flex; justify-content:flex-end; border-radius:0 0 14px 14px; overflow:hidden; }
.pm-submit-btn { display:inline-flex; align-items:center; gap:7px; padding:8px 16px; border-radius:9px; background:transparent; border:1.5px solid #d0d3e8; color:#4c4775; font-size:13px; font-weight:500; cursor:pointer; font-family:inherit; transition:0.2s; }
.pm-submit-btn:hover { border-color:#6366f1; color:#6366f1; background:#f0f0ff; }
.pm-submit-btn i { font-size:12px; }
.pm-media-grid { display:flex; flex-wrap:wrap; gap:8px; padding:12px 16px; min-height:80px; }
.pm-media-thumb { width:90px; height:90px; border-radius:10px; overflow:hidden; position:relative; flex-shrink:0; }
.pm-media-thumb img { width:100%; height:100%; object-fit:cover; }
.pm-media-del { position:absolute; top:4px; right:4px; width:20px; height:20px; border-radius:50%; background:rgba(239,68,68,0.85); color:white; border:none; cursor:pointer; font-size:10px; display:grid; place-items:center; opacity:0; transition:0.2s; }
.pm-media-thumb:hover .pm-media-del { opacity:1; }
.pm-add-media-btn { width:90px; height:90px; border-radius:10px; border:2px dashed #d0d3e8; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; cursor:pointer; color:#9896b8; font-size:11px; transition:0.2s; flex-shrink:0; }
.pm-add-media-btn i { font-size:18px; }
.pm-add-media-btn:hover { border-color:#6366f1; color:#6366f1; background:#f5f5ff; }
.pm-comments-list { display:flex; flex-direction:column; gap:8px; padding:10px 16px; max-height:220px; overflow-y:auto; }
.pm-no-comments { font-size:13px; color:#b0adc8; padding:8px 0; }
.pm-comment-item { display:flex; gap:9px; align-items:flex-start; }
.pm-comment-body { flex:1; min-width:0; }
.pm-comment-meta { display:flex; align-items:center; gap:6px; margin-bottom:3px; flex-wrap:wrap; }
.pm-comment-name  { font-size:13px; font-weight:600; color:#1e1b4b; }
.pm-comment-crown { color:#f59e0b; font-size:11px; }
.pm-comment-tag   { font-size:10px; background:#e8eaf0; color:#4c4775; padding:1px 6px; border-radius:4px; font-weight:600; }
.pm-comment-time  { font-size:11px; color:#b0adc8; margin-left:auto; }
.pm-comment-del   { background:none; border:none; cursor:pointer; color:#d0d3e8; font-size:11px; padding:0 2px; transition:0.2s; }
.pm-comment-del:hover { color:#ef4444; }
.pm-comment-text  { font-size:13px; color:#4c4775; line-height:1.5; }
.pm-comment-form { padding:10px 16px 14px; border-top:1px solid #f0f2f8; }
.pm-comment-input-row { display:flex; gap:8px; align-items:center; background:#f7f8fc; border:1px solid #e8eaf0; border-radius:10px; padding:6px 6px 6px 12px; }
.pm-comment-input { flex:1; background:transparent; border:none; outline:none; font-size:13px; font-family:inherit; color:#1e1b4b; }
.pm-comment-input::placeholder { color:#b0adc8; }
.pm-comment-target-sel { background:transparent; border:none; outline:none; font-size:12px; color:#9896b8; cursor:pointer; font-family:inherit; }
.pm-comment-send-btn { background:#6366f1; color:white; border:none; border-radius:8px; padding:7px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; transition:0.2s; white-space:nowrap; }
.pm-comment-send-btn:hover { background:#4f46e5; }
.pm-right { display:flex; flex-direction:column; overflow-y:auto; background:white; border-left:1px solid #e8eaf0; min-height:0; }
.pm-right::-webkit-scrollbar { width:4px; }
.pm-right::-webkit-scrollbar-thumb { background:#d0d3e8; border-radius:2px; }
.pm-right-field { padding:14px 18px; border-bottom:1px solid #f0f2f8; display:flex; flex-direction:column; gap:7px; }
.pm-right-label { font-size:10px; font-weight:700; letter-spacing:0.8px; color:#9896b8; text-transform:uppercase; }
.pm-right-input { background:#f7f8fc; border:1px solid #e8eaf0; border-radius:9px; padding:8px 11px; font-size:13px; font-family:inherit; color:#1e1b4b; transition:0.2s; width:100%; }
.pm-right-input:focus { outline:none; border-color:#6366f1; background:white; box-shadow:0 0 0 3px rgba(99,102,241,0.1); }
.pm-right-input[rows] { resize:vertical; min-height:60px; }
.pm-platforms-list { display:flex; flex-direction:column; gap:5px; }
.pm-platform-item { display:flex; align-items:center; gap:9px; padding:7px 10px; border-radius:8px; border:1.5px solid #e8eaf0; background:#f7f8fc; cursor:pointer; font-size:13px; color:#4c4775; transition:0.2s; user-select:none; }
.pm-platform-item i { font-size:15px; color:var(--pc,#6366f1); }
.pm-platform-item:hover { border-color:var(--pc,#6366f1); background:white; }
.pm-platform-item.active { border-color:var(--pc,#6366f1); background:white; color:#1e1b4b; font-weight:600; box-shadow:0 0 0 3px color-mix(in srgb,var(--pc,#6366f1) 12%,transparent); }
.pm-approval-list { display:flex; flex-direction:column; gap:6px; }
.pm-approval-row { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px; background:#f7f8fc; border:1px solid #e8eaf0; transition:0.2s; }
.pm-approval-row.apr-ok      { background:#f0fdf4; border-color:#bbf7d0; }
.pm-approval-row.apr-pending { background:#fffbeb; border-color:#fde68a; }
.pm-apr-icon { width:30px; height:30px; border-radius:8px; background:#e8eaf0; display:grid; place-items:center; font-size:13px; color:#6366f1; flex-shrink:0; }
.apr-ok .pm-apr-icon      { background:#d1fae5; color:#047857; }
.apr-pending .pm-apr-icon { background:#fef3c7; color:#b45309; }
.pm-apr-name   { font-size:13px; font-weight:600; color:#1e1b4b; }
.pm-apr-status { font-size:11px; color:#9896b8; margin-top:1px; }
.apr-ok .pm-apr-status      { color:#047857; }
.apr-pending .pm-apr-status { color:#b45309; }
.pm-right-buttons { padding:14px 18px; display:flex; flex-direction:column; gap:8px; margin-top:auto; }
.pm-btn-save { display:flex; align-items:center; justify-content:center; gap:8px; padding:12px; border-radius:11px; background:#6366f1; color:white; border:none; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; transition:0.2s; box-shadow:0 4px 14px rgba(99,102,241,0.3); }
.pm-btn-save:hover { background:#4f46e5; }
.pm-btn-delete { display:flex; align-items:center; justify-content:center; gap:8px; padding:10px; border-radius:11px; background:white; color:#ef4444; border:1.5px solid #fecaca; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; transition:0.2s; }
.pm-btn-delete:hover { background:#fee2e2; border-color:#ef4444; }
@media (max-width:900px) {
    .pm-body { grid-template-columns:1fr; }
    .pm-right { border-left:none; border-top:1px solid #e8eaf0; }
    .pm-modal { max-width:100%; width:100%; }
}

/* ============ КОМПАКТНЫЕ ПЛАТФОРМЫ В МОДАЛКЕ ПОСТА ============ */
.pm-platforms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}
.pm-plat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 7px;
    border: 1.5px solid #e8eaf0;
    background: #f7f8fc;
    cursor: pointer;
    font-size: 12px;
    color: #4c4775;
    transition: 0.15s;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}
.pm-plat-chip i { font-size: 13px; color: var(--pc, #6366f1); flex-shrink: 0; }
.pm-plat-chip span { overflow: hidden; text-overflow: ellipsis; }
.pm-plat-chip:hover { border-color: var(--pc, #6366f1); background: white; }
.pm-plat-chip.active {
    border-color: var(--pc, #6366f1);
    background: white;
    color: #1e1b4b;
    font-weight: 600;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pc, #6366f1) 15%, transparent);
}

/* ============ СТАТУС "ТРЕБУЕТ ДОРАБОТКИ" ============ */
.pm-badge-rework { background:#fee2e2; color:#b91c1c; }

.pm-approval-row.apr-rework { background:#fff1f2; border-color:#fecaca; }
.apr-rework .pm-apr-icon    { background:#fee2e2; color:#b91c1c; }
.apr-rework .pm-apr-status  { color:#b91c1c; font-weight:600; }

/* ============ КНОПКА ПУБЛИКАЦИИ В МОДАЛКЕ ПОСТА ============ */
.pm-btn-publish {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border-radius: 11px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s;
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
    width: 100%;
}
.pm-btn-publish:hover { background: linear-gradient(135deg, #059669, #047857); }

/* ============ ДОПОЛНИТЕЛЬНЫЕ СТАТУСЫ ПОСТОВ В КАЛЕНДАРЕ ============ */
/* Требует доработки — красный */
.cal-item.needs_rework {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.45);
}
.cal-item.needs_rework .cal-item-title::before {
    content: '⚠ ';
    font-size: 9px;
}

/* Полностью согласован (текст + медиа) — зелёный */
.cal-item.fully_approved {
    background: rgba(16, 185, 129, 0.18);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.45);
}
.cal-item.fully_approved .cal-item-title::before {
    content: '✓ ';
    font-size: 9px;
}

.lg-rework::before { background: #ef4444; }

/* ============ МЕДИА-СЕТКА В МОДАЛКЕ ПОСТА ============ */
.pm-media-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
}

.pm-media-grid-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    align-items: flex-start;
}

.pm-media-thumb {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.pm-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: 0.2s;
}

.pm-media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    opacity: 0;
    transition: 0.2s;
}

.pm-media-thumb:hover img         { filter: brightness(0.75); }
.pm-media-thumb:hover .pm-media-overlay { opacity: 1; background: rgba(0,0,0,0.25); }

.pm-media-del {
    position: absolute;
    top: 4px; right: 4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(239,68,68,0.88);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: 0.2s;
    z-index: 2;
}
.pm-media-thumb:hover .pm-media-del { opacity: 1; }

.pm-add-media-btn {
    width: 90px; height: 90px;
    border-radius: 10px;
    border: 2px dashed #d0d3e8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
    cursor: pointer;
    color: #9896b8;
    font-size: 11px;
    line-height: 1.3;
    transition: 0.2s;
    flex-shrink: 0;
}
.pm-add-media-btn i { font-size: 18px; }
.pm-add-media-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f5ff; }

.pm-add-media-btn--small { width: 90px; height: 90px; }
.pm-add-media-btn--small span { display: none; }

/* ============ ЛАЙТБОКС ============ */
#lightbox {
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(6px);
    z-index: 2000;
}

.lightbox-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 56px 70px 64px;
    box-sizing: border-box;
}

.lightbox-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    user-select: none;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 16px; right: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: 0.2s;
    z-index: 10;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: 0.2s;
    z-index: 10;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.28); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-footer {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
}

.lightbox-counter {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
}

.lightbox-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}
.lightbox-download-btn:hover { background: rgba(255,255,255,0.28); }

/* ============ МОДАЛКА ЗАДАЧИ — НОВЫЙ ДИЗАЙН ============ */
.tm-modal {
    max-width: 1100px;
    width: 96vw;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #f0f2f8;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(30,27,75,0.22);
    border: none;
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(.4,0,.2,1);
}
.tm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #e8eaf0;
    gap: 14px;
    flex-shrink: 0;
}
.tm-header-left { display:flex; align-items:center; gap:12px; min-width:0; flex:1; }
.tm-heading { font-size:18px; font-weight:700; color:#1e1b4b; letter-spacing:-0.3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tm-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Прогресс */
.tm-progress-wrap { padding: 10px 24px 0; flex-shrink: 0; background: white; border-bottom: 1px solid #e8eaf0; }
.tm-progress-label { display:flex; justify-content:space-between; font-size:12px; color:#4c4775; font-weight:600; margin-bottom:6px; }
.tm-progress-pct { font-weight:700; color:#6366f1; }
.tm-progress-bar-bg { height:6px; background:#e8eaf0; border-radius:3px; overflow:hidden; margin-bottom:12px; }
.tm-progress-bar { height:100%; border-radius:3px; transition:width 0.4s ease; }
/* Тело */
.tm-body { display:grid; grid-template-columns:1fr 300px; flex:1; min-height:0; overflow:hidden; align-items:stretch; }
.tm-left { display:flex; flex-direction:column; gap:12px; overflow-y:auto; padding:16px; min-height:0; }
.tm-left::-webkit-scrollbar { width:5px; }
.tm-left::-webkit-scrollbar-thumb { background:#d0d3e8; border-radius:3px; }
.tm-card { background:white; border-radius:14px; overflow:visible; box-shadow:0 1px 4px rgba(30,27,75,0.06); padding:16px; flex-shrink:0; }
.tm-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9896b8;
    margin-bottom: 12px;
}
.tm-section-title i { color: #6366f1; font-size: 12px; }
.tm-checklist-counter { margin-left:auto; font-size:12px; font-weight:700; color:#6366f1; }
.tm-title-input { width:100%; font-size:15px; font-weight:600; background:transparent; border:none; outline:none; color:#1e1b4b; font-family:inherit; padding:0 0 8px; border-bottom:1px solid #f0f2f8; margin-bottom:10px; }
.tm-title-input::placeholder { color:#b0adc8; font-weight:400; }
.tm-textarea { width:100%; padding:10px 0; font-size:14px; line-height:1.7; font-family:inherit; color:#1e1b4b; background:transparent; border:none; outline:none; resize:vertical; min-height:80px; max-height:280px; overflow-y:auto; }
.tm-textarea::placeholder { color:#b0adc8; }
/* Чеклист */
.tm-checklist-list { display:flex; flex-direction:column; gap:4px; margin-bottom:10px; }
.tm-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f7f8fc;
    border: 1px solid #e8eaf0;
    transition: 0.15s;
}
.tm-checklist-item.done { background: #f0fdf4; border-color: #bbf7d0; }
.tm-check-label { display:flex; align-items:center; cursor:pointer; flex-shrink:0; }
.tm-checkbox { display:none; }
.tm-check-custom {
    width: 18px; height: 18px;
    border-radius: 5px;
    border: 2px solid #d0d3e8;
    background: white;
    display: grid;
    place-items: center;
    transition: 0.15s;
    flex-shrink: 0;
}
.tm-checkbox:checked + .tm-check-custom {
    background: #6366f1;
    border-color: #6366f1;
}
.tm-checkbox:checked + .tm-check-custom::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid white;
    border-top: none; border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
    display: block;
}
.tm-item-text { flex:1; font-size:13px; color:#1e1b4b; outline:none; min-width:0; }
.tm-item-done { text-decoration:line-through; color:#9896b8; }
.tm-item-assignee { flex-shrink:0; }
.tm-item-del { background:none; border:none; cursor:pointer; color:#d0d3e8; font-size:11px; padding:2px 4px; transition:0.15s; flex-shrink:0; }
.tm-item-del:hover { color:#ef4444; }
.tm-checklist-add-row { display:flex; gap:6px; align-items:center; }
.tm-checklist-new-input { flex:1; background:#f7f8fc; border:1px solid #e8eaf0; border-radius:8px; padding:8px 12px; font-size:13px; font-family:inherit; color:#1e1b4b; outline:none; transition:0.15s; }
.tm-checklist-new-input:focus { border-color:#6366f1; background:white; }
/* Пикер исполнителя в чек-листе */
.tm-cl-assignee-wrap { position:relative; flex-shrink:0; }
.tm-cl-assignee-btn { width:34px; height:34px; border-radius:8px; background:#f7f8fc; border:1.5px dashed #d0d3e8; color:#9896b8; cursor:pointer; display:grid; place-items:center; font-size:13px; transition:0.15s; flex-shrink:0; }
.tm-cl-assignee-btn:hover { border-color:#6366f1; color:#6366f1; background:#f5f5ff; }
.tm-cl-assignee-picker { position:absolute; bottom:calc(100% + 6px); right:0; background:white; border:1px solid #e8eaf0; border-radius:12px; box-shadow:0 8px 24px rgba(30,27,75,0.14); padding:6px; min-width:200px; max-height:220px; overflow-y:auto; z-index:200; }
.tm-cl-assignee-picker .tm-picker-item { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:8px; cursor:pointer; transition:0.15s; }
.tm-cl-assignee-picker .tm-picker-item:hover { background:#f0f2f8; }
.tm-picker-item--none .tm-picker-no-avatar { width:28px; height:28px; border-radius:50%; background:#f0f2f8; display:grid; place-items:center; font-size:11px; color:#9896b8; flex-shrink:0; }
.tm-picker-empty { font-size:12px; color:#b0adc8; padding:8px 10px; }
.tm-cl-assignee-selected { display:flex; align-items:center; gap:5px; height:34px; padding:0 8px; background:#f0f2f8; border-radius:8px; font-size:12px; flex-shrink:0; }
.tm-cl-assignee-name { font-size:12px; font-weight:600; color:#1e1b4b; white-space:nowrap; max-width:80px; overflow:hidden; text-overflow:ellipsis; }
.tm-cl-assignee-clear { background:none; border:none; cursor:pointer; color:#9896b8; font-size:10px; padding:2px; transition:0.15s; flex-shrink:0; }
.tm-cl-assignee-clear:hover { color:#ef4444; }
.tm-checklist-add-btn { width:34px; height:34px; border-radius:8px; background:#6366f1; color:white; border:none; cursor:pointer; display:grid; place-items:center; font-size:14px; transition:0.15s; flex-shrink:0; }
.tm-checklist-add-btn:hover { background:#4f46e5; }
/* Чекбокс "Отобразить на календаре" */
.tm-calendar-checkbox-label { display:flex; align-items:center; gap:8px; margin-top:8px; cursor:pointer; user-select:none; }
.tm-calendar-checkbox { display:none; }
.tm-calendar-checkbox-custom { width:16px; height:16px; border-radius:4px; border:1.5px solid #d0d3e8; background:#f7f8fc; flex-shrink:0; display:grid; place-items:center; transition:0.15s; }
.tm-calendar-checkbox:checked + .tm-calendar-checkbox-custom { background:#6366f1; border-color:#6366f1; }
.tm-calendar-checkbox:checked + .tm-calendar-checkbox-custom::after { content:''; width:5px; height:8px; border:2px solid white; border-top:none; border-left:none; transform:rotate(45deg) translate(-1px,-1px); display:block; }
.tm-calendar-checkbox-text { font-size:12px; color:#6b7280; display:flex; align-items:center; gap:5px; }
.tm-calendar-checkbox-text i { color:#6366f1; }
.tm-event-time-wrap { margin-top:6px; }

/* ─── Согласование задачи ─────────────────────────────────────────────────── */
.tm-approval-status { margin-top:8px; display:flex; flex-direction:column; gap:6px; }

/* Бейдж статуса */
.tm-approval-badge {
    display:flex; align-items:center; gap:8px;
    padding:8px 10px; border-radius:10px;
    font-size:12px; font-weight:500;
    border:1px solid transparent;
}
.tm-approval-badge i { font-size:14px; flex-shrink:0; }
.tm-approval-info { display:flex; flex-direction:column; gap:1px; min-width:0; }
.tm-approval-label { font-weight:600; font-size:12px; }
.tm-approval-who   { font-size:11px; opacity:0.75; }
.tm-approval-comment { font-size:11px; opacity:0.8; font-style:italic; white-space:pre-wrap; word-break:break-word; }

.tm-approval--idle     { background:#f7f8fc; border-color:#e8eaf0; color:#6b7280; }
.tm-approval--pending  { background:rgba(245,158,11,0.12); border-color:rgba(245,158,11,0.35); color:#b45309; }
.tm-approval--approved { background:rgba(16,185,129,0.12); border-color:rgba(16,185,129,0.35); color:#047857; }
.tm-approval--rejected { background:rgba(239,68,68,0.10); border-color:rgba(239,68,68,0.30); color:#b91c1c; }

/* Кнопки действий */
.tm-approval-actions { display:flex; gap:6px; }
.tm-approval-btn {
    flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
    padding:7px 10px; border-radius:8px; font-size:12px; font-weight:600;
    cursor:pointer; border:none; font-family:inherit; transition:0.15s;
}
.tm-approval-btn--submit {
    background:rgba(99,102,241,0.1); color:#6366f1; border:1.5px dashed #a5b4fc;
    width:100%;
}
.tm-approval-btn--submit:hover { background:rgba(99,102,241,0.18); border-style:solid; }
.tm-approval-btn--approve { background:rgba(16,185,129,0.15); color:#047857; }
.tm-approval-btn--approve:hover { background:rgba(16,185,129,0.25); }
.tm-approval-btn--reject  { background:rgba(239,68,68,0.10); color:#b91c1c; }
.tm-approval-btn--reject:hover  { background:rgba(239,68,68,0.20); }
/* Файлы */
.tm-files-list { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.tm-file-item { display:flex; align-items:center; gap:8px; padding:8px 10px; background:#f7f8fc; border:1px solid #e8eaf0; border-radius:8px; }
.tm-file-name { flex:1; font-size:13px; color:#4c4775; text-decoration:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tm-file-name:hover { color:#6366f1; }
.tm-attach-btn { display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:9px; background:transparent; border:1.5px dashed #d0d3e8; color:#9896b8; font-size:13px; font-weight:500; cursor:pointer; transition:0.15s; font-family:inherit; }
.tm-attach-btn:hover { border-color:#6366f1; color:#6366f1; background:#f5f5ff; }
.tm-attach-btn--media { margin-top:10px; width:100%; justify-content:center; }
/* Медиа */
.tm-media-masonry { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.tm-video-item { margin-bottom:8px; }
.tm-video-player { width:100%; border-radius:10px; max-height:200px; }
.tm-video-meta { display:flex; align-items:center; gap:8px; font-size:12px; color:#9896b8; margin-top:4px; }
.tm-media-author { position:absolute; bottom:4px; left:4px; }
/* Исполнители */
.tm-assignees-chips { display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.tm-assignee-chip { display:flex; align-items:center; gap:8px; padding:8px 10px; background:#f7f8fc; border:1px solid #e8eaf0; border-radius:10px; }
.tm-assignee-info { flex:1; min-width:0; }
.tm-assignee-name { font-size:13px; font-weight:600; color:#1e1b4b; }
.tm-assignee-role { width:100%; background:transparent; border:none; outline:none; font-size:11px; color:#9896b8; font-family:inherit; margin-top:2px; }
.tm-assignee-role::placeholder { color:#c8c5d8; }
.tm-assignee-del { background:none; border:none; cursor:pointer; color:#d0d3e8; font-size:12px; padding:2px; transition:0.15s; flex-shrink:0; }
.tm-assignee-del:hover { color:#ef4444; }
.tm-add-assignee-btn { display:flex; align-items:center; gap:7px; padding:8px 12px; border-radius:9px; background:transparent; border:1.5px dashed #d0d3e8; color:#9896b8; font-size:13px; cursor:pointer; transition:0.15s; font-family:inherit; width:100%; justify-content:center; }
.tm-add-assignee-btn:hover { border-color:#6366f1; color:#6366f1; background:#f5f5ff; }
.tm-assignee-picker { background:white; border:1px solid #e8eaf0; border-radius:12px; box-shadow:0 8px 24px rgba(30,27,75,0.12); padding:6px; margin-top:6px; max-height:200px; overflow-y:auto; }
.tm-picker-item { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:8px; cursor:pointer; transition:0.15s; }
.tm-picker-item:hover { background:#f0f2f8; }
/* Прогресс на карточке канбана */
.tm-card-progress { height:4px; background:#e8eaf0; border-radius:2px; overflow:hidden; margin-bottom:4px; }
.tm-card-progress-bar { height:100%; border-radius:2px; transition:width 0.3s; }


/* ============================================================
   ЯНДЕКС ДИСК — модальное окно выбора файлов
   ============================================================ */

/* Модальное окно */
.yadisk-modal {
    width: 860px;
    max-width: 96vw;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow-lg);
}

/* Шапка */
.yadisk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
    flex-shrink: 0;
}

.yadisk-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.yadisk-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Хлебные крошки */
.yadisk-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

.yadisk-crumb {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yadisk-crumb:hover { background: rgba(99,102,241,0.08); color: var(--accent); }
.yadisk-crumb.active { color: var(--text-primary); font-weight: 600; cursor: default; }
.yadisk-crumb.active:hover { background: none; }

.yadisk-crumb-sep {
    font-size: 9px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Тулбар */
.yadisk-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(99,102,241,0.04);
    border-bottom: 1px solid rgba(99,102,241,0.08);
    flex-shrink: 0;
}

.yadisk-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.yadisk-back-btn:hover:not(:disabled) {
    background: rgba(99,102,241,0.08);
    color: var(--accent);
    border-color: var(--accent);
}

.yadisk-back-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.yadisk-selected-info {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
}

.yadisk-clear-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.yadisk-clear-btn:hover { background: rgba(239,68,68,0.18); }

/* Тело */
.yadisk-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    position: relative;
}

.yadisk-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.yadisk-loading i { font-size: 20px; color: var(--accent); }

.yadisk-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #ef4444;
    font-size: 14px;
}

.yadisk-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

.yadisk-empty i { font-size: 32px; opacity: 0.4; }

/* Грид файлов */
.yadisk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* Элемент файла/папки */
.yadisk-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255,255,255,0.5);
    position: relative;
    user-select: none;
}

.yadisk-item:hover {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.2);
}

.yadisk-item.selected {
    background: rgba(99,102,241,0.12);
    border-color: var(--accent);
}

.yadisk-item.is-dir:hover { border-color: rgba(245,158,11,0.4); }

/* Превью */
.yadisk-item-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: rgba(99,102,241,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.yadisk-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yadisk-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.yadisk-item-icon i { font-size: 28px; }

/* Галочка выбора */
.yadisk-item-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(99,102,241,0.4);
}

/* Инфо */
.yadisk-item-info {
    width: 100%;
    text-align: center;
}

.yadisk-item-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.3;
}

.yadisk-item-size {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Футер */
.yadisk-footer {
    border-top: 1px solid rgba(99,102,241,0.1);
    padding: 12px 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yadisk-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Превью выбранных */
.yadisk-selected-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 80px;
    overflow-y: auto;
}

.yadisk-sel-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 200px;
}

.yadisk-sel-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.yadisk-sel-chip button {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    font-size: 11px;
    transition: var(--transition);
}

.yadisk-sel-chip button:hover { color: #ef4444; }

/* ─── Вложения Яндекс Диска в модалках ─── */
.yadisk-attachments-section {
    /* Базовый контейнер — без padding, задаётся контекстом */
}

/* В карточке поста (pm-card без padding) — добавляем отступы */
.pm-card .yadisk-attachments-section {
    padding: 0 16px 12px;
}

/* В карточке задачи (tm-card уже с padding:16px) — отступы не нужны */
.tm-card .yadisk-attachments-section {
    padding: 0;
}

.yadisk-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.yadisk-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(252,63,29,0.05);
    border: 1px solid rgba(252,63,29,0.15);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.yadisk-attachment:hover { background: rgba(252,63,29,0.08); }

.yadisk-att-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(99,102,241,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.yadisk-att-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yadisk-att-icon { display: flex; align-items: center; justify-content: center; }
.yadisk-att-icon i { font-size: 16px; }

.yadisk-att-info {
    flex: 1;
    min-width: 0;
}

.yadisk-att-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yadisk-att-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

.yadisk-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    background: rgba(252,63,29,0.12);
    color: #c0392b;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.yadisk-att-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.yadisk-att-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(99,102,241,0.08);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 12px;
}

.yadisk-att-btn:hover { background: rgba(99,102,241,0.16); color: var(--accent); }
.yadisk-att-del:hover { background: rgba(239,68,68,0.12) !important; color: #ef4444 !important; }

/* Кнопка "Прикрепить с Яндекс Диска" */
.yadisk-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px dashed rgba(252,63,29,0.4);
    border-radius: var(--radius-sm);
    background: rgba(252,63,29,0.04);
    color: #c0392b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.yadisk-attach-btn:hover {
    background: rgba(252,63,29,0.1);
    border-color: rgba(252,63,29,0.6);
}

.yadisk-attach-btn svg { flex-shrink: 0; }

/* ─── Разделитель "или с Яндекс Диска" внутри карточки медиа ─── */
.pm-yadisk-divider {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* В посте (pm-card без padding) — добавляем горизонтальные отступы */
.pm-card .pm-yadisk-divider {
    padding: 0 16px;
}

/* В задаче (tm-card уже с padding) — без дополнительных отступов */
.tm-card .pm-yadisk-divider {
    padding: 0;
    margin-top: 12px;
}

.pm-yadisk-divider::before,
.pm-yadisk-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(99,102,241,0.12);
}

/* ─── Лайтбокс-оверлей для вложений Яндекс Диска ─── */
.yadisk-att-thumb--clickable { cursor: pointer; }

.yadisk-att-zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: var(--transition);
    border-radius: 6px;
}

.yadisk-att-thumb--clickable:hover .yadisk-att-zoom {
    background: rgba(0,0,0,0.35);
    opacity: 1;
}

/* ─── Медиа-плитка вложений Яндекс Диска ─── */
.yadisk-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.yadisk-media-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(99,102,241,0.06);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.yadisk-media-tile:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.yadisk-media-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Видео-тайл */
.yadisk-tile-video {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.yadisk-tile-video-icon {
    font-size: 36px;
    color: rgba(255,255,255,0.7);
    pointer-events: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Оверлей при наведении */
.yadisk-tile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.yadisk-media-tile:hover .yadisk-tile-overlay {
    background: rgba(0,0,0,0.3);
    opacity: 1;
}

/* Кнопки поверх тайла */
.yadisk-tile-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: var(--transition);
}

.yadisk-media-tile:hover .yadisk-tile-actions {
    opacity: 1;
}

.yadisk-tile-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #4c4775;
    text-decoration: none;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.yadisk-tile-btn:hover { background: white; color: var(--accent); }
.yadisk-tile-del:hover { color: #ef4444 !important; }

/* Подпись под тайлом */
.yadisk-tile-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: white;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.yadisk-media-tile:hover .yadisk-tile-caption {
    opacity: 1;
}

/* Ошибка загрузки */
.yadisk-tile-error {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.2);
}

/* Документы — компактный список */
.yadisk-doc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

/* ─── Лайтбокс Яндекс Диска — тёмный фон как у основного ─── */
#yadisk-lightbox {
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(6px);
    z-index: 2000;
}

#yadisk-lightbox .lightbox-img-wrap {
    overflow: hidden;
}

/* ─── Кнопка "Ссылка на альбом" ─── */
.yadisk-attach-btn--album {
    border-color: rgba(99,102,241,0.3);
    color: var(--accent-dark);
    background: rgba(99,102,241,0.04);
}

.yadisk-attach-btn--album:hover {
    background: rgba(99,102,241,0.1);
    border-color: var(--accent);
}

/* ─── Список альбомов ─── */
.yadisk-album-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

.yadisk-album-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.06));
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.yadisk-album-item:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.1));
    border-color: var(--accent);
}

.yadisk-album-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    flex-shrink: 0;
}


/* ============================================================
   НОВАЯ СИСТЕМА ЗАДАЧ — Workload
   ============================================================ */

/* ─── Тулбар ─── */
.wl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    margin-bottom: 14px;
    gap: 14px;
    flex-shrink: 0;
}

.wl-tabs {
    display: flex;
    gap: 4px;
    background: var(--glass-bg-inner);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.4);
}

.wl-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
    white-space: nowrap;
}

.wl-tab:hover { color: var(--text-primary); }

.wl-tab.active {
    background: white;
    color: var(--accent-dark);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.wl-tab i { font-size: 13px; }

/* ─── Контент ─── */
.wl-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.wl-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
}

.wl-loading, .wl-error, .wl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.wl-loading i { font-size: 24px; color: var(--accent); }
.wl-error  { color: #ef4444; }

/* ─── Статистика ─── */
.wl-stats-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.wl-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    min-width: 100px;
}

.wl-stat i { font-size: 16px; color: var(--accent); }
.wl-stat span { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.wl-stat small { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.wl-stat--danger  { border-color: rgba(239,68,68,0.3);  background: rgba(239,68,68,0.06);  }
.wl-stat--danger  i { color: #ef4444; }
.wl-stat--urgent  { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.07); }
.wl-stat--urgent  i { color: #f59e0b; }
.wl-stat--warning { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.05); }
.wl-stat--warning i { color: #f59e0b; }
.wl-stat--review  { border-color: rgba(99,102,241,0.3);  background: rgba(99,102,241,0.06); }
.wl-stat--review  i { color: var(--accent); }
.wl-stat--post    { border-color: rgba(236,72,153,0.25); background: rgba(236,72,153,0.05); }
.wl-stat--post    i { color: #ec4899; }

/* ─── Группы ─── */
.wl-group {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(16px);
}

.wl-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.wl-group-header i { font-size: 13px; }
.wl-group-count {
    margin-left: auto;
    background: rgba(99,102,241,0.12);
    color: var(--accent-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.wl-group-chevron { transition: var(--transition); }
.wl-group.collapsed .wl-group-chevron { transform: rotate(-90deg); }
.wl-group.collapsed .wl-group-items { display: none; }

.wl-group--danger  .wl-group-header { background: rgba(239,68,68,0.08);  color: #b91c1c; border-color: rgba(239,68,68,0.15); }
.wl-group--urgent  .wl-group-header { background: rgba(245,158,11,0.08); color: #b45309; border-color: rgba(245,158,11,0.15); }
.wl-group--warning .wl-group-header { background: rgba(245,158,11,0.05); color: #b45309; }
.wl-group--done    .wl-group-header { background: rgba(16,185,129,0.06); color: #047857; }
.wl-group--nodate  .wl-group-header { background: rgba(148,163,184,0.08); }

.wl-group-items {
    display: flex;
    flex-direction: column;
}

/* ─── Элемент задачи/поста ─── */
.wl-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    cursor: pointer;
    transition: var(--transition);
}

.wl-item:last-child { border-bottom: none; }

.wl-item:hover {
    background: rgba(255,255,255,0.5);
}

.wl-item-left { flex-shrink: 0; }

.wl-item-type-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.wl-type-task        { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.wl-type-post-text   { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.wl-type-post-media  { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.wl-type-post-author { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

.wl-item-body {
    flex: 1;
    min-width: 0;
}

.wl-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wl-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wl-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wl-item-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.wl-status--backlog  { background: rgba(148,163,184,0.15); color: #475569; }
.wl-status--progress { background: rgba(245,158,11,0.15);  color: #b45309; }
.wl-status--review   { background: rgba(99,102,241,0.15);  color: #4338ca; }
.wl-status--done     { background: rgba(16,185,129,0.15);  color: #047857; }
.wl-status--danger   { background: rgba(239,68,68,0.12);   color: #b91c1c; }

.wl-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.wl-badge-date     { color: var(--text-secondary); }
.wl-badge-rework   { color: #ef4444; font-weight: 600; }
.wl-badge-todo     { color: #6366f1; font-weight: 600; }
.wl-badge-pending  { color: #f59e0b; font-weight: 600; }
.wl-badge-ok       { color: #10b981; font-weight: 600; }
.wl-badge-approval { color: #6366f1; font-weight: 600; }
.wl-badge-approved { color: #10b981; font-weight: 600; }
.wl-badge-rejected { color: #ef4444; font-weight: 600; }

.wl-item-progress {
    display: inline-block;
    width: 60px;
    height: 4px;
    background: #e8eaf0;
    border-radius: 2px;
    overflow: hidden;
    vertical-align: middle;
}

.wl-item-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

.wl-item-progress-label {
    font-size: 10px;
    color: var(--text-muted);
}

.wl-item-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wl-post-role-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(99,102,241,0.1);
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ─── Доска с фильтрами ─── */
.wl-board-filters {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.wl-filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.wl-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 10px;
    padding: 7px 12px;
    flex: 1;
    min-width: 180px;
}

.wl-search-wrap i { color: var(--text-muted); font-size: 12px; }
.wl-search-wrap input { flex: 1; background: transparent; font-size: 13px; }

.wl-board-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wl-board-list .wl-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
}

.wl-board-list .wl-item:hover {
    background: rgba(255,255,255,0.7);
    transform: translateX(2px);
}

/* ─── Сводка по сотрудникам ─── */
.wl-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.wl-ov-card {
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.wl-ov-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow-lg);
}

.wl-ov-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.wl-ov-info { flex: 1; min-width: 0; }
.wl-ov-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.wl-ov-role { font-size: 11px; color: var(--text-muted); }

.wl-ov-counts {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.wl-ov-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(99,102,241,0.08);
    padding: 4px 8px;
    border-radius: 8px;
}

.wl-ov-count i { font-size: 11px; color: var(--accent); }

.wl-ov-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.wl-ov-alert {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.wl-ov-alert--danger { background: rgba(239,68,68,0.12);  color: #b91c1c; }
.wl-ov-alert--review { background: rgba(99,102,241,0.12); color: #4338ca; }
.wl-ov-alert--post   { background: rgba(236,72,153,0.1);  color: #be185d; }

.wl-ov-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(99,102,241,0.08);
}


/* ============================================================
   СПИСОК ПОСТОВ — табличный вид
   ============================================================ */

.view-posts {
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.view-posts.active {
    display: flex;
}

/* ─── Тулбар ─── */
.posts-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 14px;
    flex-shrink: 0;
}

.posts-list-tabs {
    display: flex;
    gap: 4px;
    background: var(--glass-bg-inner);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.4);
    flex-wrap: wrap;
}

.pl-tab {
    padding: 7px 14px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
    white-space: nowrap;
}

.pl-tab:hover { color: var(--text-primary); }

.pl-tab.active {
    background: white;
    color: var(--accent-dark);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* ─── Обёртка таблицы ─── */
.posts-list-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
	margin-top: 10px;
}

/* ─── Заголовок таблицы ─── */
.posts-list-header {
    display: grid;
    grid-template-columns: 1fr 140px 160px 140px 140px 90px;
    gap: 0;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
    background: rgba(99,102,241,0.03);
    flex-shrink: 0;
}

.pl-col {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* ─── Тело таблицы ─── */
#posts-list-body {
    flex: 1;
    overflow-y: auto;
}

#posts-list-body::-webkit-scrollbar { width: 5px; }
#posts-list-body::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 3px; }

/* ─── Строка поста ─── */
.pl-row {
    display: grid;
    grid-template-columns: 1fr 140px 160px 140px 140px 90px;
    gap: 0;
    padding: 13px 20px;
    border-bottom: 1px solid rgba(99,102,241,0.06);
    align-items: center;
    transition: var(--transition);
}

.pl-row-clickable {
    cursor: pointer;
}

.pl-row-clickable:hover {
    background: rgba(99,102,241,0.04);
}

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

.pl-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.pl-row-clickable:hover .pl-title {
    color: var(--accent-dark);
}

/* ─── Категория ─── */
.pl-cat-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: color-mix(in srgb, var(--cat-color, #6366f1) 12%, transparent);
    color: var(--cat-color, #6366f1);
    white-space: nowrap;
}

/* ─── Статус ─── */
.pl-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pl-status-planned   { background: rgba(148,163,184,0.15); color: #475569; }
.pl-status-pending   { background: rgba(245,158,11,0.15);  color: #b45309; }
.pl-status-approved  { background: rgba(16,185,129,0.15);  color: #047857; }
.pl-status-published { background: rgba(99,102,241,0.15);  color: #4338ca; }
.pl-status-rejected  { background: rgba(239,68,68,0.12);   color: #b91c1c; }

/* ─── Дата и автор ─── */
.pl-col-date, .pl-col-author {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ─── Кнопки действий ─── */
.pl-col-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.pl-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: var(--transition);
    color: var(--text-muted);
    background: transparent;
}

.pl-edit-btn:hover   { background: rgba(99,102,241,0.1);  color: var(--accent); }
.pl-delete-btn:hover { background: rgba(239,68,68,0.1);   color: #ef4444; }

/* ─── Состояния ─── */
.pl-loading, .pl-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
    flex-direction: column;
}

.pl-empty i { font-size: 32px; opacity: 0.3; }

/* ─── Пагинация ─── */
.pl-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid rgba(99,102,241,0.08);
    flex-shrink: 0;
}

.pl-pag-info {
    font-size: 12px;
    color: var(--text-muted);
}

.pl-pag-btns {
    display: flex;
    gap: 4px;
}

.pl-pag-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(99,102,241,0.15);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pl-pag-btn:hover:not(:disabled) {
    background: rgba(99,102,241,0.08);
    color: var(--accent);
    border-color: var(--accent);
}

.pl-pag-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 700;
}

.pl-pag-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ─── Адаптив ─── */
@media (max-width: 900px) {
    .posts-list-header,
    .pl-row {
        grid-template-columns: 1fr 120px 100px 80px;
    }
    .pl-col-cat, .pl-col-author { display: none; }
}

/* ─── Унификация вертикальных отступов glass-тулбаров ─── */
/* Все блоки с классом glass используемые как тулбары/панели */
.posts-list-toolbar.glass,
.wl-toolbar.glass,
.tasks-toolbar.glass,
.wl-board-filters.glass-inner {
    padding-top: 14px;
    padding-bottom: 14px;
	margin-top: 10px;
}

/* ─── Трёхколоночный layout задач ─── */
.wl-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: start;
}

.wl-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* Заголовок колонки */
.wl-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
}

.wl-col-title i { font-size: 13px; }

.wl-col-title--danger {
    background: rgba(239,68,68,0.08);
    color: #b91c1c;
    border: 1px solid rgba(239,68,68,0.15);
}

.wl-col-title--week {
    background: rgba(99,102,241,0.08);
    color: var(--accent-dark);
    border: 1px solid rgba(99,102,241,0.15);
}

.wl-col-title--later {
    background: rgba(148,163,184,0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148,163,184,0.2);
}

/* Пустое состояние колонки */
.wl-col-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 14px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--glass-bg-inner);
    border: 1px dashed rgba(99,102,241,0.15);
    border-radius: var(--radius);
}

.wl-col-empty i { opacity: 0.5; }

/* Группа "На проверке" */
.wl-group--review .wl-group-header {
    background: rgba(99,102,241,0.08);
    color: #4338ca;
    border-color: rgba(99,102,241,0.15);
}

/* Адаптив — на узких экранах 1 колонка */
@media (max-width: 1100px) {
    .wl-columns { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
    .wl-columns { grid-template-columns: 1fr; }
}


/* ============================================================
   УВЕДОМЛЕНИЯ
   ============================================================ */

/* ─── Кнопка в шапке ─── */
.notif-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--glass-bg-inner);
    border: 1px solid rgba(255,255,255,0.5);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.notif-btn:hover {
    background: rgba(255,255,255,0.7);
    color: var(--accent-dark);
    transform: translateY(-1px);
}

.notif-btn i { font-size: 15px; }

/* Бейдж с числом */
.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-base);
    animation: notif-pop 0.3s cubic-bezier(.4,0,.2,1);
}

@keyframes notif-pop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ─── Панель уведомлений ─── */
.notif-panel {
    position: fixed;
    width: 360px;
    max-height: 520px;
    flex-direction: column;
    z-index: 1500;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(30,27,75,0.2);
    animation: modalIn 0.2s cubic-bezier(.4,0,.2,1);
}

/* hidden перебивается display:flex — явно запрещаем */
.notif-panel[hidden] {
    display: none !important;
}

/* Показываем как flex только когда не hidden */
.notif-panel:not([hidden]) {
    display: flex;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
    flex-shrink: 0;
}

.notif-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-read-all-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
    font-family: inherit;
}

.notif-read-all-btn:hover { background: rgba(99,102,241,0.08); }

/* ─── Список ─── */
.notif-list {
    flex: 1;
    overflow-y: auto;
}

.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 2px; }

.notif-loading, .notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-empty i { font-size: 24px; opacity: 0.4; }

/* ─── Элемент уведомления ─── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(99,102,241,0.06);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: rgba(99,102,241,0.04); }

.notif-item--unread { background: rgba(99,102,241,0.04); }
.notif-item--unread:hover { background: rgba(99,102,241,0.08); }

/* Иконка типа */
.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* Тело */
.notif-body { flex: 1; min-width: 0; }

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 2px;
}

.notif-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-actor {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* Точка непрочитанного */
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

/* ─── Плашка "Согласовал" в строке согласования ─── */
.apr-approved-by {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 11px;
    color: #047857;
    font-weight: 500;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 20px;
    padding: 2px 8px 2px 3px;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
}

.apr-approved-by span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Логотип-изображение в чипе платформы ─── */
.pm-plat-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}
