/**
 * CRM Sidebar & Logo — стили логотипа, main content offset, legacy sidebar
 * 
 * Кодировка: UTF-8
 * @version 1.0.0
 */

/* ═══════════════════════════════════════════════════════════════════════
   ЛОГОТИП — Fresh стиль
   ═══════════════════════════════════════════════════════════════════════ */
.crm-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 8px 16px 8px 8px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

.crm-logo:hover {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.08) 0%, rgba(244, 114, 182, 0.06) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 146, 60, 0.1);
}

.crm-logo-img {
    height: 38px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.crm-logo:hover .crm-logo-img {
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
}

.crm-logo-text {
    font-weight: 700;
    font-size: 17px;
    background: linear-gradient(135deg, #1e293b 0%, #475569 50%, #64748b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
    position: relative;
}

.crm-logo-text::after {
    content: 'PRO';
    position: absolute;
    top: -6px;
    right: -28px;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f472b6, #fb923c);
    color: #fff;
    letter-spacing: 0.5px;
    -webkit-text-fill-color: #fff;
    box-shadow: 0 2px 8px rgba(244, 114, 182, 0.35);
}

/* ═══════════════════════════════════════════════════════════════════════
   SMART SIDEBAR — Main Content Offset
   ═══════════════════════════════════════════════════════════════════════ */
.ss-main-content {
    margin-left: 280px;
    margin-top: 38px;
    min-height: calc(100vh - 38px);
    transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
    .ss-main-content {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   БОКОВОЕ МЕНЮ (Legacy) — Скрыто (перенесено в smart-sidebar)
   ═══════════════════════════════════════════════════════════════════════ */
.side-bar {
    display: none !important;
}
.side-bar__inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.side-action {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    color: #64748b;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.side-action.side-action--notes {
    overflow: visible;
}
.side-action:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}
.side-action:focus {
    outline: 2px solid rgba(59, 130, 246, 0.25);
    outline-offset: 2px;
}
.side-icon {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    transition: transform 0.2s ease;
}

.side-action:hover .side-icon {
    transform: scale(1.05);
}

.side-notes-bell {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    color: #f97316;
    display: none;
}

.side-notes-has .side-icon {
    animation: side-note-pulse 1.8s ease-in-out infinite;
}

.side-notes-reminder-soon .side-notes-bell {
    display: block;
    animation: side-note-bell-shake 0.7s ease-in-out infinite;
}

.side-notes-reminder-soon .side-icon {
    animation: side-note-pulse-strong 1.4s ease-in-out infinite;
}

/* TODO: PERF — Отключить infinite анимации через prefers-reduced-motion или perf-mode
   @media (prefers-reduced-motion: reduce) {
       .side-notes-has .side-icon,
       .side-notes-reminder-soon .side-icon { animation: none; }
       .side-notes-reminder-soon .side-notes-bell { animation: none; }
   }
*/
@keyframes side-note-pulse {
    0%, 100% { transform: none; opacity: 1; }
    50% { transform: translateY(-1px); opacity: 0.85; }
}

@keyframes side-note-pulse-strong {
    0%, 100% { transform: none; opacity: 1; }
    50% { transform: translateY(-1px) scale(1.05); opacity: 1; }
}

@keyframes side-note-bell-shake {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(-18deg); }
    40% { transform: rotate(16deg); }
    60% { transform: rotate(-10deg); }
    80% { transform: rotate(6deg); }
    100% { transform: rotate(0deg); }
}

/* Tooltip для кнопок */
.side-action::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    background: #1a1a1a;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 120;
}
.side-action::before {
    content: '';
    position: absolute;
    right: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #1a1a1a;
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 119;
}
.side-action:hover::after,
.side-action:focus::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.side-action:hover::before,
.side-action:focus::before {
    opacity: 1;
}

@media (max-width: 900px) {
    .side-bar { right: 4px; }
}
@media (max-width: 640px) {
    .side-bar { display: none; }
}
