/* -------------------- Общие -------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

/* Переключатель ролей */
.role-switcher {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    background: #fff;
    padding: 8px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.role-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.role-btn.active {
    background: #2D6CF3;
    color: #fff;
    box-shadow: 0 4px 12px rgba(45,108,243,0.3);
}

.role-btn:hover {
    color: #2D6CF3;
}
.role-btn.active:hover {
    color: #fff;
}

/* -------------------- Мобильный телефон -------------------- */
#mobile-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.phone-wrapper {
    display: flex;
    justify-content: center;
}

.phone {
    width: 375px;
    height: 780px;
    background: #F5F7FB;
    border-radius: 40px;
    border: 10px solid #1A1A1A;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

/* Имитация чёлки (динамический остров) */
.notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 30px;
    background: #1A1A1A;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

/* Верхняя панель телефона */
.phone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px 20px;
    background: transparent;
    color: #1A1A1A;
    font-weight: 600;
    font-size: 14px;
    margin-top: 10px;
    z-index: 5;
    position: relative;
}

.phone-header .time {
    font-weight: 600;
}

.phone-header .title {
    font-weight: 700;
    color: #2D6CF3;
}

.phone-header .icons i {
    margin-left: 4px;
    font-size: 14px;
}

/* Основной контент телефона (скроллится) */
.phone-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px 10px 16px;
    scroll-behavior: smooth;
}
.phone-content::-webkit-scrollbar {
    width: 0;
}

/* Нижняя навигация */
.phone-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #fff;
    padding: 8px 0 12px 0;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 8px;
}
.nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
}
.nav-item.active {
    color: #2D6CF3;
}
.nav-item span {
    font-weight: 500;
}

/* -------------------- Стили для экранов приложений -------------------- */

/* Карточки */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

/* Статус-теги */
.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.tag-blue { background: #DBEAFE; color: #1D4ED8; }
.tag-yellow { background: #FEF3C7; color: #B45309; }
.tag-green { background: #D1FAE5; color: #065F46; }
.tag-red { background: #FEE2E2; color: #991B1B; }
.tag-gray { background: #F3F4F6; color: #4B5563; }

/* Кнопки */
.btn-primary {
    background: #2D6CF3;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover {
    background: #1D4ED8;
}

.btn-outline {
    background: transparent;
    border: 1px solid #2D6CF3;
    color: #2D6CF3;
    border-radius: 30px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
}

/* Списки */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.list-item:last-child {
    border-bottom: none;
}

/* Прогресс-бар */
.progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    margin: 8px 0;
}
.progress-fill {
    height: 100%;
    background: #2D6CF3;
    border-radius: 10px;
    width: 0%;
}

/* -------------------- CRM стили -------------------- */
#crm-container {
    width: 100%;
    max-width: 1400px;
}

.crm-wrapper {
    display: flex;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    overflow: hidden;
    min-height: 700px;
}

/* Сайдбар */
.crm-sidebar {
    width: 260px;
    background: #F9FAFB;
    padding: 30px 20px;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.crm-logo {
    font-size: 22px;
    font-weight: 800;
    color: #2D6CF3;
    margin-bottom: 40px;
}

.crm-menu {
    list-style: none;
    flex: 1;
}
.crm-menu li {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}
.crm-menu li i {
    width: 20px;
    text-align: center;
}
.crm-menu li.active {
    background: #EEF2FF;
    color: #2D6CF3;
}
.crm-menu li:hover:not(.active) {
    background: #f3f4f6;
}

.crm-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    font-weight: 500;
    color: #374151;
}
.crm-user i {
    font-size: 28px;
    color: #9ca3af;
}

/* Основная область CRM */
.crm-main {
    flex: 1;
    padding: 30px 40px;
    overflow-y: auto;
}

/* KPI плитки */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}
.kpi-item {
    background: #F9FAFB;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}
.kpi-item .number {
    font-size: 28px;
    font-weight: 700;
    color: #1A1A1A;
}
.kpi-item .label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

/* Таблицы CRM */
.crm-table-wrap {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 24px;
}
.crm-table-wrap h3 {
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}
.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.crm-table th {
    text-align: left;
    padding: 12px 20px;
    background: #F9FAFB;
    color: #6b7280;
    font-weight: 500;
}
.crm-table td {
    padding: 12px 20px;
    border-top: 1px solid #f3f4f6;
}
.crm-table .tag {
    font-size: 12px;
}

/* Поиск */
.crm-search {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.crm-search input {
    padding: 10px 16px;
    border-radius: 30px;
    border: 1px solid #e5e7eb;
    width: 300px;
    font-size: 14px;
}

/* Адаптив CRM */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .crm-wrapper {
        flex-direction: column;
    }
    .crm-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .crm-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .crm-menu li {
        padding: 6px 12px;
        font-size: 13px;
    }
    .crm-main {
        padding: 16px;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* -------------------- Вспомогательные -------------------- */
.mb-2 { margin-bottom: 8px; }
.mt-2 { margin-top: 8px; }
.text-center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-4 { gap: 4px; }
