* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f0f4f8;
    color: #1e293b;
    height: 100vh;
    overflow: hidden;
}

.hidden { display: none !important; }

/* ВСПЛЫВАЮЩИЕ УВЕДОМЛЕНИЯ */
.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
}

.toast {
    background: #0f172a;
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #005b7f;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* ИКОНКИ ТЕМНО-СИНЕГО ЦВЕТА И БЕЛЫЙ ТЕКСТ */
.ios-icon {
    width: 22px; height: 22px; fill: #005b7f; transition: transform 0.2s; flex-shrink: 0;
}
.ios-icon-white {
    width: 18px; height: 18px; fill: #ffffff;
}

/* АВТОРИЗАЦИЯ */
.login-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #0f172a; display: flex; justify-content: center; align-items: center; z-index: 9999;
}
.login-card {
    background: white; padding: 35px; border-radius: 16px; width: 360px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.login-logo-header {
    text-align: center; margin-bottom: 25px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.login-logo-header h2 { font-size: 18px; color: #005b7f; }
.login-card input { width: 100%; margin-bottom: 15px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; }

/* ЛОГОТИП ЦП */
.logo-box-cp {
    width: 38px; height: 38px; border: 3px solid #005b7f; border-radius: 8px;
    display: flex; justify-content: center; align-items: center; position: relative; background: white; flex-shrink: 0;
}
.logo-box-cp.large { width: 54px; height: 54px; border-width: 4px; }
.logo-text-cp { font-weight: 900; color: #005b7f; font-size: 16px; line-height: 1; }
.logo-box-cp.large .logo-text-cp { font-size: 22px; }
.logo-dot-red { width: 8px; height: 8px; background-color: #e74c3c; position: absolute; bottom: 4px; right: 4px; }
.logo-box-cp.large .logo-dot-red { width: 12px; height: 12px; bottom: 5px; right: 5px; }

/* МЕНЮ: ТЕМНО-СИНИЕ ИКОНКИ И БЕЛЫЙ ТЕКСТ */
.app-container { display: flex; width: 100vw; height: 100vh; }

.sidebar {
    width: 64px;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(12px);
    color: white; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute; top: 0; left: 0; bottom: 0; z-index: 100;
    overflow: hidden; white-space: nowrap;
    display: flex; flex-direction: column; justify-content: space-between;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar:hover {
    width: 240px;
    background: rgba(15, 23, 42, 0.45);
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
}

.sidebar-logo { padding: 15px; display: flex; align-items: center; gap: 12px; }
.logo-full-text { display: flex; flex-direction: column; opacity: 0; transition: opacity 0.2s; font-size: 11px; color: #ffffff; }
.sidebar:hover .logo-full-text { opacity: 1; }
.logo-full-text strong { font-size: 13px; letter-spacing: 1px; color: #38bdf8; }

#main-nav a {
    display: flex; align-items: center; padding: 14px 20px; gap: 16px;
    color: #ffffff !important;
    text-decoration: none; transition: all 0.2s;
}
#main-nav a span { opacity: 0; transition: opacity 0.2s; font-size: 14px; font-weight: 600; color: #ffffff !important; }
.sidebar:hover #main-nav a span { opacity: 1; }
#main-nav a:hover, #main-nav a.active { background: rgba(255, 255, 255, 0.15); }

.user-profile-widget {
    padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.user-info-group { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.user-avatar-mini { font-size: 18px; flex-shrink: 0; }
.user-name-text { font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 0.2s; color: white; }
.sidebar:hover .user-name-text { opacity: 1; }

.btn-door-logout {
    width: 36px; height: 36px; background: #ef4444; color: white;
    border: none; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-door-logout:hover { background: #dc2626; }

.content-area { flex: 1; margin-left: 64px; padding: 20px; overflow-y: auto; height: 100vh; }

/* СТРЕЛОЧКИ С УМЕНЬШЕННЫМ ИНТЕРВАЛОМ И СТРОГИМ РАЗМЕРОМ */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.top-actions { display: flex; gap: 10px; }

.kanban-board {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 15px; height: calc(100vh - 100px);
}

.stage-column {
    flex: 0 0 210px; background: #e2e8f0; border-radius: 8px;
    display: flex; flex-direction: column; max-height: 100%;
}

.stage-header-bitrix {
    height: 54px;
    box-sizing: border-box;
    color: white; padding: 4px 10px 4px 14px; font-weight: bold; position: relative;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
    display: flex; flex-direction: column; justify-content: center; margin-bottom: 8px;
    line-height: 1.15;
}

.stage-title-row {
    display: flex; justify-content: space-between; align-items: center;
}

.stage-title-row span {
    font-size: 11px;
    line-height: 1.15;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Добавлено стандартное свойство для совместимости */
    -webkit-box-orient: vertical;
}

.stage-color-1 { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.stage-color-2 { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.stage-color-3 { background: linear-gradient(135deg, #ea580c, #fb923c); }
.stage-color-4 { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.stage-color-5 { background: linear-gradient(135deg, #16a34a, #4ade80); }
.stage-color-6 { background: linear-gradient(135deg, #334155, #64748b); }

.stage-quick-add { background: none; border: none; color: white; font-size: 16px; cursor: pointer; }
.stage-summary { font-size: 10px; color: #f8fafc; margin-top: 1px; }

.deals-container { flex: 1; overflow-y: auto; padding: 6px; }

.deal-card {
    background: white; padding: 12px; border-radius: 8px; margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04); cursor: grab; position: relative;
}
.deal-card h3 { font-size: 13px; color: #0f172a; margin-bottom: 4px; padding-right: 20px; }
.deal-price { font-weight: 700; color: #16a34a; font-size: 12px; }
.deal-edit-btn { position: absolute; top: 10px; right: 10px; background: transparent; border: none; cursor: pointer; }

.deal-tags-container { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag-pill { background: #e0f2fe; color: #0369a1; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.deal-manager-badge { font-size: 10px; color: #64748b; margin-top: 6px; }

/* ВСПЛЫВАЮЩЕЕ МЕНЮ СБРОСА */
.bottom-drop-bar {
    position: fixed; bottom: -120px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 15px; z-index: 2000; transition: bottom 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); padding: 12px 20px;
    border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border: 1px solid rgba(255, 255, 255, 0.15);
}
.bottom-drop-bar.visible { bottom: 25px; }

.drop-zone {
    width: 170px; height: 65px; border-radius: 12px; display: flex; flex-direction: column;
    justify-content: center; align-items: center; color: white; font-weight: bold; font-size: 13px; gap: 5px; cursor: pointer; transition: all 0.2s;
}
.drop-zone.zone-delete, .drop-zone.zone-lost { background: #ef4444; }
.drop-zone.zone-success { background: #22c55e; }
.drop-zone.drag-over { transform: scale(1.08); filter: brightness(1.2); box-shadow: 0 0 15px rgba(255,255,255,0.4); }
.zone-icon { width: 22px; height: 22px; fill: white; }

/* КНОПКИ И ТАБЛИЦЫ */
.btn { padding: 9px 16px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn.primary { background: #005b7f; color: white; }
.btn.primary:hover { background: #004763; }
.btn.secondary { background: #cbd5e1; color: #1e293b; }
.btn.danger { background: #ef4444; color: white; }
.btn.danger:hover { background: #dc2626; }
.btn.small { padding: 5px 10px; font-size: 12px; }

.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.data-table th { background: #f8fafc; color: #64748b; font-size: 12px; }

.status-badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: bold; }
.status-badge.active { background: #e0f2fe; color: #0369a1; }
.status-badge.won { background: #dcfce7; color: #15803d; }
.status-badge.lost { background: #fee2e2; color: #b91c1c; }
.status-badge.deleted { background: #f1f5f9; color: #64748b; }

/* КАЛЕНДАРЬ И ДНИ НЕДЕЛИ */
.calendar-controls { display: flex; gap: 10px; align-items: center; }
.select-styled { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; font-weight: 600; }
.live-clock-card { background: #005b7f; color: white; padding: 8px 16px; border-radius: 8px; font-size: 20px; font-weight: bold; font-family: monospace; }

.calendar-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 15px;
    text-align: center; font-weight: 700; color: #005b7f; font-size: 13px;
    background: #e2e8f0; padding: 10px 0; border-radius: 8px;
}

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 8px; }
.calendar-day-card { background: white; border-radius: 8px; padding: 10px; min-height: 90px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.calendar-day-card.empty { background: transparent; box-shadow: none; }
.calendar-day-number { font-weight: bold; color: #64748b; margin-bottom: 6px; font-size: 12px; }

/* ЧАТ */
.chat-layout { display: flex; height: calc(100vh - 100px); background: white; border-radius: 10px; overflow: hidden; }
.chat-sidebar { width: 230px; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; }
.chat-sidebar-header { padding: 15px; border-bottom: 1px solid #e2e8f0; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.chat-item { padding: 12px 15px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.chat-item.active { background: #f0f9ff; color: #0284c7; font-weight: bold; }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-header-bar { padding: 12px 20px; border-bottom: 1px solid #e2e8f0; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; background: #f8fafc; }
.chat-bubble { background: white; padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; max-width: 70%; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.chat-bubble.mine { background: #005b7f; color: white; margin-left: auto; }
.chat-input-area { display: flex; padding: 12px; border-top: 1px solid #e2e8f0; background: white; }
.chat-input-area input { flex: 1; padding: 10px; margin-right: 10px; border: 1px solid #cbd5e1; border-radius: 8px; }

/* МОДАЛКИ */
.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 3000; }
.modal-content { background: white; padding: 25px; border-radius: 12px; width: 450px; max-height: 90vh; overflow-y: auto; }
.modal-content input, .modal-content select, .modal-content textarea { width: 100%; margin-bottom: 12px; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; }
.form-row { display: flex; gap: 10px; }
.checkbox-group { max-height: 150px; overflow-y: auto; border: 1px solid #cbd5e1; padding: 10px; border-radius: 8px; margin-bottom: 15px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
